Skip to content

work around x64 dist on ARM64 Windows being treated as a cross-compile - #340

Merged
sunshowers merged 1 commit into
mainfrom
jj-stack/work-around-x64-dist-on-arm64-windows-being-treated-as-a-cross-compile-xsutrouu
Sep 27, 2026
Merged

sunshowers merged 1 commit into
mainfrom
jj-stack/work-around-x64-dist-on-arm64-windows-being-treated-as-a-cross-compile-xsutrouu

Conversation

@sunshowers

@sunshowers sunshowers commented Sep 22, 2026 •

Copy link
Copy Markdown

See inline comments for more information.

The root issue is that dist appears to confuse the host platform with the platform it was built for. The two are usually the same but are not in case of x86_64 binaries running on ARM64 under emulation. Work around this for now, in lieu of fixing up all of dist.

We do not ship an ARM64 binary for dist itself yet -- doing so will probably require other fixes, including to binary signing.

@wfchandler wfchandler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! I have no complaints

@wfchandler

Copy link
Copy Markdown
Collaborator

@sunshowers the macOS CI failures should be fixed on main, do you mind rebasing?

@sunshowers

sunshowers commented Sep 26, 2026 •

Copy link
Copy Markdown
Author

Revision history

Version Changes from previous version Submitted commit
5 (current) 275f2695..55a0b3a6 55a0b3a6
4 e3cde77c..275f2695 275f2695
3 b2a33916..e3cde77c e3cde77c
2 b7645a26..b2a33916 b2a33916
1 Initial version b7645a26

Generated by jj-stack from this pull request's force-push history.

@sunshowers
sunshowers force-pushed the jj-stack/work-around-x64-dist-on-arm64-windows-being-treated-as-a-cross-compile-xsutrouu branch 3 times, most recently from e3cde77 to 275f269 Compare September 26, 2026 23:46
See inline comments for more information.

The root issue is that dist appears to confuse the host platform with the platform it was built for. The two are usually the same but are not in case of x86_64 binaries running on ARM64 under emulation. Work around this for now in lieu of fixing up all of dist.

We do not ship an ARM64 binary for dist itself yet -- doing so will probably require other fixes, including to binary signing.
@sunshowers
sunshowers force-pushed the jj-stack/work-around-x64-dist-on-arm64-windows-being-treated-as-a-cross-compile-xsutrouu branch from 275f269 to 55a0b3a Compare September 26, 2026 23:50
Comment on lines +238 to +251
if Self::is_repo_root(git, repo_dir)? {
eprintln!("repo already cloned, updating it...");
std::env::set_current_dir(repo_dir).into_diagnostic()?;
git.output_checked(|c| c.arg("remote").arg("set-url").arg("origin").arg(repo_url))?;
git.output_checked(|c| c.arg("fetch").arg("origin").arg(commit_sha).arg("--tags"))?;
git.output_checked(|c| c.arg("reset").arg("--hard").arg("FETCH_HEAD"))?;
} else {
if repo_dir.exists() {
// rust-cache strips files but keeps dirs under target/, leaving
// a .git skeleton -- git would then operate on the enclosing
// checkout.
eprintln!("{repo_dir} exists but is not a git repo root, removing it...");
axoasset::LocalAsset::remove_dir_all(repo_dir)?;
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

FYI @wfchandler made some fixes to fix CI with cached artifacts.

@sunshowers
sunshowers merged commit 00a0054 into main Sep 27, 2026
15 checks passed
@sunshowers
sunshowers deleted the jj-stack/work-around-x64-dist-on-arm64-windows-being-treated-as-a-cross-compile-xsutrouu branch September 27, 2026 00:16
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.

2 participants