Closed 4c656554 closed 3 weeks ago
I might be confused, but the code noted on npm: https://www.npmjs.com/package/sodium-native?activeTab=code looks different to that in this repo. In particular, the npm version has a deps
folder where as this repo doesn't.
Just wondering if this might have something to do with the error, given that it references node deps/bin.js --print-include
As a workaround I can install version 3.2.1 like so:
npm i sodium-native@3.2.1
Prior to this, I had done the following (unsure whether this is required):
pkg_add git
git clone --branch v3.2.1 https://github.com/sodium-friends/sodium-native
cd s*
pkg_add libsodium
pkg_add libtool
pkg_add autoconf
export AUTOCONF_VERSION=2.71
pkg_add automake
export AUTOMAKE_VERSION=1.16
npm install
I can recreate the error by doing the following
git clone --branch v3.3.0 https://github.com/sodium-friends/sodium-native
cd s*
npm install prebuildify
npm run prebuild
Further, I think the error can be narrowed down by running:
git clone --branch v3.3.0 https://github.com/sodium-friends/sodium-native
cd s*
node deps/bin.js --print-include
The EPIPE error seems to come from the Socket within the process instantiated here, arguments 'tar','xzv':
https://github.com/sodium-friends/sodium-native/blob/v3.3.0/deps/bin.js#L203
In particular here
Where it attempts opts.stdin.pipe(proc.stdin)
but I'm guessing proc.stdin is already closed for some reason...
We don't actively test on OpenBSD but happy to fix bugs if there is any. Does it compile for you on master if you clone that and follow the instructions?
Thank you
git clone --branch master https://github.com/sodium-friends/sodium-native
cd s*
npm install
gives the following output logs:
Please let me know if I've missed some instructions (I can see npm install sodium-native
).
Happy to provide more information...
I think the failed build on the master (above) might be because my hardware (amd a4-5300B APU 1.9GHz) doesn't to support ssse3; however I'm uncertain of this.
I get the same SSSE3 errors on a new machine with new Intel processor. So I think that lowers the likelihood of the problem being hardware related.
I can get it to install by setting -mssse
and -msse4.1
CFLAGS:
git clone --recursive --branch master https://github.com/sodium-friends/sodium-native
cd s*
export CFLAGS="-mssse3 -msse4.1"
export CXXFLAGS="-mssse3 -msse4.1"
npm install
Progress ... :-)
However 90 of 5963 tests fail on running npm run test
: is this normal?
Updating the binding.gyp file with the below would allow node-gyp to detect openbsd and set the cflags accordingly:
'target_name': 'sodium',
...
'conditions': [
['OS=="openbsd"', {
'cflags': [ '-mssse3', '-msse4.1' ]
}]
],
...
I have verified this as ~working (npm run test
gives 5873 of 5963 tests passing)
Here is the output of the failed tests:
Looks like openbsd doesn't support some of the apis. you can skip those tests on openbsd. The test output there has a lot of noise as the APIs fail
reopen if still relevant in 2024
Hello,
I get the following output on OpenBSD 7.3 amd64:
npm install sodium-native
What steps could I take?
Perhaps this is relevant: https://github.com/sodium-friends/sodium-native/issues/54