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

Build for ARM Windows #205

Merged
merged 6 commits into from
Jan 29, 2025
Merged

Build for ARM Windows #205

merged 6 commits into from
Jan 29, 2025

Conversation

DavisVaughan
Copy link
Collaborator

@DavisVaughan DavisVaughan commented Jan 25, 2025

Closes #170

Successful dry-run built an ARM Windows binary here https://github.com/posit-dev/air/actions/runs/12969634669/job/36173931978, in theory it works? 😆

The way this works is through cross-compilation. GitHub currently only provides x86_64 Windows runners on the free tier, so instead according to axodotdev/cargo-dist#1635 cargo-dist will detect that you are requesting ARM Windows and will automatically:

I see two reasons this could change on the cargo-dist side going forward:

Regardless, both possibilities would be cargo-dist details and would be nicely abstracted away from us, so all we'd have to do is update cargo-dist to get the changes. And in the meantime as long as cargo-xwin works I'm not mad about using it.

@DavisVaughan
Copy link
Collaborator Author

This was mildly complicated by this issue axodotdev/cargo-dist#1633

The summary of the problem was:

The easy solution was to just tell dist to only worry about managing crates/air by updating the workspace members in the dist toml, and by setting precise-builds = true. We should have been setting this in the first place, and that also shaves a whole minute off our build steps, as now its no longer trying to compiler heavier internal crates like lsp-test and xtask/codegen.

If we do end up having to bring rusttls (and therefore ring) back into the core stack before cargo-dist gets off xwin using one of the two means outlined above, then we will have to either set the new XWIN_CROSS_COMPILER environment variable, or ask cargo-dist to provide a way for us to set --cross-compiler (https://github.com/rust-cross/cargo-xwin?tab=readme-ov-file#customization). But I'm hoping that cargo-dist instead just moves off xwin in favor of just cross compiling straight from x86_64 windows runners, which seems to work fine.

Which causes cross compilation on ARM Windows issues right now
So it hopefully doesn't try and compile every crate in our workspace, including heavier dev crates
@DavisVaughan DavisVaughan merged commit 0661d00 into main Jan 29, 2025
5 checks passed
@DavisVaughan DavisVaughan deleted the feature/arm-windows branch January 29, 2025 15:08
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.

Add support for "aarch64-pc-windows-msvc"
2 participants