node-gyp
node-gyp copied to clipboard
action list element treated as pathname
I'm trying to build a node add-on that needs to get dependencies from a URL. In order to do so, I wrote a simple script that receives a command line argument as a URL. It then downloads and extracts the URL into <(SHARED_INTERMEDIATE_DIR>
.
Relevant binding.gyp
part:
'actions': [
{
'action_name': 'get_dep',
'action': ['node','./pull.js', 'https://example.com/depenency-1.0.0.tar.gz', '<(SHARED_INTERMEDIATE_DIR)'],
Works fine in tests, however, looks like node-gyp is converting argument as pathnames based on pathname relativization. Although, it does not mention that it should be used within actions
.
This is the process.argv
that the script is receiving while being invoked by node-gyp:
[
'C:\\Program Files\\nodejs\\node.exe',
'C:\\Users\\***\\code\\deps\\pull.js',
'..\\https://example.com/depenency-1.0.0.tar.gz',
'C:\\Users\\***\\code\\deps\\build\\Release\\obj\\global_intermediate'
]
TypeError: Only absolute URLs are supported
Is this an expected behavior? If so, is there a way to avoid it? Last thing I want to do for now is to modify the script so the script has no knowledge about node-gyp.
Thanks.
Environment Information:
key | value |
---|---|
node version | v12.17.0 |
npm version | 6.14.4 |
OS Name | Microsoft Windows 10 Enterprise for Virtual Desktops |
OS Version | 10.0.19041 N/A Build 19041 |
System Type | x64-based PC |
~Node 6 is no longer supported. https://github.com/nodejs/Release~
~The current version of npm is v7.5.3 https://www.npmjs.com/package/npm~
Mixed the rows! my bad :( sorry (issue updated).
@gentunian did you ever find a workaround for this issue? I'm running into a similar problem. The relativization only seems to happen on windows builds, also...
For any googlers that stumble on this, the only way I was able to work around this was by setting up a .bat
file and calling it from the gyp action.