Sitelet https://github.com/nodejs/node/issues/52230
Skip to content

node 18.20.0 build failure #52230

Description

@chenrui333

While trying to upgrade node@18 to 18.20.0, but run into some build issue. The error log is as below:

error build log
  clang++ -o /private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/instruction-selector.o ../deps/v8/src/compiler/backend/instruction-selector.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_CERT_STORE' '-DICU_NO_USER_DATA_OVERRIDE' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-DV8_TARGET_ARCH_ARM64' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_MACOS' '-DV8_EMBEDDER_STRING="-node.36"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_ENABLE_SYSTEM_INSTRUMENTATION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_SCRIPTORMODULE_LEGACY_LIFETIME' '-DV8_ADVANCED_BIGINT_ALGORITHMS' -I/opt/homebrew/opt/libuv/include -I/opt/homebrew/opt/brotli/include -I/opt/homebrew/opt/c-ares/include -I/opt/homebrew/opt/libnghttp2/include -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/Cellar/icu4c/74.2/include -I../deps/v8 -I../deps/v8/include -I/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj/gen/generate-bytecode-output-root -I/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj/gen  -O3 -gdwarf-2 -fstrict-aliasing -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF /private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/.deps//private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/instruction-selector.o.d.raw   -c
In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.cc:5:
In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.h:10:
In file included from ../deps/v8/src/compiler/backend/instruction.h:13:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
  static constexpr T kMax = static_cast<T>(kNumValues - 1);
                            ^
In file included from ../deps/v8/src/compiler/backend/gap-resolver.cc:5:
In file included from ../deps/v8/src/compiler/backend/gap-resolver.h:8:
In file included from ../deps/v8/src/compiler/backend/instruction.h:13:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
  static constexpr T kMax = static_cast<T>(kNumValues - 1);
                            ^
In file included from ../deps/v8/src/compiler/backend/frame-elider.cc:5:
In file included from ../deps/v8/src/compiler/backend/frame-elider.h:8:
In file included from ../deps/v8/src/compiler/backend/instruction.h:13:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
  static constexpr T kMax = static_cast<T>(kNumValues - 1);
                            ^
In file included from ../deps/v8/src/compiler/backend/instruction-selector.cc:5:
In file included from ../deps/v8/src/compiler/backend/instruction-selector.h:12:
In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.h:10:
In file included from ../deps/v8/src/compiler/backend/instruction.h:13:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
  static constexpr T kMax = static_cast<T>(kNumValues - 1);
                            ^
In file included from ../deps/v8/src/compiler/backend/code-generator.cc:5:
In file included from ../deps/v8/src/compiler/backend/code-generator.h:11:
In file included from ../deps/v8/src/codegen/macro-assembler.h:8:
In file included from ../deps/v8/src/codegen/turbo-assembler.h:12:
In file included from ../deps/v8/src/codegen/assembler-arch.h:8:
In file included from ../deps/v8/src/codegen/assembler.h:46:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
  static constexpr T kMax = static_cast<T>(kNumValues - 1);
                            ^
1 error generated.
make[1]: *** [/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/gap-resolver.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/frame-elider.o] Error 1
1 error generated.
make[1]: *** [/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/instruction-scheduler.o] Error 1
1 error generated.
make[1]: *** [/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/code-generator.o] Error 1
1 error generated.
make[1]: *** [/private/tmp/nodeA18-20240327-90442-vf33hl/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/instruction-selector.o] Error 1
rm 57e357e133a048a6f02ea40bcd36a320c2e9472d.intermediate 3c837bd255f9ccaa7124ff49849546d57ec35e5c.intermediate 2fb651989b5c82eb660b2124481795c22232907f.intermediate
make: *** [node] Error 2

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/8443780973/job/23130539115
relates to Homebrew/homebrew-core#167236

