- Notifications
You must be signed in to change notification settings - Fork 94
(xcode) feat: --cross-compiling overrides arch-specific settings#78
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
rvagg commented Nov 16, 2020
(view whitespace changes off btw https://github.com/nodejs/gyp-next/pull/78/files?diff=unified&w=1) |
bcoe commented Nov 17, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@rvagg sorry for being a pendant, but for the parser to pick up this change for a release, you'll want to go with: When you land 👍 |
a910a9f to 4287a42Comparervagg commented Nov 18, 2020
pointer appreciated, have amended and force pushed, thanks @bcoe |
gengjiawen left a comment
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.
LGTM
gengjiawen commented Nov 25, 2020
MarshallOfSound commented Nov 25, 2020
Can we validate this doesn't break existing X-compilatiom of native add-ons as that currently works. If no one gets to it I can test it later this week. Also unclear to me how X-compilation of native add-ons works but doesn't for node itself, they both use the same gyp-next toolchain right? |
gengjiawen commented Nov 25, 2020
This will be great.
Yeap. But gyp-next in node only responsible for build Node.js itself. |
rvagg commented Dec 1, 2020
For cross compiling on macos? Or in general? Currently the only cross that should be supported on macos (using the xcode path) is i386. But if you're successfully cross compiling anything else on macos then that'd be interesting to hear about! Perhaps I've missed something. |
gengjiawen commented Dec 9, 2020
@MarshallOfSound ping. |
gengjiawen commented Dec 16, 2020
@MarshallOfSound friendly ping again. |
MarshallOfSound commented Dec 16, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Ah sorry folks, this got drowned out in my other GH notifications.
We X-compile arm64 from x64 at the moment using the xcode path. Gave this a quick test going both arm64 from x64 and arm64 via Rosetta on an M1 and it doesn't look like it messes with that so LGTM 👍 |
gengjiawen commented Dec 17, 2020
Thanks for the test :) |
staltz commented Jan 9, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
TL;DR this commit broke compilation of nodejs-mobile for iOS from an x64 macBook. See PR nodejs-mobile/nodejs-mobile#9 (I'm not sure if it's good practice to comment on old PRs, so feel free to tell me to move this discussion elsewhere.) I maintain nodejs-mobile lately, and I'm updating our fork from Node 12.x to Node 16.x. Since we're compiling node.js for iOS, we want the Maybe a solution would be to patch this gyp-next script to detect whether we're running in arm64 darwin (such checks are common throughout the codebase, I've noticed) and then use the new logic. Else, use the old logic. What do you think? |
Continuing from nodejs/build#2474 (comment)
GYP_CROSSCOMPILE isn't used in the Xcode path at all, so this shouldn't conflict with anything afaik. This feels like a bit of a hack but elegance is beyond me for this. The problem we have is that
-arch Xis provided to all compile commands viaCFLAGS_Releaseand friends, regardless of host or target, and you can't override it by any other means, even if you can sneak in extra args viaCC.target,CC.hostand friends.I think this wouldn't be a problem if we didn't need the built-time tooling to be runnable on the host arch. So even though there's logic in there for "iphone" etc., those assume a single compile target, not the intermediate host compile for build-time tooling. I think. But maybe you folks can have a bit of a look to see if there's a more elegant way or something I'm overlooking here?