Skip to content

Commit

Permalink
ci: use semicolons for path separation on Windows (#10266)
Browse files Browse the repository at this point in the history
The new assembler uses `:` to separate a list of paths containing
generated code. We received a report that on Windows this could lead to
build issues; this change uses `;` for Windows instead.

prtest:full
  • Loading branch information
abrown authored Feb 21, 2025
1 parent 253579a commit d270ccb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cranelift/assembler-x64/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ fn main() {
meta::generate_isle_definitions(out_dir.join("assembler-definitions.isle")),
];

#[cfg(not(target_os = "windows"))]
const SEPARATOR: &str = ":";
#[cfg(target_os = "windows")]
const SEPARATOR: &str = ";";
println!(
"cargo:rustc-env=ASSEMBLER_BUILT_FILES={}",
built_files
.iter()
.map(|p| p.to_string_lossy().to_string())
.collect::<Vec<_>>()
.join(":")
.join(SEPARATOR)
);
}
6 changes: 5 additions & 1 deletion cranelift/assembler-x64/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ pub use rex::RexFlags;

/// List the files generated to create this assembler.
pub fn generated_files() -> Vec<std::path::PathBuf> {
#[cfg(not(target_os = "windows"))]
const SEPARATOR: char = ':';
#[cfg(target_os = "windows")]
const SEPARATOR: char = ';';
env!("ASSEMBLER_BUILT_FILES")
.split(':')
.split(SEPARATOR)
.map(std::path::PathBuf::from)
.collect()
}

0 comments on commit d270ccb

Please sign in to comment.