Skip to content

Building Node.js broken when using ccache #40542

Description

@GeoffreyBooth

Version

master @ f233cb2

Platform

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?

  1. 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 did brew install ccache). In particular, don’t skip the steps to export CC and export CXX.

  2. Run ./configure. I see this error:

    Node.js configure: Found Python 3.9.7...
    ERROR: Did not find a new enough assembler, install one or build with
           –openssl-no-asm.
           Please refer to BUILDING.md
    
  3. Run unset CC GCC. Then when I run ./configure the command completes successfully.

How often does it reproduce? Is there a required condition?

Every time.

Additional information

cc @nodejs/build-files

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Oct 21, 2021
  2. Trott commented on Oct 21, 2021

    @Trott
    Member

    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/libexec is in my PATH. I guess the docs need to be updated but otherwise everything is fine.

  3. Trott commented on Oct 21, 2021

    @Trott
    Member

    I'm also using an older version of ccache (3.4.2, whereas current is 4.4.2).

  4. Trott commented on Oct 21, 2021

    @Trott
    Member

    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.

  5. richardlau commented on Oct 21, 2021

    @richardlau
    Member

    On the Jenkins CI we set CC and CXX with ccache and 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
    ...
    
  6. GeoffreyBooth commented on Oct 21, 2021

    @GeoffreyBooth
    Author
  7. Trott commented on Oct 21, 2021

    @Trott
    Member

    Here's the relevant code in configure.py:

    node/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.gypi There aren't that many resulting lines.)

  8. Trott commented on Oct 21, 2021

    @Trott
    Member

    I've replicated this issue. 👀

  9. Trott commented on Oct 21, 2021

    @Trott
    Member

    Using export CXX="ccache c++" and export CC="ccache cc" fixes it.

  10. Trott commented on Oct 21, 2021

    @Trott
    Member

    Using export CXX="ccache c++" and export CC="ccache cc" fixes it.

    Line 32 of configure.py indicates that MacOS should use cc and everywhere else should use gcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions