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

node-gyp generates an absolute path in makefiles #22823

Open
4 of 6 tasks
Kreijstal opened this issue Dec 17, 2024 · 3 comments
Open
4 of 6 tasks

node-gyp generates an absolute path in makefiles #22823

Kreijstal opened this issue Dec 17, 2024 · 3 comments
Labels

Comments

@Kreijstal
Copy link
Contributor

Description / Steps to reproduce the issue

git clone https://github.com/node-ffi-napi/weak-napi.git
cd weak-napi
node /mingw64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure 
# That command implicitly calls something like this
python /mingw64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py binding.gyp -f make -I /home/jpardo/ok/weak-napi/build/config.gypi -I /mingw64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I /mingw64/include/node/common.gypi -Dlibrary=shared_library -Dvisibility=default -Dnode_root_dir=/mingw64 -Dnode_gyp_dir=/mingw64/lib/node_modules/npm/node_modules/node-gyp -Dnode_lib_file=/mingw64/lib/libnode.dll.a -Dmodule_root_dir=weak-napi -Dnode_engine=v8 --depth
=. --no-parallel --generator-output build -Goutput_dir=.

Expected behavior

when going to build and executing make, it should compile

Actual behavior

you will see a build directory, and a file called weakref.target.mk this has a path that starts relative then becomes absolute.. So it does not compile, you get a message like

node_modules/node-addon-api/nothing.target.mk:81: *** target pattern contains no '%'.  Stop.

You see on this makefile the $OBJS has an entry that is malformed. That's just one of many issues.

Verification

Windows Version

MINGW64_NT-10.0-19045

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

No response

@Kreijstal Kreijstal added the bug label Dec 17, 2024
@Kreijstal
Copy link
Contributor Author

Kreijstal commented Dec 17, 2024

kreijstal@windows MINGW64 ~/ok/weak-napi
$ cygpath -u $(node -p "require('node-addon-api').include")

Doesn't seem to... work... huh

@raedrizqie
Copy link
Contributor

This package doesn't seem to support gnu windows?

First, update devtool deps:

$ cd weak-napi
npm i node-addon-api
npm i node-gyp-build
npm i setimmediate-napi

Then, use npm to build:

$ npm rebuild --verbose
npm verbose cli C:\MSYS64\clang64\bin\node.exe C:\MSYS64\clang64\lib\node_modules\npm\bin\npm-cli.js
npm info using [email protected]
npm info using [email protected]
npm verbose title npm rebuild
npm verbose argv "rebuild" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:C:\Users\raed\AppData\Local\npm-cache\_logs\2024-12-18T00_45_52_242Z-
npm verbose logfile C:\Users\raed\AppData\Local\npm-cache\_logs\2024-12-18T00_45_52_242Z-debug-0.log
npm info run [email protected] install  node-gyp-build
npm info run [email protected] install { code: 1, signal: null }
npm verbose stack Error: command failed
npm verbose stack     at promiseSpawn (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:22:22)
npm verbose stack     at spawnWithShell (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
npm verbose stack     at promiseSpawn (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
npm verbose stack     at runScriptPkg (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
npm verbose stack     at runScript (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
npm verbose stack     at C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\rebuild.js:329:17
npm verbose stack     at run (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:67:22)
npm verbose stack     at C:\MSYS64\clang64\lib\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:84:9
npm verbose stack     at new Promise (<anonymous>)
npm verbose stack     at callLimit (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:35:69)
npm verbose pkgid [email protected]
npm error code 1
npm error path C:\MSYS64\home\raed\weak-napi
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp-build
npm error make: Entering directory '/home/raed/weak-napi/build'
npm error make: Leaving directory '/home/raed/weak-napi/build'
npm error C:\MSYS64\home\raed\weak-napi\node_modules\node-gyp-build\node-gyp-build.js:60
npm error   throw new Error('No native build was found for ' + target + '\n    loaded from: ' + dir + '\n')
npm error   ^
npm error
npm error Error: No native build was found for platform=win32 arch=x64 runtime=node abi=127 uv=1 libc=glibc node=22.9.0
npm error     loaded from: C:\MSYS64\home\raed\weak-napi

...

@Kreijstal
Copy link
Contributor Author

This package doesn't seem to support gnu windows?

First, update devtool deps:

$ cd weak-napi
npm i node-addon-api
npm i node-gyp-build
npm i setimmediate-napi

Then, use npm to build:

$ npm rebuild --verbose
npm verbose cli C:\MSYS64\clang64\bin\node.exe C:\MSYS64\clang64\lib\node_modules\npm\bin\npm-cli.js
npm info using [email protected]
npm info using [email protected]
npm verbose title npm rebuild
npm verbose argv "rebuild" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:C:\Users\raed\AppData\Local\npm-cache\_logs\2024-12-18T00_45_52_242Z-
npm verbose logfile C:\Users\raed\AppData\Local\npm-cache\_logs\2024-12-18T00_45_52_242Z-debug-0.log
npm info run [email protected] install  node-gyp-build
npm info run [email protected] install { code: 1, signal: null }
npm verbose stack Error: command failed
npm verbose stack     at promiseSpawn (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:22:22)
npm verbose stack     at spawnWithShell (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
npm verbose stack     at promiseSpawn (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
npm verbose stack     at runScriptPkg (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
npm verbose stack     at runScript (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
npm verbose stack     at C:\MSYS64\clang64\lib\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\rebuild.js:329:17
npm verbose stack     at run (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:67:22)
npm verbose stack     at C:\MSYS64\clang64\lib\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:84:9
npm verbose stack     at new Promise (<anonymous>)
npm verbose stack     at callLimit (C:\MSYS64\clang64\lib\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:35:69)
npm verbose pkgid [email protected]
npm error code 1
npm error path C:\MSYS64\home\raed\weak-napi
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp-build
npm error make: Entering directory '/home/raed/weak-napi/build'
npm error make: Leaving directory '/home/raed/weak-napi/build'
npm error C:\MSYS64\home\raed\weak-napi\node_modules\node-gyp-build\node-gyp-build.js:60
npm error   throw new Error('No native build was found for ' + target + '\n    loaded from: ' + dir + '\n')
npm error   ^
npm error
npm error Error: No native build was found for platform=win32 arch=x64 runtime=node abi=127 uv=1 libc=glibc node=22.9.0
npm error     loaded from: C:\MSYS64\home\raed\weak-napi

...

afaik it just says no prebuilt file has been found, this makes sense, then it attempts to build on msys2, this is the right move, but then some path translation errors seem to happen.

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

No branches or pull requests

2 participants