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: add platform fallback win-64 for win-arm64 #2427

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/project/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,25 @@ impl<'p> Environment<'p> {
return Platform::Osx64;
}

// If the current platform is win-arm64 and the environment supports win-64,
// return win-64.
if current.is_windows() && self.platforms().contains(&Platform::Win64) {
WARN_ONCE.call_once(|| {
let warn_folder = self.project.pixi_dir().join(consts::ONE_TIME_MESSAGES_DIR);
let emulation_warn = warn_folder.join("windows-emulation-warn");
if !emulation_warn.exists() {
tracing::warn!(
"win-arm64 is not supported by the pixi.toml, falling back to win-64 (emulation)"
);
// Create a file to prevent the warning from showing up multiple times. Also ignore the result.
fs::create_dir_all(warn_folder).and_then(|_| {
std::fs::File::create(emulation_warn)
}).ok();
}
});
return Platform::Win64;
}

if self.platforms().len() == 1 {
// Take the first platform and see if it is a WASM one.
if let Some(platform) = self.platforms().iter().next() {
Expand Down
Loading