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

feat: port "add support for MSVC cross-compilation" from node #41

Merged
merged 3 commits into from
May 29, 2020

Conversation

targos
Copy link
Member

@targos targos commented May 23, 2020

Original commit message:

tools,gyp: add support for MSVC cross-compilation

This change means that GYP can now generate two sets of projects: one
exclusively for a host x64 machine and one containing a mix of x64 and
Arm targets. The names of host targets are fixed up to end with
_host.exe, and any actions involving them are fixed up. This allows
compilation of Node on an x64 server for a Windows on Arm target.

Closes: #40

targos referenced this pull request in nodejs/node May 23, 2020
This change means that GYP can now generate two sets of projects: one
exclusively for a host x64 machine and one containing a mix of x64 and
Arm targets. The names of host targets are fixed up to end with
_host.exe, and any actions involving them are fixed up. This allows
compilation of Node on an x64 server for a Windows on Arm target.

PR-URL: #32867
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: João Reis <reis@janeasystems.com>
pylib/gyp/input.py Outdated Show resolved Hide resolved
test_gyp.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM. I guess we can address @cclauss's comments in a single commit after the cherry-picked commit. Moving forwards, let's please make sure to close any PRs to gyp in the node/node-gyp source code and move them all to here.

Original commit message:

    tools,gyp: add support for MSVC cross-compilation

    This change means that GYP can now generate two sets of projects: one
    exclusively for a host x64 machine and one containing a mix of x64 and
    Arm targets. The names of host targets are fixed up to end with
    _host.exe, and any actions involving them are fixed up. This allows
    compilation of Node on an x64 server for a Windows on Arm target.

Refs: nodejs/node#32867
Closes: nodejs#40
@targos
Copy link
Member Author

targos commented May 28, 2020

Updated. Thanks for the review

Copy link
Contributor

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New patch LGTM. @cclauss can you please re-review this? I'll land this once you approve.

Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM

@@ -3786,10 +3812,10 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
content += _GetMSBuildLocalProperties(project.msbuild_toolset)
content += import_cpp_props_section
content += import_masm_props_section
if spec.get("msvs_enable_marmasm"):
if spec.get("msvs_enable_marmasm") or True:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richard-townsend-arm I copied this from the downstream commit but it doesn't look right.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think my git commit -av habit has struck again! It should compile fine without or True, and (if not) I'll fix that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick build on my own branch indicates that everything compiles fine without this or True. Feel free to remove it here and I can push a new patch to Node.js to remove it from there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for verifying! No need to push a patch to Node.js, we're going to downstream more changes from here.

@targos
Copy link
Member Author

targos commented May 28, 2020

I'd like to wait for an answrer on #41 (comment) before merging.

@ryzokuken
Copy link
Contributor

@targos would you like to push a commit removing the unnecessary condition? Once that's done we could merge this 😄

pylib/gyp/generator/msvs.py Outdated Show resolved Hide resolved
@targos
Copy link
Member Author

targos commented May 28, 2020

@ryzokuken done

@ryzokuken ryzokuken merged commit 62b53cb into nodejs:master May 29, 2020
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

Successfully merging this pull request may close these issues.

upstream cross-compilation support for Windows on Arm
4 participants