Repository navigation
node 18.20.0 build failure #52230
Description
Activity
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.I also got the same error to build 16.20.1 version on macOS today. Any solution about it? Thanks.
- addedbuildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.
on Mar 27, 2024 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.
- addedmacosIssues and PRs related to the macOS platform.Issues and PRs related to the macOS platform.
on Mar 28, 2024 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/binOne workaround is adding
-Wno-enum-constexpr-conversionwarning flag tomacOS incommon.gypi. It build successfully. But I'm not sure of its impact.Reacted by Miloš StevanovićRelevant commit to backport might be v8/v8@d15d49b
- added a commit that references this issue
on Apr 17, 2024 This should be fixed in Node.js 18.20.3.
One workaround is adding
-Wno-enum-constexpr-conversionwarning flag tomacOS incommon.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 installreference
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 jstestat least). There were differences between 18.x and 20.x, so differences to 16.x and earlier are easily possible.
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
full build log, https://github.com/Homebrew/homebrew-core/actions/runs/8443780973/job/23130539115
relates to Homebrew/homebrew-core#167236