brew installing one, specific formula and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Linuxbrew/brew/issues/new.brew update and retried your prior step?brew doctor, fixed all issues and retried your prior step?brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?To help us debug your issue please explain:
Trying to install Apache httpd, which depends on apr-util
When trying to install apr-util we hit an error saying mawk cannot be found. mawk is not listed as a dependency for apr-util.
==> Installing dependencies for ensembl/cask/production-biomart: apr-util, ensembl/web/httpd22, ensembl/web/mod_perl, mawk
==> Installing ensembl/cask/production-biomart dependency: apr-util
==> Downloading https://www.apache.org/dyn/closer.cgi?path=apr/apr-util-1.6.0.tar.bz2
Already downloaded: /homes/ensw/.cache/Homebrew/apr-util-1.6.0.tar.bz2
==> ./configure --prefix=/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr-util/1.6.0_1/libexec --with-apr=/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr --with-openssl=/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl --with-crypto
==> make
Last 15 lines from /homes/ensw/.cache/Homebrew/Logs/apr-util/02.make:
sed 's,^\(location=\).*$,\1installed,' < apu-1-config > apu-config.out
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_brigade.lo -c buckets/apr_brigade.c && touch buckets/apr_brigade.lo
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_buckets.lo -c buckets/apr_buckets.c && touch buckets/apr_buckets.lo
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_buckets_alloc.lo -c buckets/apr_buckets_alloc.c && touch buckets/apr_buckets_alloc.lo
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_buckets_eos.lo -c buckets/apr_buckets_eos.c && touch buckets/apr_buckets_eos.lo
/bin/bash: mawk: command not found
/bin/bash: mawk: command not found
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_buckets_file.lo -c buckets/apr_buckets_file.c && touch buckets/apr_buckets_file.lo
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_buckets_flush.lo -c buckets/apr_buckets_flush.c && touch buckets/apr_buckets_flush.lo
/bin/bash /nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/Cellar/apr/1.6.2_1/libexec/build-1/libtool --silent --mode=compile cc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include -I/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0/include/private -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/apr/libexec/include/apr-1 -I/nfs/software/ensembl/RHEL7-JUL2017-core2/linuxbrew/opt/openssl/include -o buckets/apr_buckets_heap.lo -c buckets/apr_buckets_heap.c && touch buckets/apr_buckets_heap.lo
make[1]: *** [exports.c] Error 127
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [export_vars.c] Error 127
make[1]: Leaving directory `/tmp/apr-util-20171004-25195-1qfq4v6/apr-util-1.6.0'
make: *** [all-recursive] Error 1
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.
I expect to be able to install apr-util.
I'm not sure if this is something that needs to be solved here or needs to be pushed upstream to homebrew. I'd like to know what's the best way to proceed. For the moment I manually run a brew install mawk to get this to work.
If I need to raise this just let me know and I'll open another issue with homebrew
Hi. Thanks for reporting this.
It looks like we have mawk installed in our docker image, so we did not see that problem.
The fix would be to add the mawk dependency to the formula in this repository, safeguarded with a unless OS.mac? statement.
@sjackman Do you think we coud remove mawk from the docker container?
The mawk package is essential to Ubuntu.
❯❯❯ apt-get remove mawk
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
❯❯❯ grep -r mawk /home/linuxbrew/.linuxbrew/opt/apr/libexec
/home/linuxbrew/.linuxbrew/opt/apr/libexec/build-1/apr_rules.mk:AWK=mawk
We can use inreplace to change AWK=mawk to AWK=awk. We could put this in the postinstall so that we don't have update the current bottle.
Linuxbrew has an implicit dependency on awk (lots of stuff would break without it), but not so on mawk.
If the change went into postinstall wouldn't that be too late to influence the build? The other option would as @iMichka said to add depends_on 'mawk' to apr-util. Is there a reason not to do the later if the options?
The post_install to modify is that of apr, which should fix the build of apr-util.
❯❯❯ grep -r mawk /home/linuxbrew/.linuxbrew/opt/apr/libexec
/home/linuxbrew/.linuxbrew/opt/apr/libexec/build-1/apr_rules.mk:AWK=mawk
I've hit this installing clang-format - Red Hat 6 - it also fails if I brew install mawk first, so I assume that theres some fancy path stuff to only allow use of tools it specifies.
Editing the formula to add a dependency on mawk seemed to work.
Yep, you're correct, there is fancy path stuff to only allow use of tools it specifies. Adding mawk as a dependency is one of the possible solutions. The other would be to modify the post_install of apr to change AWK=mawk to AWK=awk in
/home/linuxbrew/.linuxbrew/opt/apr/libexec/build-1/apr_rules.mk
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
@sjackman Thanks!
It completely works by changing AWK=mawk to AWK=awk in .linuxbrew/Cellar/apr/1.6.3/libexec/build-1/apr_rules.mk
Had to manually edit linuxbrew/Cellar/apr/1.6.3/libexec/build-1/apr_rules.mk to make it work on a centos mainframe
@sjackman @kenkoooo I had the same issue and it was resolved by changing to AWK=awk in .linuxbrew/Cellar/apr/1.6.3/libexec/build-1/apr_rules.mk. Thank you.
I noticed there still isn't patch to edit the post_install for apr, and that the bottle still references mawk in apr_rules.mk. For any folks who stumble across this and don't wish to edit tap files, you can try installing apr from source before installing apr-util.
$ brew install -s apr
$ brew install apr-util
This resolved my issue when building on Centos without mawk.
$ grep -i AWK= opt/apr/libexec/build-1/apr_rules.mk
AWK=gawk
As mawk itself has no dependencies, and its bottle is relocatable, the simplest solution to this problem is to add mawk as a dependency to apr. We'll happily merge a PR that makes this change if you wish to submit it.
Click https://github.com/Linuxbrew/homebrew-core/edit/master/Formula/apr.rb
Add revision 1 after sha256 and depends_on "mawk" before depends_on "util-linux".
Most helpful comment
Yep, you're correct, there is fancy path stuff to only allow use of tools it specifies. Adding
mawkas a dependency is one of the possible solutions. The other would be to modify thepost_installofaprto changeAWK=mawktoAWK=awkin