Fix compression tests in QEMU cross-compilation environments (#3248)
Some checks failed
ci / test (macos, macos-latest, nightly) (push) Waiting to run
ci / test (stable-arm-musleabi, ubuntu-latest, stable, armv7-unknown-linux-musleabi) (push) Waiting to run
ci / test (stable-powerpc64, ubuntu-latest, stable, powerpc64-unknown-linux-gnu) (push) Waiting to run
ci / test (stable-riscv64, ubuntu-latest, stable, riscv64gc-unknown-linux-gnu) (push) Waiting to run
ci / test (stable-s390x, ubuntu-latest, stable, s390x-unknown-linux-gnu) (push) Waiting to run
ci / test (stable-x86, ubuntu-latest, stable, i686-unknown-linux-gnu) (push) Waiting to run
ci / test (win-gnu, windows-latest, nightly-x86_64-gnu) (push) Waiting to run
ci / test (win-msvc, windows-latest, nightly) (push) Waiting to run
ci / test (winaarch64-msvc, windows-11-arm, nightly) (push) Waiting to run
ci / wasm (push) Waiting to run
ci / rustfmt (push) Waiting to run
ci / docs (push) Waiting to run
ci / Compile Fuzz Test Targets (push) Waiting to run
ci / test (beta, ubuntu-latest, beta) (push) Failing after 1h39m58s
ci / test (nightly, ubuntu-latest, nightly) (push) Successful in 45m17s
ci / test (pinned, ubuntu-latest, 1.85.0) (push) Successful in 13m40s
ci / test (stable, ubuntu-latest, stable) (push) Successful in 2m43s
ci / test (stable-arm-gnueabihf, ubuntu-latest, stable, armv7-unknown-linux-gnueabihf) (push) Failing after 1h24m6s
ci / test (stable-aarch64, ubuntu-latest, stable, aarch64-unknown-linux-gnu) (push) Failing after 2h27m18s
ci / test (stable-arm-musleabihf, ubuntu-latest, stable, armv7-unknown-linux-musleabihf) (push) Failing after 15m14s
ci / test (stable-musl, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Failing after 3s
Some checks failed
ci / test (macos, macos-latest, nightly) (push) Waiting to run
ci / test (stable-arm-musleabi, ubuntu-latest, stable, armv7-unknown-linux-musleabi) (push) Waiting to run
ci / test (stable-powerpc64, ubuntu-latest, stable, powerpc64-unknown-linux-gnu) (push) Waiting to run
ci / test (stable-riscv64, ubuntu-latest, stable, riscv64gc-unknown-linux-gnu) (push) Waiting to run
ci / test (stable-s390x, ubuntu-latest, stable, s390x-unknown-linux-gnu) (push) Waiting to run
ci / test (stable-x86, ubuntu-latest, stable, i686-unknown-linux-gnu) (push) Waiting to run
ci / test (win-gnu, windows-latest, nightly-x86_64-gnu) (push) Waiting to run
ci / test (win-msvc, windows-latest, nightly) (push) Waiting to run
ci / test (winaarch64-msvc, windows-11-arm, nightly) (push) Waiting to run
ci / wasm (push) Waiting to run
ci / rustfmt (push) Waiting to run
ci / docs (push) Waiting to run
ci / Compile Fuzz Test Targets (push) Waiting to run
ci / test (beta, ubuntu-latest, beta) (push) Failing after 1h39m58s
ci / test (nightly, ubuntu-latest, nightly) (push) Successful in 45m17s
ci / test (pinned, ubuntu-latest, 1.85.0) (push) Successful in 13m40s
ci / test (stable, ubuntu-latest, stable) (push) Successful in 2m43s
ci / test (stable-arm-gnueabihf, ubuntu-latest, stable, armv7-unknown-linux-gnueabihf) (push) Failing after 1h24m6s
ci / test (stable-aarch64, ubuntu-latest, stable, aarch64-unknown-linux-gnu) (push) Failing after 2h27m18s
ci / test (stable-arm-musleabihf, ubuntu-latest, stable, armv7-unknown-linux-musleabihf) (push) Failing after 15m14s
ci / test (stable-musl, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Failing after 3s
* tests: fix cmd_exists for QEMU environments QEMU user-mode has a bug where posix_spawn returns success even when the command doesn't exist. The child exits with 127, but the parent thinks it succeeded. Change cmd_exists to check if the command actually ran successfully (exit code 0), not just if spawn returned Ok. This fixes compression tests on riscv64 and other QEMU-emulated architectures. Ref https://github.com/rust-lang/rust/issues/90825 * tests: remove riscv64 skip for compression tests Remove the cfg guards that disabled lz4, brotli, and zstd tests on riscv64. These now work with the QEMU fix.
This commit is contained in:
@@ -922,8 +922,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
|||||||
eqnice!(expected, cmd.stdout());
|
eqnice!(expected, cmd.stdout());
|
||||||
});
|
});
|
||||||
|
|
||||||
// lz4 decompression tool doesn't work under RISC-V QEMU emulation in CI
|
|
||||||
#[cfg(not(target_arch = "riscv64"))]
|
|
||||||
rgtest!(compressed_lz4, |dir: Dir, mut cmd: TestCommand| {
|
rgtest!(compressed_lz4, |dir: Dir, mut cmd: TestCommand| {
|
||||||
if !cmd_exists("lz4") {
|
if !cmd_exists("lz4") {
|
||||||
return;
|
return;
|
||||||
@@ -954,8 +952,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
|||||||
eqnice!(expected, cmd.stdout());
|
eqnice!(expected, cmd.stdout());
|
||||||
});
|
});
|
||||||
|
|
||||||
// brotli decompression tool doesn't work under RISC-V QEMU emulation in CI
|
|
||||||
#[cfg(not(target_arch = "riscv64"))]
|
|
||||||
rgtest!(compressed_brotli, |dir: Dir, mut cmd: TestCommand| {
|
rgtest!(compressed_brotli, |dir: Dir, mut cmd: TestCommand| {
|
||||||
if !cmd_exists("brotli") {
|
if !cmd_exists("brotli") {
|
||||||
return;
|
return;
|
||||||
@@ -971,8 +967,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
|||||||
eqnice!(expected, cmd.stdout());
|
eqnice!(expected, cmd.stdout());
|
||||||
});
|
});
|
||||||
|
|
||||||
// zstd decompression tool doesn't work under RISC-V QEMU emulation in CI
|
|
||||||
#[cfg(not(target_arch = "riscv64"))]
|
|
||||||
rgtest!(compressed_zstd, |dir: Dir, mut cmd: TestCommand| {
|
rgtest!(compressed_zstd, |dir: Dir, mut cmd: TestCommand| {
|
||||||
if !cmd_exists("zstd") {
|
if !cmd_exists("zstd") {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ pub fn sort_lines(lines: &str) -> String {
|
|||||||
/// Returns true if and only if the given program can be successfully executed
|
/// Returns true if and only if the given program can be successfully executed
|
||||||
/// with a `--help` flag.
|
/// with a `--help` flag.
|
||||||
pub fn cmd_exists(program: &str) -> bool {
|
pub fn cmd_exists(program: &str) -> bool {
|
||||||
Command::new(program).arg("--help").output().is_ok()
|
match Command::new(program).arg("--help").output() {
|
||||||
|
Ok(output) => output.status.success(),
|
||||||
|
Err(_) => false,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dir represents a directory in which tests should be run.
|
/// Dir represents a directory in which tests should be run.
|
||||||
|
|||||||
Reference in New Issue
Block a user