Ensure pyoxidizer rebuilt on arch change

Fixes broken builds when switching between ARM and AMD on a Mac.
This commit is contained in:
Damien Elmes 2025-01-24 12:49:51 +11:00
parent 46310612ae
commit 06ef25755b

View file

@ -214,16 +214,20 @@ fn build_pyoxidizer(build: &mut Build) -> Result<()> {
offline_build, offline_build,
}, },
)?; )?;
let target =
overriden_rust_target_triple().unwrap_or_else(|| Platform::current().as_rust_triple());
let output_bin = format!("bundle/rust/{target}/release/pyoxidizer",);
build.add_action( build.add_action(
"bundle:pyoxidizer:bin", "bundle:pyoxidizer:bin",
CargoBuild { CargoBuild {
inputs: inputs![":bundle:pyoxidizer:repo", glob!["qt/bundle/PyOxidizer/**"]], inputs: inputs![
":bundle:pyoxidizer:repo",
"out/env",
glob!["qt/bundle/PyOxidizer/**"]
],
// can't use ::Binary() here, as we're in a separate workspace // can't use ::Binary() here, as we're in a separate workspace
outputs: &[RustOutput::Data( outputs: &[RustOutput::Data("bin", &with_exe(&output_bin))],
"bin", target: Some(target),
&with_exe("bundle/rust/release/pyoxidizer"),
)],
target: None,
extra_args: &format!( extra_args: &format!(
"--manifest-path={} --target-dir={} -p pyoxidizer", "--manifest-path={} --target-dir={} -p pyoxidizer",
"qt/bundle/PyOxidizer/Cargo.toml", "$builddir/bundle/rust" "qt/bundle/PyOxidizer/Cargo.toml", "$builddir/bundle/rust"