diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b880bfafb3..530f8941fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -400,7 +400,7 @@ jobs: submodules: true - name: Install Rust run: rustup update stable && rustup default stable - - run: cd cranelift/codegen && cargo build --features all-arch + - run: cd cranelift/codegen && cargo build --features "all-arch completely-skip-isle-for-ci-deterministic-check" - run: ci/ensure_deterministic_build.sh # Perform release builds of `wasmtime` and `libwasmtime.so`. Builds on diff --git a/cranelift/codegen/Cargo.toml b/cranelift/codegen/Cargo.toml index ae8066ac16..ba7e7488b6 100644 --- a/cranelift/codegen/Cargo.toml +++ b/cranelift/codegen/Cargo.toml @@ -104,6 +104,10 @@ souper-harvest = ["souper-ir", "souper-ir/stringify"] # Recompile ISLE DSL source files into their generated Rust code. rebuild-isle = ["isle", "cranelift-codegen-meta/rebuild-isle"] +# A hack to skip the ISLE-rebuild logic when testing for determinism +# with the "Meta deterministic check" CI job. +completely-skip-isle-for-ci-deterministic-check = [] + [badges] maintenance = { status = "experimental" } diff --git a/cranelift/codegen/build.rs b/cranelift/codegen/build.rs index a3f31c7db9..adb99386c5 100644 --- a/cranelift/codegen/build.rs +++ b/cranelift/codegen/build.rs @@ -78,7 +78,17 @@ fn main() { .unwrap() } - maybe_rebuild_isle(crate_dir).expect("Unhandled failure in ISLE rebuild"); + // The "Meta deterministic check" CI job runs this build script N + // times to ensure it produces the same output + // consistently. However, it runs the script in a fresh directory, + // without any of the source tree present; this breaks our + // manifest check (we need the ISLE source to be present). To keep + // things simple, we just disable all ISLE-related logic for this + // specific CI job. + #[cfg(not(feature = "completely-skip-isle-for-ci-deterministic-check"))] + { + maybe_rebuild_isle(crate_dir).expect("Unhandled failure in ISLE rebuild"); + } let pkg_version = env::var("CARGO_PKG_VERSION").unwrap(); let mut cmd = std::process::Command::new("git"); @@ -259,6 +269,9 @@ fn maybe_rebuild_isle( } let manifest = std::fs::read_to_string(compilation.manifest_filename())?; + // Canonicalize Windows line-endings into Unix line-endings in + // the manifest text itself. + let manifest = manifest.replace("\r\n", "\n"); let expected_manifest = compilation.compute_manifest()?; if manifest != expected_manifest { rebuild_compilations.push((compilation, expected_manifest));