Activity

  1. richardlau commented on Mar 27, 2024

    @richardlau
    Member

    I presume that will be related to one of the V8 commits in https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#commits.
    FWIW we didn't see those failures on the Node.js CI so I don't know if Homebrew is building Node.js differently.

  2. LijieZhang1998 commented on Mar 27, 2024

    @LijieZhang1998

    I also got the same error to build 16.20.1 version on macOS today. Any solution about it? Thanks.

  3. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Mar 27, 2024
  4. chenrui333 commented on Mar 28, 2024

    @chenrui333
    Author

    FWIW we didn't see those failures on the Node.js CI so I don't know if Homebrew is building Node.js differently.

    it is not happening for all node 18.20.0 builds, so I think it might be also xcode sdk related.

  5. added
    macosIssues and PRs related to the macOS platform.
    on Mar 28, 2024
  6. blair commented on Mar 28, 2024

    @blair

    I'm also seeing in MacPorts' upgrade of the nodes18 port:

      /usr/bin/clang++ -o /opt/local/var/macports/build/macports-ports.git_devel_nodejs18/nodejs18/work/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/register-allocator.o ../deps/v8/src/compiler/backend/register-allocator.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_HAS_QUIC' '-DICU_NO_USER_DATA_OVERRIDE' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DV8_TARGET_ARCH_ARM64' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_MACOS' '-DV8_EMBEDDER_STRING="-node.36"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_ENABLE_SYSTEM_INSTRUMENTATION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_SCRIPTORMODULE_LEGACY_LIFETIME' '-DV8_ADVANCED_BIGINT_ALGORITHMS' -I/opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_devel_nodejs18/nodejs18/work/zlib-inc -I../deps/v8 -I../deps/v8/include -I/opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_devel_nodejs18/nodejs18/work/node-v18.20.0/out/Release/obj/gen/generate-bytecode-output-root -I/opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_devel_nodejs18/nodejs18/work/node-v18.20.0/out/Release/obj/gen  -O3 -gdwarf-2 -fstrict-aliasing -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF /opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_devel_nodejs18/nodejs18/work/node-v18.20.0/out/Release/.deps//opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_devel_nodejs18/nodejs18/work/node-v18.20.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/register-allocator.o.d.raw -I/opt/local/include -Os -stdlib=libc++ -I/opt/local/include -c
    In file included from ../deps/v8/src/compiler/backend/gap-resolver.cc:5:
    In file included from ../deps/v8/src/compiler/backend/gap-resolver.h:8:
    In file included from ../deps/v8/src/compiler/backend/instruction.h:13:
    In file included from ../deps/v8/src/codegen/external-reference.h:9:
    In file included from ../deps/v8/src/runtime/runtime.h:11:
    ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
      static constexpr T kMax = static_cast<T>(kNumValues - 1);
                                ^
    

    This is with

    $ clang++ --version
    Apple clang version 15.0.0 (clang-1500.3.9.4)
    Target: arm64-apple-darwin23.4.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    
  7. LijieZhang1998 commented on Mar 28, 2024

    @LijieZhang1998

    One workaround is adding -Wno-enum-constexpr-conversion warning flag to mac OS in common.gypi. It build successfully. But I'm not sure of its impact.

  8. Bo98 commented on Mar 29, 2024

    @Bo98

    Relevant commit to backport might be v8/v8@d15d49b

  9. added a commit that references this issue on Apr 17, 2024
  10. linked a pull request that will close this issuev18.20.3 proposal #53028on May 16, 2024
  11. richardlau commented on May 21, 2024

    @richardlau
    Member

    This should be fixed in Node.js 18.20.3.

  12. eric-gitta-moore commented on Jun 5, 2024

    @eric-gitta-moore

    One workaround is adding -Wno-enum-constexpr-conversion warning flag to mac OS in common.gypi. It build successfully. But I'm not sure of its impact.

    Thank you. I want to leave a little help here for those who come after. The specific modification location is https://github.com/nodejs/node/blob/v14.21.3/common.gypi#L498

          ['OS=="mac"', {
            'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
            'xcode_settings': {
              'ALWAYS_SEARCH_USER_PATHS': 'NO',
              'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
              'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
                                                        # (Equivalent to -fPIC)
              'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
              'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
              'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
              'PREBINDING': 'NO',                       # No -Wl,-prebind
              'MACOSX_DEPLOYMENT_TARGET': '10.13',      # -mmacosx-version-min=10.13
              'USE_HEADERMAP': 'NO',
              'OTHER_CFLAGS': [
                '-fno-strict-aliasing',
              ],
              'WARNING_CFLAGS': [
                '-Wall',
                '-Wendif-labels',
                '-W',
                '-Wno-unused-parameter',
    +            '-Wno-enum-constexpr-conversion',
              ],
            },

    then

    ./configure --prefix=your install dir
    make -j 7 # your cores
    make install

    reference

  13. Bo98 commented on Jun 5, 2024

    @Bo98

    That compiler option is planned to be removed in the next version of LLVM Clang so I strongly recommend planning to update to at least 18.20.3 when possible.

    For 16.x and earlier you may need to patch v8 in the future. The patch from 18.x is a good starting point but it may need modifying to be correct on earlier versions (please always check make jstest at least). There were differences between 18.x and 20.x, so differences to 16.x and earlier are easily possible.

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.macosIssues and PRs related to the macOS platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions