Linuxbrew-core: Installing systemd: Make Error

Created on 31 Aug 2016  路  11Comments  路  Source: Homebrew/linuxbrew-core

Please follow the general troubleshooting steps first:

  • [x] Ran brew update and retried your prior step?
  • [x] Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • [ ] If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)?

_You can erase any parts of this template not applicable to your Issue._

Bug reports:

https://gist.github.com/jwhite007/67708ce35f6bb007bb022454d3999a1f

build failure outdated

Most helpful comment

We might have to fix intltool for Linux to use brewed perl.

All 11 comments

make[2]: *** [Makefile:20173: src/timedate/org.freedesktop.timedate1.policy] Error 2
make[2]: *** Deleting file 'src/timedate/org.freedesktop.timedate1.policy'
make[2]: *** Waiting for unfinished jobs....
You must have XML::Parser installed to run /toolbox/NGS/.linuxbrew/bin/intltool-merge

Can you install XML::Parser through CPAN and retry the installation please?

rwhogg,

Thanks for the response. I saw that in the logs; however, I do have XML::Parser installed to brew-installed Perl. I am using an alternate directory using local::lib, but the module is installed. Do I need to direct the make of systemd to the brew-installed Perl using "brew install systemd --with-brewed-perl" or some similar argument?

Cheers,
James

Thanks for the response.

Always happy to help :smile_cat:

Do I need to direct the make of systemd to the brew-installed Perl using "brew install systemd --with-brewed-perl" or some similar argument?

No such argument exists. Your gist-logs show that brew is picking up the correct perl, so I don't think that's the problem.

Maybe your local::lib isn't set up in your environment? If you didn't do so, can you please try:

  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
  echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >> ~/.bash_profile

You might also want to try doing brew install expat if you don't have that installed yet. brew sometimes gets confused about if XML::Parser is installed if you don't have expat available.

@maxim-belkin, any additional insights here?

Forgot to mention last time @jwhite007: thanks a bunch for the bug report!

@rwhogg Your solution should work.
_Edit:_
Note: adding eval... to ~/.bash_profile would require a logout/login or manual sourcing of ~/.bash_profile in the working shell. If ~/.bashrc is used instead, then one would need either to source ~/.bashrc or start a new terminal session.

Expat was already installed in linuxbrew, and in .brew_profile, a file that I manually source, I have

prefix=/toolbox/NGS/.linuxbrew
eval "$(perl -I$prefix/lib/perl5/perl_local/lib/perl5 -Mlocal::lib=$prefix/lib/perl5/perl_local)"

I had already done a bootstrap install of local::lib, so I didn't do PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib

I find the following a bit troubling...

sbcuser$ which perl
/toolbox/NGS/.linuxbrew/bin/perl
sbcuser$ perl -Mlocal::lib
PATH="/home/sbcuser/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/sbcuser/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/sbcuser/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/sbcuser/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/sbcuser/perl5"; export PERL_MM_OPT;

However, everything in my env seems to be fine...

sbcuser$ env | grep -i "perl"
PERL5LIB=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local/lib/perl5
PERL_MB_OPT=--install_base "/toolbox/NGS/.linuxbrew/lib/perl5/perl_local"
PATH=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local/bin:/toolbox/NGS/.linuxbrew/bin:/toolbox/NGS/.linuxbrew/sbin:/home/sbcuser/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
PERL_LOCAL_LIB_ROOT=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local
PERL_MM_OPT=INSTALL_BASE=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local

I believe that eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" is incorrect. eval "$(perl -I$(brew --prefix)/lib/perl5/perl_local/lib/perl5 -Mlocal::lib)" results in

sbcuser$ env | grep -i 'perl'
PERL5LIB=/home/sbcuser/perl5/lib/perl5
PERL_MB_OPT=--install_base "/home/sbcuser/perl5"
PATH=/home/sbcuser/perl5/bin:/toolbox/NGS/.linuxbrew/bin:/toolbox/NGS/.linuxbrew                         /sbin:/home/sbcuser/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/                         sbin
PERL_LOCAL_LIB_ROOT=/home/sbcuser/perl5
PERL_MM_OPT=INSTALL_BASE=/home/sbcuser/perl5

sbcuser$ brew install systemd
systemd: Unsatisfied dependency: XML::Parser
Homebrew does not provide special Perl dependencies; install with:
  `cpan -i XML::Parser`
Error: An unsatisfied requirement failed this build.

eval "$(perl -I$(brew --prefix)/lib/perl5/perl_local/lib/perl5 -Mlocal::lib=$(brew --prefix)/lib/perl5/perl_local)" results in

sbcuser$ env | grep -i 'perl'
PERL5LIB=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local/lib/perl5
PERL_MB_OPT=--install_base "/toolbox/NGS/.linuxbrew/lib/perl5/perl_local"
PATH=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local/bin:/toolbox/NGS/.linuxbrew/bin:/toolbox/NGS/.linuxbrew/sbin:/home/sbcuser/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
PERL_LOCAL_LIB_ROOT=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local
PERL_MM_OPT=INSTALL_BASE=/toolbox/NGS/.linuxbrew/lib/perl5/perl_local

sbcuser$ brew install systemd in this instance does not give the XML::Parser dependency warning. It appears that intltool-merge is not using the brewed perl.

If you look at intltool-merge (and other) files, you'll see #!/usr/bin/perl -w at the top... Hence, it obviously uses system's perl

maxim-belkin,

Thanks for the response. Well, I changed it to #!/toolbox/NGS/.linuxbrew/bin/perl -w, and systemd seemed to install just fine. #!/usr/bin/env perl -w did not seem to work.

Cheers,
James

We might have to fix intltool for Linux to use brewed perl.

@maxim-belkin Thank you for pointing it out. I got stuck at this for several hours ...
I also found it was using /usr/bin/perl, but I did not figure out how it happened.

Is there a decent way to handle this type of problem? Many script use #!/usr/bin/perl, #!/bin/bash, #!/usr/bin/python , etc
It is possible to automatically switch to brewed version for any script?

Thanks!

I believe this issue is resolved by https://github.com/Linuxbrew/homebrew-core/pull/1443

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davideo picture davideo  路  4Comments

baranyildirim picture baranyildirim  路  6Comments

vkyt picture vkyt  路  4Comments

oliver-la picture oliver-la  路  7Comments

hidvegin picture hidvegin  路  6Comments