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

Argon2 build fails on GCC 4.8 #117

Closed
weirdf0x opened this issue Feb 16, 2018 · 16 comments
Closed

Argon2 build fails on GCC 4.8 #117

weirdf0x opened this issue Feb 16, 2018 · 16 comments
Assignees

Comments

@weirdf0x
Copy link

Steps to reproduce

  1. Install argon2 v0.17.2 package via npm

Expected behaviour

The package is installed correctly, the build of the C++ argon2 binary does not fail. The build did not fail with argon2 v0.16.2

Actual behaviour

The build of argon2 v0.17.2 binary fails with following errors:

make: Entering directory `/home/builds/c15a579e/0/sb/px/node_modules/argon2/build'
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  AR(target) Release/obj.target/argon2.a
  COPY Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
../src/argon2_node.cpp: In constructor ‘NodeArgon2::HashWorker::HashWorker(std::string, NodeArgon2::Options)’:
../src/argon2_node.cpp:85:31: error: could not convert ‘std::move<NodeArgon2::Options&>((* & options))’ from ‘std::remove_reference<NodeArgon2::Options&>::type {aka NodeArgon2::Options}’ to ‘std::string {aka std::basic_string<char>}’
     options{std::move(options)}
                               ^
../src/argon2_node.cpp:85:31: warning: missing initializer for member ‘NodeArgon2::Options::hash_length’ [-Wmissing-field-initializers]
../src/argon2_node.cpp:85:31: warning: missing initializer for member ‘NodeArgon2::Options::time_cost’ [-Wmissing-field-initializers]
../src/argon2_node.cpp:85:31: warning: missing initializer for member ‘NodeArgon2::Options::memory_cost’ [-Wmissing-field-initializers]
../src/argon2_node.cpp:85:31: warning: missing initializer for member ‘NodeArgon2::Options::parallelism’ [-Wmissing-field-initializers]
../src/argon2_node.cpp:85:31: warning: missing initializer for member ‘NodeArgon2::Options::type’ [-Wmissing-field-initializers]
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
make: Leaving directory `/home/builds/c15a579e/0/sb/px/node_modules/argon2/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 3.10.0-693.17.1.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/builds/c15a579e/0/sb/px/node_modules/argon2
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon2@0.17.2 install: `node-gyp rebuild`
npm ERR! Exit status 1

Environment

Operating system:
CentOS 7 3.10.0-693.17.1.el7.x86_64
Node version:
8.9.4
Compiler version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
@stormwin
Copy link

+1

@ranisalt ranisalt changed the title Argon2 build fails on CentOS 7 x64 Argon2 build fails on GCC 4.8 Feb 19, 2018
@ranisalt
Copy link
Owner

It is actually a GCC 4.8 issue. Try clang or GCC 5+

@paulvandenburg
Copy link

I had a similar issue, eventually after making sure I had the following packages installed it worked:
sudo apt install g++ argon2 gcc make

@kingjerod
Copy link

Getting same issue with gcc v4.9.2. Just using a Dockerfile with FROM node:8.9

@weirdf0x
Copy link
Author

I had the option to install a newer GCC on CentOS 7. It is easy using Software Collections: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/

@ranisalt
Copy link
Owner

@kingjerod do you get the same with node:8.9-alpine?

@tmcdonnell87
Copy link

On one of my projects this was fixed by upgrading to node:8.9-stretch. However, I have a number of images based on OS like Ubuntu 16.04 (or 14.04) that fail. Upgrading gcc is a bit annoying if it's only to use argon2 17... I've had to downgrade to 16.2 on a couple more. Would love to see gcc support for 4.8 return... otherwise I'll be stuck for a while.

@kingjerod
Copy link

@ranisalt I have not tried it with alpine, but in my experience alpine rarely works for any packages that need to compile or use node-gyp. I switched from alpine to non-alpine to get bcrypt to work. Just less headaches at the cost of 10x image size.

@kingjerod
Copy link

kingjerod commented Mar 23, 2018

@ranisalt Completely fails on node:8.9-alpine due to lack of Python:

/app # npm install argon2

> argon2@0.17.2 install /app/node_modules/argon2
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.9.60-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/node_modules/argon2
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN app@1.0.0 No description
npm WARN app@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon2@0.17.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the argon2@0.17.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-03-23T00_56_24_201Z-debug.log

@shaunie2fly
Copy link

shaunie2fly commented Mar 26, 2018

Install the required build tools install argon2 and remove the build tools.

apk --no-cache add --virtual native-deps \
  g++ gcc libgcc libstdc++ linux-headers make python && \
  npm install --quiet node-gyp -g && \
  npm install && npm ls && \
  apk del native-deps

@hinell
Copy link

hinell commented Mar 26, 2018

There is also similar issue for windows #109

@ranisalt
Copy link
Owner

There is also similar issue for windows #109

That's not the same issue. Here, it is syntax parsing problem with a very old version of GCC, on the other issue it's a compiler library shipped corrupted (if I understood it correctly). IOW, this one is "fixable" by downgrading syntax, the other one is not and requires user action.

@ranisalt ranisalt self-assigned this Mar 26, 2018
@ranisalt
Copy link
Owner

Fixed it, but you really should update your compilers. Use docker if you must use Ubuntu 14.04 to access newer versions.

(or ditch Ubuntu for once)

@kingjerod
Copy link

kingjerod commented Mar 27, 2018

The official Docker Node images are based off Debian Jessie and it wouldn't build on them either.
¯\_(ツ)_/¯

@shaunie2fly
Copy link

but ubuntu is the coolest ;)

@ranisalt
Copy link
Owner

The official Docker Node images are based off Debian Jessie and it wouldn't build on them either.

Isn't Debian Jessie on GCC 4.9? I got it working here hahaha but anyways, it's fixed.

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

8 participants