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

Fails to compile on openSUSE LEAP 15 (../deps/build/lib/libsodium.a: No such file or directory ) #144

Open
udf2457 opened this issue Dec 9, 2018 · 8 comments

Comments

@udf2457
Copy link

udf2457 commented Dec 9, 2018

openSUSE LEAP 15
node v10.14.1

libsodium 1.0.16 (https://github.com/jedisct1/libsodium/releases) compiles fine, no problems.

However, add "sodium": "^3" to package.json and run npm update (npm cache clean -f has no effect):

../src/crypto_pwhash_algos.cc:25:1: note: in expansion of macro ‘CRYPTO_PWHASH_DEF’                                                                      [21/1903]
 CRYPTO_PWHASH_DEF(scryptsalsa208sha256)                                                                                                                          
 ^~~~~~~~~~~~~~~~~                                                                                                                                                
  CXX(target) Release/obj.target/sodium/src/crypto_pwhash.o                                                                                                       
  CXX(target) Release/obj.target/sodium/src/crypto_hash.o                                                                                                         
  CXX(target) Release/obj.target/sodium/src/crypto_hash_sha256.o                                                                                                  
  CXX(target) Release/obj.target/sodium/src/crypto_hash_sha512.o                                                                                                  
  CXX(target) Release/obj.target/sodium/src/crypto_shorthash.o                                                                                                    
  CXX(target) Release/obj.target/sodium/src/crypto_shorthash_siphash24.o                                                                                          
  CXX(target) Release/obj.target/sodium/src/crypto_generichash.o                                                                                                  
  CXX(target) Release/obj.target/sodium/src/crypto_generichash_blake2b.o                                                                                          
  CXX(target) Release/obj.target/sodium/src/crypto_onetimeauth.o                                                                                                  
  CXX(target) Release/obj.target/sodium/src/crypto_onetimeauth_poly1305.o                                                                                         
  SOLINK_MODULE(target) Release/obj.target/sodium.node                                                                                                            
g++: error: ../deps/build/lib/libsodium.a: No such file or directory                                                                                              
make[1]: *** [sodium.target.mk:141: Release/obj.target/sodium.node] Error 1                                                                                       
make[1]: Leaving directory '/usr/share/foobar/node/test1/node_modules/sodium/build'     
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/node_modules/npm10/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.12.14-lp150.12.25-default
gyp ERR! command "/usr/bin/node10" "/usr/lib64/node_modules/npm10/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/share/foobar/node/test1/node_modules/sodium
gyp ERR! node -v v10.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
make: *** [Makefile:82: nodesodium] Error 1
/usr/share/foobar/node/test1/node_modules/sodium/install.js:293
            throw new Error(cmdLine + ' exited with code ' + code);
            ^

Error: make nodesodium exited with code 2
    at ChildProcess.<anonymous> (/usr/share/foobar/node/test1/node_modules/sodium/install.js:293:19)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js --install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
@rawr51919
Copy link

I'm getting the same error with a discord.js bot, ending pretty much at the same spot as yours.

@rawr51919
Copy link

rawr51919 commented Feb 15, 2019

OK, @udf2457, try globally installing libsodium-wrappers using npm -i -g libsodium-wrappers, then retry sodium compilation. It should help with your issue.

@lbeltrame
Copy link

Posting after a year due to the same issue: It doesn't work, because it looks in "lib" while the static libsodium is installed in "lib64" in the build directory.

@rawr51919
Copy link

Should be a minor fix, then. Just have it look in lib64 instead of lib @lbeltrame

@lbeltrame
Copy link

lbeltrame commented Jan 12, 2020

That's what I'm trying to do at this point. Will report back.

Note that lib is hardcoded in the sources, so it requires manual modifications.

@rawr51919
Copy link

Would be PR-worthy, then.

@lbeltrame
Copy link

Probably, although I patched 2.0.3 because that's what a discord lib I used wanted.

@rawr51919
Copy link

The opposite could also work (using lib instead of lib64). Whichever is easier

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

3 participants