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->22 changes #26031

Merged
merged 28 commits into from
Dec 3, 2024
Merged

initial nodejs14->22 changes #26031

merged 28 commits into from
Dec 3, 2024

Conversation

i3roly
Copy link
Contributor

@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.

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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor Author

i3roly commented Oct 6, 2024 via email

@i3roly
Copy link
Contributor Author

i3roly commented Nov 27, 2024

forgot to accommodate newer macs, hopefully buildbot is happy now.

@i3roly
Copy link
Contributor Author

i3roly commented Nov 28, 2024

yay, all chex passed.

can we
PUHUSH IHIT
PUHUSH IHIT RUHEAL GUHOOD, @mascguy?

@i3roly
Copy link
Contributor Author

i3roly commented Nov 28, 2024 via email

@reneeotten
Copy link
Contributor

reneeotten commented Nov 28, 2024

@kencu had concerns about merging this so this should not be merged as is. There is no need to rush this (@i3roly doing stuff in your own tree/locally is always fine) and it should only be merged if things are correct - we don't need quick-and-dirty, "works-for-me" fixes. Feel free to continue to work on this, but I would certainly like @kencu his eyes on this before merging the PR - he's been doing "old-systems-with-MacPorts" much longer than any of us, probably even combined ;)

@reneeotten reneeotten marked this pull request as draft November 28, 2024 16:39
@i3roly
Copy link
Contributor Author

i3roly commented Nov 28, 2024

if you read the history, you will see the early commits are not the same as the last ones.

first, and for the third or fourth time, cxxflags/ldflags will not work according to @kencu: read his comment:

#26031 (comment)

next, i actually changed my commits signiificantly and they're pretty muc hwaht ken recommended:

#26031 (comment)

in conclusion: @kencu is the reason that cxx-append is used over cxxflags-append or ldflags-append.

next, with respect to ken's reservations, they are with respect to HIS system running out of memory to complete TESTS. (see the above comment i've linked).

that, in no way, justifies having “no nodejs” over “some nodejs”. i’ve used it to build pkg with npm and run js stuff as standalone executables without issue.

i urge anyone, to read the scroll before making an inaccurate critique.

it’s pretty obvious i’ve made significant changes, and i think both @kencu AND @barracuda156's suggestions have been incorporated tightly and cleanly.

and also whilst i would like @kencu to participate, his last comment suggests he has handed this off to @barracuda156, but of course i would more than welcome @kencu to assert himself and establish he would like the final say.

in conclusion: there is no reason to stop this PR unless the argument is "we don't want users to have any nodejs, unless we are confident it completes all of the tests".

@i3roly i3roly marked this pull request as ready for review November 28, 2024 17:00
@i3roly
Copy link
Contributor Author

i3roly commented Nov 28, 2024

btw i tried to do the tests today and it seems it wasn't a resource issue experienced by @kencu:

Ran 6 tests in 0.003s

OK
/usr/bin/make -s test-doc
Running JS linter...
node:internal/modules/cjs/loader:1143
  throw err;
  ^

Error: Cannot find module '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_nodejs18/nodejs18/work/node-v18.20.4/tools/node_modules/eslint/bin/eslint.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.20.4

but a known issue with nodejs tests:

nodejs/node#39709

so in my opinion, the outstanding criticism is one experienced by others @mascguy @barracuda156 @kencu

@i3roly i3roly changed the title initial nodejs14->21 changes initial nodejs14->22 changes Nov 29, 2024
@i3roly
Copy link
Contributor Author

i3roly commented Dec 3, 2024

can we please push? everything passes and i've properly described the issue with tests.

it's quite unfair that it's been sitting this long, especially considering it's an open maintiner port.

the only reason i can think of is the leaders of the project would rather hurt their userbase and/or growth, for reasons unrelated to the port

@mascguy
Copy link
Member

mascguy commented Dec 3, 2024

can we please push? everything passes and i've properly described the issue with tests.

Things are looking good at this point.

Sergey, apart from formatting, do you have any other concerns?

Copy link
Member

@mascguy mascguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but need others to chime in

@mascguy
Copy link
Member

mascguy commented Dec 3, 2024

P.s. We'll need to squash the commits when merging, but that's no big deal.

@mascguy mascguy merged commit eb8d9a6 into macports:master Dec 3, 2024
3 checks passed
@mascguy
Copy link
Member

mascguy commented Dec 3, 2024

LGTM, but need others to chime in

After pondering for a bit, I think we should merge as-is. We can always tweak things in a follow-up PR, if needed.

Great work on this, and thank you for your patience!

@kencu
Copy link
Contributor

kencu commented Dec 8, 2024

My apologies for being just too busy with family stuff to spend time participating in this.

Because nodejsN uses a bundled libuv, and because that bundled libuv has none of macports' fixes in it, these nodejs version are generating sometimes broken software, eg:

https://trac.macports.org/ticket/71475

It should not be hard to start the process of patching the bundled libuv versions in these nodejsN ports. That will require digging into each nodejs version to the libuv part, and figuring out our patches to apply.

NB. It appears the current libuv port doesn't have absolutely all the needed patches correctly applied. I think the best set of libuv patches is most likely what I applied in the cmake ports to get those working correctly.

I tried to see if I could get these nodejsN versions to use the system libuv instead, to pick up our libuv fixes, but I could not, as the nodejs build would not accept the system libuv version.

@i3roly
Copy link
Contributor Author

i3roly commented Dec 8, 2024 via email

@i3roly
Copy link
Contributor Author

i3roly commented Dec 8, 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.

7 participants