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

initial nodejs14->21 changes #26031

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

initial nodejs14->21 changes #26031

wants to merge 3 commits into from

Conversation

i3roly
Copy link

@i3roly i3roly commented Oct 1, 2024

  • need a small patch for nodejs21+ on older macs since they don't have the QoS API

  • bugticket https://trac.macports.org/ticket/70912 has the logs

  • i don't know how to use nodejs very well (lol) but i tested it by installing something via npm (pkg). i did use a previous version of these edits successfully though, but others can chime in.

  • @kencu recommended we use the macports libcxx legacy flag, but the headers of a newer mp-clang will clash with them, and clang-17 seems to be the default after the blacklist.

  • seems to be a similar header clash on 22 that prevents the compilation from completing. could be a simple fix that may be @kencu would want to look at so we can use the legacy flag for nodejs14->22, but i will leave that up to him. failed nodejs22 log is in the ticket if he cares.

Description

Type(s)
  • bugfix
  • enhancement
  • security fix

macOS 10.7.5 11G63 x86_64
Xcode 4.1 4B110

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@ci42 for port nodejs14, nodejs15, nodejs16, nodejs17, nodejs18, nodejs19, nodejs20, nodejs21.

@macportsbot macportsbot added the maintainer: open Affects an openmaintainer port label Oct 1, 2024
@kencu
Copy link
Contributor

kencu commented Oct 1, 2024

It would certainly be nice if current nodejs versions could work on more systems.

Thanks for this!

It sounds like you’ve tested these fixes on 10.7 primarily. Let’s see how that goes….I’ll do some checking and hopefully some others may help out too.

Well done.

@i3roly
Copy link
Author

i3roly commented Oct 1, 2024

@kencu i had no idea that macos-14 even had issues with the warnings, which is weird. i guess i'll make it more general.

@i3roly
Copy link
Author

i3roly commented Oct 2, 2024

@kencu can you run the bot again if it's necessary? it should be clean this time.

@kencu kencu marked this pull request as draft October 4, 2024 11:54
@kencu
Copy link
Contributor

kencu commented Oct 4, 2024

just making this a draft so nobody commits it by accident until the testing has been completed.

the final commit here, assuming macports-libcxx and these simple flags are indeed all it takes to fix nodejs on older systems (which would be miraculous TBH) will be different than what is here now.

I don’t have two weeks to start testing all these nodejs versions on 10.5 to 10.15 so feel free to chime in, once we pare this down to a clean commit.

@i3roly
Copy link
Author

i3roly commented Oct 4, 2024

it looks like buildbot passed now. so what or who is left for the additional testing?

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

The fact that the CI system did not generate any errors is of no value here, as the CI system does not have OS versions that were affected by the changes suggested here. I was tempted to not even run it -- but didn't want to dissuade you.

I have updated my 10.7 machine, and now we have to start trying to build nodejs versions on 10.7 and up and see what happens.

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

I started with nodejs14 on 10.7.

I looked over what you did, and reduced the changes to this:

configure.cxxflags-append  -Wno-enum-constexpr-conversion

and changing this:

# use the system libuv instead of the bundled version, as it is fixed for older systems
if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
    depends_lib-append    path:lib/libuv.dylib:libuv
    configure.args-append --shared-libuv
}

to this:

# use the system libuv instead of the bundled version, as it is fixed for older systems
if { ${os.platform} eq "darwin" && ${os.major} < 15 } {
    depends_lib-append    path:lib/libuv.dylib:libuv
    configure.args-append --shared-libuv
}

and that was sufficient to build nodejs14 on 10.7.

I am trying to run the nodej14 test suite on 10.7 now, and will report back on the results of that once it is done.

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

the above was insufficient to build the full test suite on nodejs14 on 10.7.

this worked better as it plumbed the flag to everywhere it needed to go (but still failed to build the test suite):

configure.cxx-append  -Wno-error=enum-constexpr-conversion

in the end the build (with testing) failed on 10.7 due to issues with the openssl not finding the right symbols ... no doubt due to the multiple installed versions of openssl trampling each other with one set of headers being used in part of the build, trying to link against the wrong openssl library. Here's part of that failed link:

  /opt/local/bin/clang++-mp-17 -Wno-error=enum-constexpr-conversion -Wl,-force_load,/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_snapshot.a -Wl,-no_pie -Wl,-search_paths_first -arch x86_64 -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release -stdlib=libc++  -o "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/mkcodecache" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/mkcodecache/src/node_snapshot_stub.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/mkcodecache/src/node_code_cache_stub.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/mkcodecache/tools/code_cache/mkcodecache.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/mkcodecache/tools/code_cache/cache_builder.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libnode.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libhistogram.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libuvwasi.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_snapshot.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_libplatform.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libllhttp.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libcares.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libnghttp2.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libbrotli.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_base_without_compiler.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_libbase.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_libsampler.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_zlib.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_compiler.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_initializers.a -L/opt/local/lib -lz -luv -L/opt/local/libexec/openssl11/lib -lcrypto -lssl -licui18n -licuuc -licudata -framework CoreFoundation
  /opt/local/bin/clang++-mp-17 -Wno-error=enum-constexpr-conversion -Wl,-force_load,/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_snapshot.a -Wl,-no_pie -Wl,-search_paths_first -arch x86_64 -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release -stdlib=libc++  -o "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/node_mksnapshot" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/node_mksnapshot/src/node_snapshot_stub.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/node_mksnapshot/src/node_code_cache_stub.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/node_mksnapshot/tools/snapshot/node_mksnapshot.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/obj.target/node_mksnapshot/tools/snapshot/snapshot_builder.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libnode.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libhistogram.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libuvwasi.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_snapshot.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_libplatform.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libllhttp.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libcares.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libnghttp2.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libbrotli.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_base_without_compiler.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_libbase.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_libsampler.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_zlib.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_compiler.a /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs14/nodejs14/work/node-v14.21.3/out/Release/libv8_initializers.a -L/opt/local/lib -lz -luv -L/opt/local/libexec/openssl11/lib -lcrypto -lssl -licui18n -licuuc -licudata -framework CoreFoundation
Undefined symbols for architecture x86_64:
  "_ERR_put_error", referenced from:
Undefined symbols for architecture x86_64:
  "_ERR_put_error", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, int) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, char const*, int) in libnode.a(node_crypto.o)
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, int) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, char const*, int) in libnode.a(node_crypto.o)
Undefined symbols for architecture x86_64:
  "_ERR_put_error", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, int) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, char const*, int) in libnode.a(node_crypto.o)
Undefined symbols for architecture x86_64:
  "_ERR_put_error", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, int) in libnode.a(node_crypto.o)
      node::crypto::DiffieHellman::Init(char const*, int, char const*, int) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_CTX_block_size", referenced from:
  "_EVP_CIPHER_CTX_block_size", referenced from:
      node::crypto::CipherBase::Update(char const*, int, node::AllocatedBuffer*) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Final(node::AllocatedBuffer*) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Update(char const*, int, node::AllocatedBuffer*) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Final(node::AllocatedBuffer*) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_CTX_block_size", referenced from:
      node::crypto::CipherBase::Update(char const*, int, node::AllocatedBuffer*) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Final(node::AllocatedBuffer*) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_CTX_block_size", referenced from:
      node::crypto::CipherBase::Update(char const*, int, node::AllocatedBuffer*) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Final(node::AllocatedBuffer*) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_flags", referenced from:
  "_EVP_CIPHER_flags", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      ...
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      ...
  "_EVP_CIPHER_flags", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      ...
  "_EVP_CIPHER_flags", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      ...
  "_EVP_CIPHER_iv_length", referenced from:
  "_EVP_CIPHER_iv_length", referenced from:
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_iv_length", referenced from:
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_iv_length", referenced from:
      node::crypto::CipherBase::Init(char const*, char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
  "_EVP_CIPHER_nid", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      __ZN4node6cryptoL28IsSupportedAuthenticatedModeEPK17evp_cipher_ctx_st in libnode.a(node_crypto.o)
      ...
  "_EVP_CIPHER_nid", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      __ZN4node6cryptoL28IsSupportedAuthenticatedModeEPK17evp_cipher_ctx_st in libnode.a(node_crypto.o)
      ...
  "_EVP_CIPHER_nid", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      __ZN4node6cryptoL28IsSupportedAuthenticatedModeEPK17evp_cipher_ctx_st in libnode.a(node_crypto.o)
      ...
  "_EVP_CIPHER_nid", referenced from:
      node::crypto::CipherBase::Final(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::SetAuthTag(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::CommonInit(char const*, evp_cipher_st const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitAuthenticated(char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::InitIv(char const*, unsigned char const*, int, unsigned char const*, int, unsigned int) in libnode.a(node_crypto.o)
      node::crypto::CipherBase::IsAuthenticatedMode() const in libnode.a(node_crypto.o)
      __ZN4node6cryptoL28IsSupportedAuthenticatedModeEPK17evp_cipher_ctx_st in libnode.a(node_crypto.o)
      ...
  "_EVP_MD_flags", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
  "_EVP_MD_flags", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
  "_EVP_MD_flags", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
  "_EVP_MD_flags", referenced from:
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
  "_EVP_MD_size", referenced from:
      node::crypto::Hash::HashDigest(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
  "_EVP_MD_size", referenced from:
      node::crypto::Hash::HashDigest(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
      node::crypto::Hash::HashInit(evp_md_st const*, v8::Maybe<unsigned int>) in libnode.a(node_crypto.o)
  "_EVP_MD_size", referenced from:
  "_EVP_MD_size", referenced from:
      node::crypto::Hash::HashDigest(v8::FunctionCallbackInfo<v8::Value> const&) in libnode.a(node_crypto.o)
...

and frankly I just don't feel like trying to fix that for this ancient old OS version.

So nodejs14 can be built, easily enough, but testing currently can't be built to be sure it works.

$ port -v installed nodejs14
The following ports are currently installed:
  nodejs14 @14.21.3_2 (active) requested_variants='' platform='darwin 11' archs='x86_64' date='2024-10-04T19:17:52-0700'

Forget this this, then -- let me try the newest nodejs instead, and work on that. If that works, it would be be at least useful.

@i3roly
Copy link
Author

i3roly commented Oct 5, 2024 via email

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

We don't necessarily need to have every single part of the project build, certainly.

But we do need to be reasonably happy that what we put out for people to use actually does work to a reasonable degree. Perhaps there is some other way we can demonstrate that functionality other than running the test suite (which is the ideal way, but not the only way).

@i3roly
Copy link
Author

i3roly commented Oct 5, 2024 via email

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

I'm going to work on the newest nodejs now, or at least the newest one that can be made to work.

@i3roly
Copy link
Author

i3roly commented Oct 5, 2024 via email

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

You have increasing skills and interest, and some older systems to work on. Same way that I got started years ago, and others who like to make these older systems work. Your input is appreciated.

We'll find some success for you here, and I think we'll get something into MacPorts that reflects your findings and makes nodejs work.

And then, if you're interested, we'll look forward to more contributions as you develop your MacPorts skill set.

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

I have been thinking about the cxx headers we force with the way legacysupport enables macports-libcxx.

First of all, as has been described in another PR, the forcing of the headers is already wrong, as the legacysupport PG has been jamming the cxxheaders into the cppflags. #25895.

That aside -- the macports-libcxx port is currently pulling the headers and libcxx from clang-11 and then forcing them to be used during the build:

if { [option legacysupport.use_mp_libcxx] && ${configure.cxx_stdlib} eq "libc++" } {

However, seems to me that if the compiler we're building with is newer than clang-11 (and it almost always is newer these days) then that has the affect of needlessly forcing older cxx headers to be used. I can't see any reason to be forcing this. It would seem to make more sense for the newer macports-clang compiler to use it's own headers, but still force the link against the libc++ installed by the macports-libcxx port.

So rather than a lot of header replacements, just doing this is probably the more correct thing to do, indeed:

    depends_lib-append        port:macports-libcxx
    configure.ldflags-append  -L/opt/local/lib/libcxx

The only time the headers in the macports-libcxx port should be forced is if they are newer than the xcode clang's headers or the compiler being used by the build. That was the case way back when this method was invented, but is likely to be rarely the case now. A few instances where the xcode clang works but needs newer headers might be discovered, I guess -- a corner case probably better handled by blacklisting that xcode version these days.

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

Oh, there is one thing -- we would have to disable the default assumption that we're building against the system libc++ in the usual installed headers that come with each macports-clang.

That used to require patching, which was part of why custom headers were needed, I recall now.

I think there is a define that can be set instead. I have to remind myself about all the nuances here, with verbose_abort, etc. There is a lot to keep track of to get this just right.

@i3roly
Copy link
Author

i3roly commented Oct 5, 2024 via email

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

forcing or changing the headers when using a newer libc++ is definitely necessary in the general case (otherwise the compiler assumes you are using the system libcxx, which you are not).

But this is a discussion for another forum, and is far more complicated than nodejs to get right for the general case.

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

By the way, we have to get your github cleaned up, and once that is done get you to open up a new PR here, only for one of the nodejs ports, like nodejs14 say.

When you are generating PRs for macports, you don't want to (and should not) generate PRs from the master branch in your fork, as then you are kinda hosed.

what you do is you create a new branch in your fork of macports-ports, and make your changes in that branch. Then you generate your PR from there.

What you have now -- is kinda messed up. You have a master branch with extra commits in it that macports doesn't have, and so you are inconsistent with upstream. You can't really add any new branches to a messed up master branch.

It will probably take you many hours to sort out how to clean this master branch up at this point. You can google about "git reset --hard" and similar. It is most likely easier to start over, delete your fork of macports-ports, and then create a new one, and try again.

There is a learning curve to git / github, but it is a helluva lot easier than any other option out there, and everyone uses it, so it's worth learning.

@kencu
Copy link
Contributor

kencu commented Oct 5, 2024

rather than patching the headers, with modern clang libc++ headers, you define these if you want to indicate you're not using the system libc++.

The first is the old define, to be removed someday, the second is the newer define, to be used going forward:

_LIBCPP_DISABLE_AVAILABILITY

_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS

@kencu
Copy link
Contributor

kencu commented Oct 6, 2024

I found a set of portfile instructions that will successfully build nodejs18 with tests enabled on 10.7:

# use the system libuv instead of the bundled version, as it is fixed for older systems
if { ${os.platform} eq "darwin" && ${os.major} < 15 } {
    depends_lib-append    path:lib/libuv.dylib:libuv
    configure.args-append --shared-libuv

    # suppress a warning-as-error that shows up with newer clang compilers
    configure.cxx-append      -Wno-error=enum-constexpr-conversion

    depends_lib-append        port:macports-libcxx
    configure.cxx-append      -Wl,-L/opt/local/lib/libcxx
}

just appending to the configure.XYflags didn't get the needed values everywhere they needed to go.

WIth that, doing this builds and at least starts running the tests:

sudo port -v test nodejs18

however, the VM then crashes badly after the first six tests have run. Exactly why it crashes at that point I don't know.

Moving on to try nodejs21 in case it fares better.

@i3roly
Copy link
Author

i3roly commented Oct 6, 2024 via email

@kencu
Copy link
Contributor

kencu commented Oct 6, 2024

the build of nodejs21 fails with these new thread QOS params

../deps/v8/src/base/platform/platform-posix.cc:1139:37: error: use of undeclared identifier 'QOS_CLASS_BACKGROUND'
 1139 |       pthread_set_qos_class_self_np(QOS_CLASS_BACKGROUND, 0);
      |                                     ^
../deps/v8/src/base/platform/platform-posix.cc:1142:37: error: use of undeclared identifier 'QOS_CLASS_USER_INITIATED'
 1142 |       pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, -1);
      |                                     ^
../deps/v8/src/base/platform/platform-posix.cc:1145:37: error: use of undeclared identifier 'QOS_CLASS_USER_INITIATED'
 1145 |       pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
      |                                     ^
  /opt/local/bin/clang++-mp-17 -Wno-error=enum-constexpr-conversion -Wl,-L/opt/local/lib/libcxx -Wl,-search_paths_first -arch x86_64 -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macp

these are popular new tweaking params to prioritize threads. We have worked around them in the past in the clang ports, so they are not insurmountable...

@i3roly
Copy link
Author

i3roly commented Oct 6, 2024 via email

@i3roly
Copy link
Author

i3roly commented Oct 6, 2024

phew, managed to restore the old commits for nolw until you're done. then i'll go back to an off-branch.

@kencu

@i3roly i3roly reopened this Oct 6, 2024
@i3roly i3roly marked this pull request as ready for review October 6, 2024 14:34
@kencu
Copy link
Contributor

kencu commented Oct 6, 2024

that should be patched

ah, yes, I had missed that patch. Applied now, and testing resumed, thanks.

@kencu kencu marked this pull request as draft October 6, 2024 18:02
@kencu
Copy link
Contributor

kencu commented Oct 6, 2024

with nodejs21, on 10.7 at least, the system libuv is apparently different enough from the one bundled with nodejs21 that it is not working as a replacement. That is too bad. I was hoping to keep that fix in, rather than start working on the libuv bundled with nodejs.

@i3roly
Copy link
Author

i3roly commented Oct 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer: open Affects an openmaintainer port
Development

Successfully merging this pull request may close these issues.

4 participants