* Move most wasmtime tests into one test suite This commit moves most wasmtime tests into a single test suite which gets compiled into one executable instead of having lots of test executables. The goal here is to reduce disk space on CI, and this should be achieved by having fewer executables which means fewer copies of `libwasmtime.rlib` linked across binaries on the system. More importantly though this means that DWARF debug information should only be in one executable rather than duplicated across many. * Share more build caches Globally set `RUSTFLAGS` to `-Dwarnings` instead of individually so all build steps share the same value. * Allow some dead code in cranelift-codegen Prevents having to fix all warnings for all possible feature combinations, only the main ones which come up. * Update some debug file paths
31 lines
880 B
Rust
31 lines
880 B
Rust
use anyhow::{bail, Result};
|
|
use std::env;
|
|
use std::process::Command;
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
#[allow(dead_code)]
|
|
pub enum DwarfDumpSection {
|
|
DebugInfo,
|
|
DebugLine,
|
|
}
|
|
|
|
pub fn get_dwarfdump(obj: &str, section: DwarfDumpSection) -> Result<String> {
|
|
let dwarfdump = env::var("DWARFDUMP").unwrap_or("llvm-dwarfdump".to_string());
|
|
let section_flag = match section {
|
|
DwarfDumpSection::DebugInfo => "-debug-info",
|
|
DwarfDumpSection::DebugLine => "-debug-line",
|
|
};
|
|
let output = Command::new(&dwarfdump)
|
|
.args(&[section_flag, obj])
|
|
.output()
|
|
.expect("success");
|
|
if !output.status.success() {
|
|
bail!(
|
|
"failed to execute {}: {}",
|
|
dwarfdump,
|
|
String::from_utf8_lossy(&output.stderr),
|
|
);
|
|
}
|
|
Ok(String::from_utf8_lossy(&output.stdout).to_string())
|
|
}
|