-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: Fix ccache behavior when cross-compiling for darwin hosts #24620
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
Conversation
Concept ACK |
1 similar comment
Concept ACK |
~0. I'm not convinced this change is a good way to fix this problem. Wont this also mean that the compiler invocation we use to build darwin packages in depends is now different from the one we use to build bitcoind? |
This change also does not Guix build: HOSTS="x86_64-apple-darwin" ./contrib/guix/guix-build
...
Building libevent...
make[1]: Entering directory '/bitcoin/depends/work/build/x86_64-apple-darwin/libevent/2.1.12-stable-a581391610c'
GEN include/event2/event-config.h
make all-am
make[2]: Entering directory '/bitcoin/depends/work/build/x86_64-apple-darwin/libevent/2.1.12-stable-a581391610c'
CC buffer.lo
CC bufferevent.lo
CC bufferevent_filter.lo
CC bufferevent_pair.lo
CC bufferevent_ratelim.lo
CC bufferevent_sock.lo
CC evmap.lo
CC event.lo
buffer.c:2487:60: error: too many arguments to function call, expected 4, have 6
res = sendfile(source_fd, dest_fd, chain->misalign, &len, NULL, 0);
~~~~~~~~ ^~~~~~~
/gnu/store/v770rvqs8q21mbzwb3gkihr2glgn80am-clang-10.0.1/lib/clang/10.0.1/include/stddef.h:89:16: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^
/gnu/store/bxh206gz379wkn8cvb2ghlkvpqgwfd2v-gcc-toolchain-10.3.0/include/sys/sendfile.h:33:1: note: 'sendfile' declared here
extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
^
1 error generated.
CC evthread.lo
make[2]: *** [Makefile:1866: buffer.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/bitcoin/depends/work/build/x86_64-apple-darwin/libevent/2.1.12-stable-a581391610c'
make[1]: *** [Makefile:1385: all] Error 2
make[1]: Leaving directory '/bitcoin/depends/work/build/x86_64-apple-darwin/libevent/2.1.12-stable-a581391610c'
make: *** [funcs.mk:282: /bitcoin/depends/work/build/x86_64-apple-darwin/libevent/2.1.12-stable-a581391610c/./.stamp_built] Error 2
make: Leaving directory '/bitcoin/depends' |
Fixed. Guix builds:
|
Friendly ping @dongcarl. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
guix hashes (x86), mine match @hebasto
|
~0. I'm still not convinced this is a good change, or even something that needs to be solved at the cost of introducing more platform specific hacks / complication into our build system. It's surprising that there is no way for us to fix this for our use case given the multitude of ccache configuration options / settings, and it's support for additional compiler wrappers. Have we opened an issue upstream to document our use case, and why ccache doesn't currently work with it? |
Considering some recent comments:
should I re-open this PR? |
|
From ccache/ccache#1326 (comment):
That is exactly what this PR does. |
For
darwin
hosts we use theenv
command to run a compiler in a modified environment which in turn makesccache
effectively no-op. On master (ae005a6):With this PR:
Fixes #21552.
Also this PR improves efficiency of the "macOS 10.15" CI task:
master (e09cf64), https://cirrus-ci.com/task/6266307669655552:

this PR, https://cirrus-ci.com/task/6033477492539392:
