node-userid icon indicating copy to clipboard operation
node-userid copied to clipboard

Compilation error with node 12

Open samuela opened this issue 6 years ago • 4 comments

On [email protected] with macOS 10.14.4 (18E226)

remod 🔥 yarn install
yarn install v1.16.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
error /Users/skainswo/dev/remod/node_modules/userid: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/skainswo/dev/remod/node_modules/userid
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/12.3.1/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/skainswo/dev/remod/node_modules/userid/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/12.3.1/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/skainswo/.node-gyp/12.3.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/skainswo/.node-gyp/12.3.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/12.3.1/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/skainswo/.node-gyp/12.3.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/skainswo/dev/remod/node_modules/userid',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/userid/src/userid.o
../src/userid.cc:47:42: error: too few arguments to function call, single argument 'context' was not specified
    group = getgrgid(info[0]->Int32Value());
                     ~~~~~~~~~~~~~~~~~~~ ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/userid.cc:75:38: error: no matching member function for call to 'ToString'
  String::Utf8Value utfname(info[0]->ToString());
                            ~~~~~~~~~^~~~~~~~
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2528:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2544:35: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
../src/userid.cc:118:40: error: no matching member function for call to 'ToString'
    String::Utf8Value utfname(info[0]->ToString());
                              ~~~~~~~~~^~~~~~~~
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2528:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2544:35: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
../src/userid.cc:137:41: error: too few arguments to function call, single argument 'context' was not specified
    user = getpwuid(info[0]->Int32Value());
                    ~~~~~~~~~~~~~~~~~~~ ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/userid.cc:155:40: error: no matching member function for call to 'ToString'
    String::Utf8Value utfname(info[0]->ToString());
                              ~~~~~~~~~^~~~~~~~
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2528:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/skainswo/.node-gyp/12.3.1/include/node/v8.h:2544:35: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
5 errors generated.
make: *** [Release/obj.target/userid/src/userid.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/12.3.1/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.3.1/bin/node" "/usr/local/Cellar/node/12.3.1/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/skainswo/dev/remod/node_modules/userid
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remod 🔥 
remod 🔥 gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
remod 🔥 g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
remod 🔥 clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
remod 🔥 

samuela avatar May 28 '19 22:05 samuela

I'm wondering if this line

gyp info spawn args   '-Dnode_lib_file=/Users/skainswo/.node-gyp/12.3.1/<(target_arch)/node.lib',

has anything to do with it. Seems as though target_arch is not being properly expanded.

samuela avatar May 28 '19 22:05 samuela

It's also worth noting that the compile worked previously but failed after upgrading yarn via brew:

remod 🔥 brew upgrade yarn
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 5 taps (heroku/brew, homebrew/core, homebrew/cask, homebrew/services and caskroom/cask).
==> New Formulae
atlantis                             csvq                                 deno                                 include-what-you-use                 pprint                               [email protected]
clzip                                dbmate                               erlang@21                            molten-vk                            spirv-tools
==> Updated Formulae
dep ✔                   certbot                 docfx                   glslang                 libevent                n                       picat                   shc                     velero
heroku/brew/heroku ✔    cfengine                double-conversion       gmic                    libidn2                 nats-streaming-server   planck                  ship                    vert.x
node ✔                  cfn-lint                dscanner                gnutls                  libimagequant           nco                     pmd                     shogun                  vim
acpica                  cglm                    dub                     google-benchmark        libmagic                neo4j                   pngquant                siril                   [email protected]
aide                    checkstyle              elasticsearch           goreleaser              libphonenumber          netdata                 pre-commit              skaffold                vips
aliyun-cli              cmark-gfm               emscripten              grafana                 libpsl                  nginx                   presto                  sleuthkit               volt
allure                  cockroach               epubcheck               grails                  libqalculate            nlopt                   prometheus              smimesign               wabt
ansible                 cocoapods               erlang                  grpc                    librealsense            nnn                     proteinortho            sn0int                  wartremover
[email protected]                 conan                   exploitdb               grpcurl                 libressl                notmuch                 pulumi                  spirv-cross             webpack
asdf                    conserver               eye-d3                  hana                    libuv                   opa                     pyside                  sqlmap                  websocat
atari800                consul                  faas-cli                harfbuzz                lmod                    opencascade             qalculate-gtk           sshtrix                 weechat
auditbeat               convox                  faudio                  heimdal                 lsd                     operator-sdk            qpdf                    sslh                    wget
augeas                  corsixth                ffsend                  highlight               mame                    osc                     rabbitmq                stellar-core            whois
avra                    crc32c                  file-formula            hlint                   math-comp               owfs                    radare2                 stout                   wiredtiger
aws-okta                cryptol                 flow                    ibex                    mesa                    p11-kit                 range-v3                strongswan              wtf
aws-sdk-cpp             csound                  fluxctl                 imagemagick             metricbeat              packer                  redo                    subversion              xctool
axel                    curl                    fn                      jdnssec-tools           micronaut               paket                   restview                supervisor              xmake
b2-tools                curl-openssl            fobis                   jenkins                 mighttpd2               pandoc-crossref         riemann                 swiftformat             xmrig
babel                   dartsim                 fonttools               jmxterm                 mill                    parallel                riff                    swimat                  xsimd
bat                     dav1d                   gecode                  just                    minimal-racket          parallelstl             rom-tools               terraform               yle-dl
bazel                   dcd                     genact                  kibana                  minio                   passenger               roswell                 terrahub                you-get
bee                     dhall                   ghq                     kitchen-sync            minio-mc                pdns                    rust                    tmuxinator-completion   youtube-dl
binaryen                dhall-json              git-cinnabar            kobalt                  mkl-dnn                 perl                    rustup-init             topgrade
bind                    diffoscope              git-quick-stats         kubecfg                 mpop                    peru                    scipy                   treefrog
bison                   django-completion       gitg                    kubeprod                msgpack                 php-cs-fixer            scmpuff                 tundra
byteman                 dnscontrol              gitlab-runner           lego                    msktutil                phpstan                 sdb                     uncrustify
cargo-completion        dnstwist                glib                    libdazzle               mutt                    picard-tools            serverless              urdfdom_headers
==> Deleted Formulae
erlang@18

==> Upgrading 1 outdated package:
yarn 1.13.0 -> 1.16.0
==> Upgrading yarn 
==> Installing dependencies for yarn: icu4c and node
==> Installing yarn dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-64.2.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e8/e858556120acc0c2d52b8fb572b677856724cc28d24a7e1b2762d458a2977c8e?__gda__=exp=1559083043~hmac=9a7556a7c186de790c270a94a16d1b8bdc5a9db9b08f81ab9655a79b6438faae&response-con
######################################################################## 100.0%
==> Pouring icu4c-64.2.mojave.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> Summary
🍺  /usr/local/Cellar/icu4c/64.2: 257 files, 69.2MB
==> Installing yarn dependency: node
==> Downloading https://homebrew.bintray.com/bottles/node-12.3.1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/4d/4ded0c82859da5c88b37e4295e95dd3a30e88d3a399e02ffa3592e3d3a41d5c6?__gda__=exp=1559083048~hmac=62b7cbb0197c6fb9e5d6face63ca5f022d056703505ca6ca84fb4fdd407c771f&response-con
######################################################################## 100.0%
==> Pouring node-12.3.1.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/node/12.3.1: 4,505 files, 53.8MB
==> Installing yarn
==> Downloading https://yarnpkg.com/downloads/1.16.0/yarn-v1.16.0.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/49970642/4ea79e00-6a70-11e9-8a21-46a123284fc5?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190528%2Fus-eas
######################################################################## 100.0%
🍺  /usr/local/Cellar/yarn/1.16.0: 14 files, 4.7MB, built in 4 seconds
Removing: /usr/local/Cellar/yarn/1.13.0... (14 files, 4.7MB)
==> Caveats
==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> node
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
remod 🔥 

samuela avatar May 28 '19 22:05 samuela

Turns out that the upgrade to node 12.3.1 from 11.8.0 was the issue. Downgrading to 11.8.0 fixed the compile. This still presents a problem for me though since I need this to work on all recent versions of node.

samuela avatar May 28 '19 23:05 samuela

Should be fixed in the new 1.0.0-beta version :D Please help me test!

cinderblock avatar Nov 04 '19 21:11 cinderblock