Skip to content
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

Build error with clang on Mac OS X 10.15.7 (wasm-engine.cc:157:19: error: no viable overloaded '=') #52847

Open
tobbi opened this issue May 5, 2024 · 9 comments
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.

Comments

@tobbi
Copy link

tobbi commented May 5, 2024

Version

v22.1

Platform

Darwin Tobiass-MBP-2.fritz.box 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64

Subsystem

No response

What steps will reproduce the bug?

Try to install node on Mac OS X

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

every time

What is the expected behavior? Why is that the expected behavior?

Build does not fail.

What do you see instead?

clang++ -o /private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/wasm/wasm-import-wrapper-cache.o ../deps/v8/src/wasm/wasm-import-wrapper-cache.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_X64' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_MACOS' '-DV8_EMBEDDER_STRING="-node.11"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DV8_SHORT_BUILTIN_CALLS' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DNDEBUG' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_USE_ZLIB' '-DV8_ENABLE_SPARKPLUG' '-DV8_ENABLE_MAGLEV' '-DV8_ENABLE_TURBOFAN' '-DV8_ENABLE_SYSTEM_INSTRUMENTATION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_ADVANCED_BIGINT_ALGORITHMS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I/usr/local/opt/libuv/include -I/usr/local/opt/brotli/include -I/usr/local/opt/c-ares/include -I/usr/local/opt/libnghttp2/include -I/usr/local/opt/openssl@3/include -I/usr/local/Cellar/icu4c/74.2/include -I../deps/v8 -I../deps/v8/include -I/private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj/gen -I/private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj/gen/generate-bytecode-output-root -I../deps/v8/third_party/zlib -I../deps/v8/third_party/zlib/google -I../deps/v8/third_party/abseil-cpp -I../deps/v8/third_party/fp16/src/include  -O3 -gdwarf-2 -fstrict-aliasing -mmacosx-version-min=11.0 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-invalid-offsetof -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF /private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/.deps//private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/wasm/wasm-import-wrapper-cache.o.d.raw   -c
../deps/v8/src/wasm/wasm-engine.cc:157:19: error: no viable overloaded '='
      source_url_ = String::cast(script->name())->ToCString();
      ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3737:17: note: candidate function not viable: no known conversion from 'std::unique_ptr<char []>' to 'const std::__1::shared_ptr<char const[]>' for 1st argument
    shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
                ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3748:17: note: candidate function not viable: no known conversion from 'std::unique_ptr<char []>' to 'std::__1::shared_ptr<char const[]>' for 1st argument
    shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
                ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3745:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3756:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        operator=(shared_ptr<_Yp>&& __r);
        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3790:9: note: candidate template ignored: requirement '!is_array<char []>::value' was not satisfied [with _Yp = char [], _Dp = std::__1::default_delete<char []>]
        operator=(unique_ptr<_Yp, _Dp>&& __r);
        ^
../deps/v8/src/wasm/wasm-engine.cc:1347:21: error: cannot initialize a variable of type 'const char *' with an rvalue of type 'std::__1::shared_ptr<char const[]>::element_type *' (aka 'char const (*)[]')
        const char* source_url = code_to_log.source_url.get();
                    ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  clang++ -o /private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/wasm/wasm-js.o ../deps/v8/src/wasm/wasm-js.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_X64' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_MACOS' '-DV8_EMBEDDER_STRING="-node.11"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DV8_SHORT_BUILTIN_CALLS' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DNDEBUG' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_USE_ZLIB' '-DV8_ENABLE_SPARKPLUG' '-DV8_ENABLE_MAGLEV' '-DV8_ENABLE_TURBOFAN' '-DV8_ENABLE_SYSTEM_INSTRUMENTATION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_ADVANCED_BIGINT_ALGORITHMS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I/usr/local/opt/libuv/include -I/usr/local/opt/brotli/include -I/usr/local/opt/c-ares/include -I/usr/local/opt/libnghttp2/include -I/usr/local/opt/openssl@3/include -I/usr/local/Cellar/icu4c/74.2/include -I../deps/v8 -I../deps/v8/include -I/private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj/gen -I/private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj/gen/generate-bytecode-output-root -I../deps/v8/third_party/zlib -I../deps/v8/third_party/zlib/google -I../deps/v8/third_party/abseil-cpp -I../deps/v8/third_party/fp16/src/include  -O3 -gdwarf-2 -fstrict-aliasing -mmacosx-version-min=11.0 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-invalid-offsetof -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF /private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/.deps//private/tmp/node-20240505-15989-9z81ho/node-v22.1.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/wasm/wasm-js.o.d.raw   -c
