Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apr example build with configure_make fails on os x #808

Open
fandyushin opened this issue Nov 12, 2021 · 7 comments
Open

apr example build with configure_make fails on os x #808

fandyushin opened this issue Nov 12, 2021 · 7 comments

Comments

@fandyushin
Copy link

fandyushin commented Nov 12, 2021

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
@fandyushin
Copy link
Author

With make 4.3 from brew (this version is same as the toolchain's) apr builds without faults

@jsharpe
Copy link
Member

jsharpe commented Nov 25, 2021

I think you've hit bazelbuild/bazel@039c72e which should be fixed in bazel 4.2.2 which will be released shortly.

@jsharpe
Copy link
Member

jsharpe commented Dec 4, 2021

@fandyushin Can you try updating to bazel 4.2.2 and see if that fixes your issue?

@fandyushin
Copy link
Author

fandyushin commented Dec 21, 2021

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

@graywolf-at-work
Copy link
Contributor

Workaround for 0.7.1 provided in #859 (comment).

@github-actions
Copy link

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!

@graywolf-at-work
Copy link
Contributor

I hate tickets auto-closed without any conclusion, so here it is: This is fixed in current version and this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants