Repository navigation
Building Node.js broken when using ccache #40542
Description
Activity
- addedbuildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.
on Oct 21, 2021 I'm running ccache on a Mac and have no problems, but I don't have the environment variables set. Instead,
/usr/local/opt/ccache/libexecis in myPATH. I guess the docs need to be updated but otherwise everything is fine.I'm also using an older version of ccache (3.4.2, whereas current is 4.4.2).
Looking at https://github.com/ccache/ccache/blob/5243c21f4c7a8e048ac214bb5a1d78ddd769fbd1/doc/INSTALL.md, it appears that I've done the "use ccache for everything" method whereas our docs use the "try it out" method. That's probably what we want to suggest to users so that we don't affect compilation of other things.
On the Jenkins CI we set
CCandCXXwithccacheand aren't seeing this.e.g. https://ci.nodejs.org/job/node-test-commit-osx/42467/nodes=osx11-x64/consoleFull
08:00:31 + export 'CC=/usr/local/bin/ccache cc' 08:00:31 + CC='/usr/local/bin/ccache cc' 08:00:31 + export 'CXX=/usr/local/bin/ccache c++' 08:00:31 + CXX='/usr/local/bin/ccache c++' 08:00:31 ++ getconf _NPROCESSORS_ONLN 08:00:31 + export JOBS=4 08:00:31 + JOBS=4 08:00:31 + NODE_TEST_DIR=/Users/iojs/node-tmp 08:00:31 + FLAKY_TESTS=dontcare 08:00:31 + make run-ci -j 4 08:00:32 python3 ./configure --verbose 08:00:39 Node.js configure: Found Python 3.9.7... 08:00:39 Detected clang C++ compiler (CXX=/usr/local/bin/ccache c++) version: 13.0.0 08:00:39 Detected clang C compiler (CC=/usr/local/bin/ccache cc) version: 13.0.0 08:00:39 creating icu_config.gypi ...GeoffreyBooth commented
on Oct 21, 2021 on Oct 21, 2021 · Hidden as outdatedAuthorshow commentMore actionsHere's the relevant code in
configure.py:Lines 1444 to 1455 in f233cb2
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/ # blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69 openssl110_asm_supported = \ ('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \ ('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \ ('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \ ('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10')) if is_x86 and not openssl110_asm_supported: error('''Did not find a new enough assembler, install one or build with --openssl-no-asm. Please refer to BUILDING.md''') What's the output when you run
egrep 'gas_version|xcode_version|llvm_version|nasm_version' config.gypi?(EDIT: I get llvm_version 12.0 and xcode_version 12.0.)
(EDIT 2: I guess you could just run
grep _version config.gypiThere aren't that many resulting lines.)I've replicated this issue. 👀
Reacted by Richard LauUsing
export CXX="ccache c++"andexport CC="ccache cc"fixes it.Using
export CXX="ccache c++"andexport CC="ccache cc"fixes it.Line 32 of configure.py indicates that MacOS should use cc and everywhere else should use gcc.
- added 2 commits that reference this issue
on Nov 6, 2021 - added 2 commits that reference this issue
on Nov 25, 2021
Version
master@ f233cb2Platform
Darwin Geoffreys-MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64
What steps will reproduce the bug?
Follow the instructions in https://github.com/nodejs/node/blob/master/BUILDING.md#speeding-up-frequent-rebuilds-when-developing to install and configure
ccache. (I’m on a Mac, so I didbrew install ccache). In particular, don’t skip the steps toexport CCandexport CXX.Run
./configure. I see this error:Run
unset CC GCC. Then when I run./configurethe command completes successfully.How often does it reproduce? Is there a required condition?
Every time.
Additional information
cc @nodejs/build-files