This issue is made for beginners who want to learn about git/github, and help the Linuxbrew team fix some formulae.
We have 75 formulae that depend on intltool at build time.
intltool needs the XML::Parser perl module to be able to run. On OS X, XML::Parser is provided by the operating system. On Linux, we need to provide that module for the users who didn't install it by other means. If you do not have the module installed, formulae depending on intltool fail to build with this error message:
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
We chose to vendor (e.g. deliver) the XML::Parser module with intltool. See:
https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/intltool.rb#L19-L26
We now need to tell our 75 formulae how to find the XML::Parser and build bottles for them.
This should be as easy as adding the following lines to the install block of each formula:
# Needed by intltool (xml::parser)
ENV.prepend_path "PERL5LIB", "#{Formula["intltool"].libexec}/lib/perl5" unless OS.mac?
See #4448 for an example of pull request.
You will need to:
error: XML::Parser perl module is required for intltoolSome formulae may fail to build due to other unrelated problems: we can guide through the procedure to get them fixed too.
Feel free to comment on this issue or open pull requests!
Here is the list of the 75 formulae that may potentially need to be fixed:
Hey, thanks for opening this up so beginners can take a shot at it! I'll work on a few of these so I can get a feel for git/github.
I am working on Gedit at the moment and can confirm the issue on UbuntuTrusty64
Really appreciate the opportunity to help out! I'll take on a few of these.
馃憢 I want to help for Hackoberfest and jumped in with yelp-tools. The thing is I get no error for XML::Parser. After ~30 minutes of dependency installation, it errors here:
==> cmake -G Unix Makefiles /tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_C
==> make
Last 15 lines from /home/vagrant/.cache/Homebrew/Logs/llvm/02.make:
cd /tmp/llvm-20170930-27281-1r9503c/utils/TableGen && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++ -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170930-27281-1r9503c/utils/TableGen -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen -I/tmp/llvm-20170930-27281-1r9503c/include -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -DNDEBUG -o CMakeFiles/obj.llvm-tblgen.dir/DFAPacketizerEmitter.cpp.o -c /tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen/DFAPacketizerEmitter.cpp
[ 2%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/DisassemblerEmitter.cpp.o
cd /tmp/llvm-20170930-27281-1r9503c/utils/TableGen && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++ -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170930-27281-1r9503c/utils/TableGen -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen -I/tmp/llvm-20170930-27281-1r9503c/include -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -DNDEBUG -o CMakeFiles/obj.llvm-tblgen.dir/DisassemblerEmitter.cpp.o -c /tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen/DisassemblerEmitter.cpp
[ 2%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/FastISelEmitter.cpp.o
cd /tmp/llvm-20170930-27281-1r9503c/utils/TableGen && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++ -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170930-27281-1r9503c/utils/TableGen -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen -I/tmp/llvm-20170930-27281-1r9503c/include -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -DNDEBUG -o CMakeFiles/obj.llvm-tblgen.dir/FastISelEmitter.cpp.o -c /tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen/FastISelEmitter.cpp
[ 2%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/FixedLenDecoderEmitter.cpp.o
cd /tmp/llvm-20170930-27281-1r9503c/utils/TableGen && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++ -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170930-27281-1r9503c/utils/TableGen -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen -I/tmp/llvm-20170930-27281-1r9503c/include -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -DNDEBUG -o CMakeFiles/obj.llvm-tblgen.dir/FixedLenDecoderEmitter.cpp.o -c /tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen/FixedLenDecoderEmitter.cpp
[ 2%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/GlobalISelEmitter.cpp.o
cd /tmp/llvm-20170930-27281-1r9503c/utils/TableGen && /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++ -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-20170930-27281-1r9503c/utils/TableGen -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen -I/tmp/llvm-20170930-27281-1r9503c/include -I/tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -DNDEBUG -o CMakeFiles/obj.llvm-tblgen.dir/GlobalISelEmitter.cpp.o -c /tmp/llvm-20170930-27281-1trw1cm/llvm-5.0.0.src/utils/TableGen/GlobalISelEmitter.cpp
virtual memory exhausted: Cannot allocate memory
make[2]: *** [utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/GlobalISelEmitter.cpp.o] Error 1
make[2]: Leaving directory `/tmp/llvm-20170930-27281-1r9503c'
make[1]: *** [utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/all] Error 2
make[1]: Leaving directory `/tmp/llvm-20170930-27281-1r9503c'
make: *** [all] Error 2
READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting
Please do not report this issue to Homebrew/brew or Homebrew/core, which support macOS only.
vagrant@vagrant-ubuntu-trusty-64:~$
Not sure what's up. I think I'll try another bottle in the meantime.
Hi. Thanks for trying it out.
virtual memory exhausted: Cannot allocate memory
This means you have run out of RAM, or more probably, swap space on your hard drive. You could still open a pull request and see if our continuous integration is able to build it until the end. If not, we can add the following lines to the install block in the formula (to try to reduce the number of processes which are building `yelp-tools):
# Reduce memory usage below 4 GB for Circle CI.
ENV["MAKEFLAGS"] = "-j16" if ENV["CIRCLECI"]
Could not reproduce error for adwaita-icon-theme on Alpine and Ubuntu
@sjackman I found out something else, which makes me worry that my solution is not the correct one, or may not always work ...
The current solution works fine in our docker container. On my ubuntu 17.04 though, it does not work when building stuff from source.
I needed to use:
ENV.prepend_path "PERL5LIB", "#{Formula["intltool"].libexec}/lib/perl5/x86_64-linux-gnu-thread-multi/XML/"
instead of:
ENV.prepend_path "PERL5LIB", "#{Formula["intltool"].libexec}/lib/perl5/"
Of course that new path does not work in our docker container. So I need two different versions; but I am not sure on what criteria the PERL5LIB should be the short or long path.
The doc (http://perldoc.perl.org/perlrun.html) says:
PERL5LIB
A list of directories in which to look for Perl library files before looking in the standard library and the current directory. Any architecture-specific and version-specific directories, such as version/archname/, version/, or archname/ under the specified locations are automatically included if they exist, with this lookup done at interpreter startup time. In addition, any directories matching the entries in $Config{inc_version_list} are added. (These typically would be for older compatible perl versions installed in the same directory tree.)
If PERL5LIB is not defined, PERLLIB is used. Directories are separated (like in PATH) by a colon on Unixish platforms and by a semicolon on Windows (the proper path separator being given by the command perl -V:path_sep).
When running taint checks, either because the program was running setuid or setgid, or the -T or -t switch was specified, neither PERL5LIB nor PERLLIB is consulted
Maybe I am hitting that taint check mode thing, but I am not sure if that is the case.
Could you try to build systemd from source on of your systems, to see if the current solution works for you?
Any architecture-specific and version-specific directories, such as version/archname/, version/, or archname/ under the specified locations are automatically included if they exist, with this lookup done at interpreter startup time.
That sounds to me like the correct PATH is
ENV.prepend_path "PERL5LIB", "#{Formula["intltool"].libexec}/lib/perl5"
I'm no Perl expert though.
Could you try to build systemd from source on of your systems, to see if the current solution works for you?
Is there a smaller reproducible test case? Perhaps one of the other programs that depends on intltool and XML::Parser?
I just tested with systemd and gsettings-desktop-schemas, and both fail to find the perl module on my Ubuntu.
With brewed perl?
On my system the path to XML is
$(brew --prefix)/lib/perl5/perl_local/lib/perl5/x86_64-linux-thread-multi/XML/
however,
ENV.prepend_path "PERL5LIB", "#{Formula["intltool"].libexec}/lib/perl5/perl_local/lib/perl5/x86_64-linux-thread-multi/XML/"
does not work for me. I am still getting
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
Any suggestions? Thanks.
gist logs: https://gist.github.com/jwhite007/43779881ddc54e7979d6cd8665bc3f84
Was able to buildlibqalculate on OSX High Sierra by simply brew install -b libqalculate. I had the XML::Parser error when I tried manually compiling .tar.gz source downloaded directly from libqalculate page though even using the same ./configure flags as in brew edit libqalculate. So I think it is because the Homebrew environment was able to locate the necessary packages itself. Suggest checking libqalculate as done.
jwhite007: Drop the trailing "XML/" from your path and you'll be correct.
brew install perl
perl -V
Those directories in @INC are what you want to include in your PERL5LIB values to pick up everything.
My copy of XML::Parser is in my vendor tree in the architecture directory.
Here is how I figure out my directory dependencies:
$ perl -d -MXML::Parser -e 1
* use Data::Dumper;
* print Dumper \%INC;
* q
My platform (which won't match anything out in the wild) shows XML::Parser to be loaded at this path:
'XML/Parser.pm' => '/apps/SD/eir-perl-5.14.1/lib/vendor_perl/5.14.1/x86_64-linux-thread-multi-ld/XML/Parser.pm',
Examples of my (not brewed) perl are here:
Built under linux
Compiled at Feb 9 2016 20:31:49
@INC:
/apps/SD/eir-perl-5.14.1/lib/eman_perl/x86_64-linux-thread-multi-ld
/apps/SD/eir-perl-5.14.1/lib/eman_perl
/apps/SD/eir-perl-5.14.1/lib/vendor_perl/5.14.1/x86_64-linux-thread-multi-ld
/apps/SD/eir-perl-5.14.1/lib/vendor_perl/5.14.1
/apps/SD/eir-perl-5.14.1/lib/5.14.1/x86_64-linux-thread-multi-ld
/apps/SD/eir-perl-5.14.1/lib/5.14.1
/apps/SD/eir-perl-5.14.1/lib/site_perl
.
ffaatuai@dws-rtp-ffaatuai-l:~$
@iMichka: How would I get started on this? I'm slowly trying to understand Linuxbrew (Pi, CEL6, CEL7) target platforms. Intending to use it to side-step the rights that my team has but which my clients can't side-step and that means I'll want to help facilitate the capability of Linuxbrew.
in the issue's list with formulae to fix systemd is ticked as solved, but when trying to install it I still get the XML::Parser error; I'm working on Linux Debian using linuxbrew. Could you check what's the problem with systemd?
Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like systemd.
Another possible workaround for you is brew install --force-bottle systemd, but no promises.
If it's an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.
The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.
Closing this. We are making this change whenever needed, step by step.