NodeJS.jl icon indicating copy to clipboard operation
NodeJS.jl copied to clipboard

Add cxxstring_abi = "cxx11" for linux

Open stephen-huan opened this issue 8 months ago • 1 comments

node's dependency on the C++ standard library is not declared.

julia> using NodeJS

julia> run(`$(nodejs_cmd()) -v`)
ERROR: IOError: could not spawn `/home/ikue/.julia/artifacts/9c278c61d6242d19deca58e582fc6a6f0a727de8/bin/node -v`: no such file or directory (ENOENT)
Stacktrace:
 [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Union{RawFD, IO}})
   @ Base ./process.jl:128
 [2] #760
   @ ./process.jl:139 [inlined]
 [3] setup_stdios(f::Base.var"#760#761"{Cmd}, stdios::Vector{Union{RawFD, IO}})
   @ Base ./process.jl:223
 [4] _spawn
   @ ./process.jl:138 [inlined]
 [5] run(::Cmd; wait::Bool)
   @ Base ./process.jl:479
 [6] run(::Cmd)
   @ Base ./process.jl:477
 [7] top-level scope
   @ REPL[3]:1

The error message is not particularly helpful as the binary does exist at that path. Running

nm -ugD ~/.julia/artifacts/9c278c61d6242d19deca58e582fc6a6f0a727de8/bin/node | grep GLIBCXX | head -n 10
                 U __once_proxy@@GLIBCXX_3.4.11
                 U _ZdaPv@@GLIBCXX_3.4
                 U _ZdlPv@@GLIBCXX_3.4
                 U _ZdlPvRKSt9nothrow_t@@GLIBCXX_3.4
                 U _Znam@@GLIBCXX_3.4
                 U _ZnamRKSt9nothrow_t@@GLIBCXX_3.4
                 U _ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
                 U _ZNKSt5ctypeIcE13_M_widen_initEv@@GLIBCXX_3.4.11
                 U _ZNKSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4.21
                 U _ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEm@@GLIBCXX_3.4.18

which shows the undeclared dependency. See Yggdrasil's recipe for NodeJS_18

platforms = [
    Platform("x86_64", "linux"; libc="glibc", cxxstring_abi="cxx11"),
    Platform("aarch64", "linux"; libc="glibc", cxxstring_abi="cxx11"),
    Platform("powerpc64le", "linux"; libc="glibc", cxxstring_abi="cxx11"),
    Platform("armv7l", "linux"; libc="glibc", cxxstring_abi="cxx11"),


    Platform("x86_64", "linux"; libc="musl", cxxstring_abi="cxx11"),
    Platform("aarch64", "linux"; libc="musl", cxxstring_abi="cxx11"),
    Platform("armv7l", "linux"; libc="musl", cxxstring_abi="cxx11"),


    Platform("x86_64", "macos"),
    Platform("aarch64", "macos"),


    Platform("x86_64", "windows"),
    Platform("i686", "windows"),
]

and Artifacts.toml of NodeJS_18_jll.jl.

[[NodeJS_18]]
arch = "aarch64"
cxxstring_abi = "cxx11"
git-tree-sha1 = "a7303af39e9c46a0fc9a75a3e900b0fb4f698ea9"
libc = "glibc"
os = "linux"


    [[NodeJS_18.download]]
    sha256 = "c6eb1ee51bb058c98542ab16758cbeec9c00d706325ea2c341f2989d76426243"
    url = "https://github.com/JuliaBinaryWrappers/NodeJS_18_jll.jl/releases/download/NodeJS_18-v18.16.1+0/NodeJS_18.v18.16.1.aarch64-linux-gnu-cxx11.tar.gz"
[[NodeJS_18]]
arch = "aarch64"
cxxstring_abi = "cxx11"
git-tree-sha1 = "a7303af39e9c46a0fc9a75a3e900b0fb4f698ea9"
libc = "musl"
os = "linux"
# ...

stephen-huan avatar Dec 25 '23 09:12 stephen-huan