2 errors generated.

Additional information

No response

@targos
Copy link
Member

targos commented May 5, 2024

macOS 10.15 is no longer supported to build node. We require at least macOS 11.

@tobbi
Copy link
Author

tobbi commented May 5, 2024

To me it seems like the build error might not be specific to OS X 10.15.

@targos
Copy link
Member

targos commented May 5, 2024

It's specific to the clang version that ships with Xcode on 10.15

@tobbi
Copy link
Author

tobbi commented May 5, 2024

Assuming I fixed that locally and put it under a platform-specific #ifdef guard, would you accept patches?

@ireddick
Copy link

ireddick commented May 6, 2024

I am experiencing something similar on Mac OS 11.7.10

I'm building v22.1 via Homebrew (I'm aware that Homebrew no longer officially supports this OS version)

Clang: 13.0.0 build 1300
macOS: 11.7.10-x86_64
CLT: 13.2.0.0.1.1638488800
Xcode: 13.2.1

../deps/v8/src/wasm/wasm-engine.cc:157:19: error: no viable overloaded '='
      source_url_ = String::cast(script->name())->ToCString();
      ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3435:17: note: candidate function not viable: no known conversion from 'std::unique_ptr<char []>' to 'const std::shared_ptr<char const[]>' for 1st argument
    shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3443:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3445:17: note: candidate function not viable: no known conversion from 'std::unique_ptr<char []>' to 'std::shared_ptr<char const[]>' for 1st argument
    shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3453:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        operator=(shared_ptr<_Yp>&& __r);
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3473:9: note: candidate template ignored: requirement '!is_array<char []>::value' was not satisfied [with _Yp = char [], _Dp = std::default_delete<char []>]
        operator=(unique_ptr<_Yp, _Dp>&& __r);
        ^
1 error generated.

@tobbi
Copy link
Author

tobbi commented May 6, 2024

Does this need to be reported upstream to the maintainers of v8 or to what extent is the version bundled with nodejs up-to-date with that?

@targos
Copy link
Member

targos commented May 6, 2024

Official macOS releases are built with Xcode 13.2.1 too and we don't get this error 🤔

@tobbi tobbi changed the title Build error with clang on Mac OS X 10.15.7 Build error with clang on Mac OS X 10.15.7 (wasm-engine.cc:157:19: error: no viable overloaded '=') May 6, 2024
@VoltrexKeyva VoltrexKeyva added build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX. labels May 6, 2024
@wehrwein1
Copy link

Had similar issue to @ireddick -- install node v22.1 from source via homebrew on macOS 11 failed, re: wasm-engine

Clang="Apple clang version 13.0.0 (clang-1300.0.29.30)"
macOS=11.7.10 (older OS, unsupported by homebrew)
Xcode CommandLineTools: 13.2.0.0.1.1638488800 (ref)

Error: node "make install" step failing on wasm-engine.o:

/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3445:17: note: candidate function not viable: no known conversion from 'std::unique_ptr<char []>' to 'std::shared_ptr<char const[]>' for 1st argument
    shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3453:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        operator=(shared_ptr<_Yp>&& __r);
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3473:9: note: candidate template ignored: requirement '!is_array<char []>::value' was not satisfied [with _Yp = char [], _Dp = std::default_delete<char []>]
        operator=(unique_ptr<_Yp, _Dp>&& __r);
        ^
1 error generated.
make[1]: *** [/private/tmp/node-20240508-1940-mkq0xj/node-v22.1.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/wasm/wasm-engine.o] Error 1
..
make: *** [node] Error 2

Workaround (sufficient for my needs): revert to older node version in homebrew: node@20 (ref), build/install completed without error

@baldr9
Copy link

baldr9 commented May 19, 2024

I'm getting a similar error when using brew to upgrade node:

==> Upgrading node
  21.7.1 -> 22.2.0
==> ./configure --without-npm --without-corepack --with-intl=system-icu --shared-libuv --shared-nghttp2 --shared-openssl
==> make install


/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3453:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        operator=(shared_ptr<_Yp>&& __r);
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:3473:9: note: candidate template ignored: requirement '!is_array<char []>::value' was not satisfied [with _Yp = char [], _Dp = std::default_delete<char []>]
        operator=(unique_ptr<_Yp, _Dp>&& __r);

Clang="Apple clang version 13.0.0 (clang-1300.0.29.30)"
macOS=11.7.10 (older OS, unsupported by homebrew)
Xcode CommandLineTools: 13.2.0.0.1.1638488800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

6 participants