-
Notifications
You must be signed in to change notification settings - Fork 284
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
Read architecture from node-gyp correctly #491
Conversation
It was executing node-gyp configure and trying to read the arch from the output, but was doing so by looking at a string that printed was platform gyp was running on rather than the target platform. node-gyp --build does output the target architecture though, so parse it from that.
@@ -164,18 +164,19 @@ mod build { | |||
} | |||
|
|||
if cfg!(windows) { | |||
let node_gyp_output = String::from_utf8_lossy(&output.stderr); | |||
println!("cargo:node_arch={}", parse_node_arch(&node_gyp_output)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node_gyp_output
no longer exists. Does it need to be passed into this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - that line shouldn't have been deleted - fixed. (For complex dependency reasons I had to backport the fix to 0.3.x to test it and had to manually merge as the indenting level had changed, so must have missed this one).
@dbkr Thanks for contributing a fix! Can you take a look at the build failures? Thanks! |
That line needs to stay for the root dir / lib file
Hi - is anything further needed from me on this? We'd like to start releasing builds soon so are very keen for #490 to be fixed, otherwise we'll have to find a workaround. |
@dherman can you take a look at this? I'm not familiar enough with this code to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the fix!
Reads the target architecture from the output of
node-gyp build
which prints the target architecture rather than the 'using' string thatnode-gyp
prints (which is the platform it's running on).This allows neon projects to build on platforms where the host's node binary is of a different architecture to the target architecture (eg. on Windows when building for x86 on an x64 host, even if using native x86 toolchains).
Fixes #490