rules_foreign_cc
rules_foreign_cc copied to clipboard
apr example build with configure_make fails on os x
I tried to build configure_make
example that provide apr library as third party.
On make stage it fails:
config.status: executing libtool commands
config.status: executing default commands
+ /private/var/tmp/_bazel_u18151176/230694bf04aa38d817d04fe9d58edb9d/sandbox/darwin-sandbox/2/execroot/rules_foreign_cc_examples/bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make/bin/make -C /private/var/tmp/_bazel_u18151176/230694bf04aa38d817d04fe9d58edb9d/sandbox/darwin-sandbox/2/execroot/rules_foreign_cc_examples/bazel-out/darwin-fastbuild/bin/external/apr/apr.build_tmpdir
bazel-out/darwin-fastbuild/bin/external/apr/apr_foreign_cc/build_script.sh: line 136: 29433 Segmentation fault: 11 $EXT_BUILD_ROOT/bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make/bin/make -C $BUILD_TMPDIR
_____ END BUILD LOGS _____
When I tried to build sources in sandbox dir with system GNU make
it's doesn't fault, but rules_foreign_cc/toolchains/make/bin/make
keeps throwing segfaults
.
OSX version : 11.5.2 Big Sur Bazel version : 4.2.1
I noticed that system make
builded for i386-apple-darwin11.3.0
, but toolchain's make
builded for x86_64-apple-darwin20.6.0
If i run toolchains/make/bin/make by hands, I get the following output:
/private/var/tmp/_bazel_u18151176/230694bf04aa38d817d04fe9d58edb9d/sandbox/darwin-sandbox/2/execroot/rules_foreign_cc_examples/bazel-out/darwin-fastbuild/bin/external/apr/apr.build_tmpdir » /private/var/tmp/_bazel_u18151176/230694bf04aa38d817d04fe9d58edb9d/sandbox/darwin-sandbox/2/execroot/rules_foreign_cc_examples/bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make/bin/make -d
GNU Make 4.3
Built for x86_64-apple-darwin20.6.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Reading makefile '/private/var/tmp/_bazel_u18151176/230694bf04aa38d817d04fe9d58edb9d/sandbox/darwin-sandbox/2/execroot/rules_foreign_cc_examples/bazel-out/darwin-fastbuild/bin/external/apr/apr.build_tmpdir/build/apr_rules.mk' (search path) (no ~ expansion)...
Reading makefile '/private/var/tmp/_bazel_u18151176/230694bf04aa38d817d04fe9d58edb9d/sandbox/darwin-sandbox/2/execroot/rules_foreign_cc_examples/bazel-out/darwin-fastbuild/bin/external/apr/apr.build_tmpdir/build-outputs.mk' (search path) (no ~ expansion)...
[1] 29791 segmentation fault -d
With make 4.3 from brew (this version is same as the toolchain's) apr builds without faults
I think you've hit https://github.com/bazelbuild/bazel/commit/039c72e5e25a426cbf45c582bf325dcd112af4bd which should be fixed in bazel 4.2.2 which will be released shortly.
@fandyushin Can you try updating to bazel 4.2.2 and see if that fixes your issue?
Now bootstraping make fails for me:
./lib/findprog-in.c:137:25: error: implicit declaration of function 'eaccess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (eaccess (progpathname, X_OK) == 0)
^
./lib/findprog-in.c:137:25: note: did you mean 'access'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:431:6: note: 'access' declared here
int access(const char *, int);
^
./lib/findprog-in.c:211:21: error: implicit declaration of function 'eaccess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (eaccess (progpathname, X_OK) == 0)
^
Bazel v4.2.2 rules_foreign_cc v0.7.0
UPD: with rules_foreign_cc v0.6.0 make builds successfully, but than make segfaults anyway
Workaround for 0.7.1 provided in https://github.com/bazelbuild/rules_foreign_cc/issues/859#issuecomment-1058361769.
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_foreign_cc!
I hate tickets auto-closed without any conclusion, so here it is: This is fixed in current version and this issue can be closed.