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

No native build was found #119

Closed
christianbundy opened this issue Feb 20, 2020 · 9 comments
Closed

No native build was found #119

christianbundy opened this issue Feb 20, 2020 · 9 comments

Comments

@christianbundy
Copy link
Contributor

Hello! 👋 I'm trying to load sodium-native 2.4.9 on a Google Pixel XL, but I'm bumping into:

No native build was found for platform=android arch=arm64 runtime=node abi=72 uv=1 armv=8 libc=glibc

I think I'm able to build from source after installing all of the node-gyp and build dependencies (python, libtool, make, autoconf, automake, etc), but I saw a few issues in this repo that mentioned ARM prebuilds.

Any chance it's obvious to someone why my device is building from source instead of using a prebuild? Thanks for the help!

@mafintosh
Copy link
Contributor

ARM build atm is just for raspberry pi.

For 3.0.0 (which shipped today!) we'll be investigating making android prebuilds, so good timing.
Did you have any trouble compiling btw?

@christianbundy
Copy link
Contributor Author

Hey @mafintosh! Congrats on the 3.0.0 release, I'm looking forward to seeing what's changed.

Did you have any trouble compiling btw?

Yeah, here's what I'm seeing during the build:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
    [generator, flat_list, targets, data] = Load(
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
    result = gyp.input.Load(build_files, default_variables, includes[:],
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2778, in Load
    LoadTargetBuildFile(build_file, data, aux_data,
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 416, in LoadTargetBuildFile
    ProcessVariablesAndConditionsInDict(
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1295, in ProcessVariablesAndConditionsInDict
    ProcessVariablesAndConditionsInList(value, phase, variables,
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1311, in ProcessVariablesAndConditionsInList
    ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1295, in ProcessVariablesAndConditionsInDict
    ProcessVariablesAndConditionsInList(value, phase, variables,
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1315, in ProcessVariablesAndConditionsInList
    expanded = ExpandVariables(item, phase, variables, build_file)
  File "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 914, in ExpandVariables
    sys.stderr.write(p_stderr)
TypeError: write() argument must be str, not bytes while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack

TypeError: write() argument must be str, not bytes while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 3.18.137-g72a7a64494e
gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/data/com.termux/files/home/oasis/node_modules/sodium-native
gyp ERR! node -v v13.0.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

Full log here, which also contains build problems from Sharp (lovell/sharp-libvips#38) and Leveldown (Level/leveldown#705).

@christianbundy
Copy link
Contributor Author

Also worth noting: since I'm using Termux there's probably lots of unrelated jank, so I wouldn't be surprised to find that the build failure is specific to Termux.

@christianbundy
Copy link
Contributor Author

Looks like the above was a Python 3 problem -- I was able to upgrade my npm and node-gyp, which resolved it. Here's the next error I'm seeing:

libtool: install: /data/data/com.termux/files/usr/bin/install -c .libs/libsodium.so.23.2.0 /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/libsodium.so.23.2.0
libtool: install: (cd /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib && { ln -s -f libsodium.so.23.2.0 libsodium.so.23 || { rm -f libsodium.so.23 && ln -s libsodium.so.23.2.0 libsodium.so.23; }; })
libtool: install: (cd /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib && { ln -s -f libsodium.so.23.2.0 libsodium.so || { rm -f libsodium.so && ln -s libsodium.so.23.2.0 libsodium.so; }; })
libtool: install: /data/data/com.termux/files/usr/bin/install -c .libs/libsodium.lai /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/libsodium.la
libtool: install: /data/data/com.termux/files/usr/bin/install -c .libs/libsodium.a /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/libsodium.a
libtool: install: chmod 644 /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/libsodium.a
libtool: install: ranlib /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/libsodium.a libtool: finish: PATH="/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/node_modules/.bin:/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/.bin:/data/data/com.termux/files/home/.npm-global/lib/node_modules/.bin:/data/data/com.termux/files/home/.npm-global/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:/sbin" ldconfig -n /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib
/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/libtool: 1: eval: ldconfig: Permission denied
----------------------------------------------------------------------
Libraries have been installed in:
/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator run these commands:
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Nothing to be done for 'install-data-am'.make[4]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src/libsodium'
make[3]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src/libsodium'
make[2]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src/libsodium'
make[2]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src'  make[3]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src'  make[3]: Nothing to be done for 'install-exec-am'.make[3]: Nothing to be done for 'install-data-am'.make[3]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src'   make[2]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src'   make[1]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/src'   Making install in test
make[1]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test' Making install in default
make[2]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test/default'
make[3]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test/default'
make[3]: Nothing to be done for 'install-exec-am'.make[3]: Nothing to be done for 'install-data-am'.make[3]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test/default'
make[2]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test/default'
make[2]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test' make[3]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test' make[3]: Nothing to be done for 'install-exec-am'.make[3]: Nothing to be done for 'install-data-am'.make[3]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test'  make[2]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test'  make[1]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium/test'  make[1]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium'
make[2]: Entering directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium'
make[2]: Nothing to be done for 'install-exec-am'. /data/data/com.termux/files/usr/bin/mkdir -p '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/pkgconfig'
/data/data/com.termux/files/usr/bin/install -c -m 644 libsodium.pc '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/tmp/lib/pkgconfig'
make[2]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium'
make[1]: Leaving directory '/data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native/libsodium'
gyp: Call to 'node preinstall.js --print-lib' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack
at ChildProcess.onCpExit (/data/data/com.termux/files/home/.npm-global/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack
at ChildProcess.emit (events.js:210:5)
gyp ERR! stack
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 3.18.137-g72a7a64494e
gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/home/.npm-global/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/data/com.termux/files/home/.npm-global/lib/node_modules/@fraction/oasis/node_modules/sodium-native
gyp ERR! node -v v13.0.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

The actual error looks like:

Call to 'node preinstall.js --print-lib' returned exit status 1 while in binding.gyp. while trying to load binding.gyp

But there are some notes about libtool that might be relevant?

@emilbayes
Copy link
Collaborator

@christianbundy That error actually comes from here:

https://github.com/sodium-friends/sodium-native/blob/8b123370d3876b9bfef3e66f5188c7a32ac22c3f/preinstall.js#L24-L42

I think @andrestaltz added 'android' in to his fork

@christianbundy
Copy link
Contributor Author

Oh, thanks @emilbayes! Would it make sense to add a case 'android': so that it's treated the same as OpenBSD / FreeBSD / Linux? Or is there some other context I should be aware of? I've glanced at @staltz's fork and I don't see how Android is handled there -- maybe --print-lib was stripped somewhere?

https://github.com/staltz/sodium-native-nodejs-mobile/blob/6c5781a82c965ccc4b1e6ad936ea5b43dd9d9270/preinstall.js#L24-L42

Since I'm otherwise able to build from source, it seems to me that this would be reasonable to support it in preinstall.js, but I've also spent very little time digging into this module (or prebuilds in general). I'll try making some changes and compiling from source, it just takes ~20 minutes per build on my device so I thought I'd ask in case you too. No worries if you don't have time/interest for hand-holding here, I appreciate your first tip!

@Ancient-Dragon
Copy link

Looks like this is also an issue on mac atm, getting a similar error:
Error: No native build was found for platform=darwin arch=x64 runtime=node abi=83 uv=1 libc=glibc
Using the latest version of node and npm

@emilbayes
Copy link
Collaborator

@Ancient-Dragon please open another issue with you specific node version :)

@kasperisager
Copy link
Contributor

This should be solved by #174 and #175.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants