build: add rust target for macOS cross compiles#63015
Draft
richardlau wants to merge 1 commit intonodejs:mainfrom
Draft
build: add rust target for macOS cross compiles#63015richardlau wants to merge 1 commit intonodejs:mainfrom
richardlau wants to merge 1 commit intonodejs:mainfrom
Conversation
Member
Author
|
Tried a test build, but that failed due to the issue being addressed by #63006. I'll either need that to land and rebase this, or create another branch with that plus this to test. |
Member
Author
|
Trying with another branch with this PR and #63006: |
When we build the macOS pkg, we build Node.js twice (on arm64): - Once for arm64 (native) - Once for x64, using a combination of Rosetta 2 and compiler flags before combining both into a universal binary. For the x64 case, pass target flag to `rustc` so that the binary is built for the correct target architecture. Signed-off-by: Richard Lau <[email protected]>
Member
Author
|
Didn't work. |
Member
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we build the macOS pkg, we build Node.js twice (on arm64):
before combining both into a universal binary.
For the x64 case, pass target flag to
rustcso that the binary is built for the correct target architecture.This is a "blind" attempt to address pkg build failures in the Node.js release CI -- I'm not a macOS user, nor do I have access to a macOS environment outside of the Node.js CI, so opening as a draft to test out.
It's quite possible that even if this is the "correct" fix, we'll need x64 rustc libraries installed on the release macOS VMs (CI run will indicate).