Skip to content

temp: make pipeline point to inline experiments #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pipeline.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# These files are basically Cargo.toml dependencies, that minidump-pipeline
# will use to fetch binaries, either with `cargo install` or `cargo build`.


inlines = true
rust-mangling = "v0"

# [my-example-dep]
# # via crates.io (the default, if version not specified, uses latest):
Expand All @@ -24,16 +25,20 @@


[minidump-stackwalk]
# git = "https://github.com/rust-minidump/rust-minidump"
git = "https://github.com/Gankra/rust-minidump"
branch = "inline"
# path = "../rust-minidump/minidump-stackwalk/"

# optional! (only used when you pass --debugger)
[minidump-debugger]
# git = "https://github.com/Gankra/minidump-debugger"
features = ["inline"]
git = "https://github.com/Gankra/minidump-debugger"
branch = "inline"
# path = "../minidump-debugger/"

[dump_syms]
# git = "https://github.com/mozilla/dump_syms"
git = "https://github.com/mozilla/dump_syms"
rev = "54f9e6240e34cf17fc7dc60ac4985772e2c20001"
# path = "../dump_syms/"


Expand Down
21 changes: 19 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ struct Cli {

#[derive(Debug, Clone, Deserialize)]
struct ConfigFile {
/// Whether to pass --inlines to dump_syms (cli flag overrides this)
inlines: Option<bool>,

/// What custom `-Csymbol-mangling-version` should be passed to rustc
#[serde(rename = "rust-mangling")]
rust_mangling: Option<String>,

// Various dirs
#[serde(default = "default_run_dir")]
run_dir: String,
#[serde(default = "default_install_dir")]
Expand All @@ -52,6 +60,7 @@ struct ConfigFile {
#[serde(default = "default_report_dir")]
report_dir: String,

// Various deps
#[serde(rename = "minidump-stackwalk")]
minidump_stackwalk: Dep,
dump_syms: Dep,
Expand Down Expand Up @@ -131,6 +140,7 @@ struct BuildEnv {
dump_dir: Utf8PathBuf,
report_dir: Utf8PathBuf,
run_dir: Utf8PathBuf,
rust_mangling: Option<String>,
}

/////////////////////////////////////////////////////////
Expand Down Expand Up @@ -293,6 +303,7 @@ fn do_pipeline(cli: &Cli, config: &ConfigFile) -> Result<(), PipelineError> {
report_dir: run_dir.join(&config.report_dir),
run_dir,
_root_dir: root_dir,
rust_mangling: config.rust_mangling.clone(),
};

if env.run_dir.exists() {
Expand Down Expand Up @@ -324,13 +335,15 @@ fn do_pipeline(cli: &Cli, config: &ConfigFile) -> Result<(), PipelineError> {
println!("artifacts built!");
println!();

let default_inlines = false;
let inlines = config.inlines.unwrap_or(default_inlines) || cli.inlines;
let app_sym = do_dump_syms(
&dump_syms.installed,
app.orig_bin_path
.as_ref()
.expect("app must be rebuilt for dump_syms!"),
&env,
cli.inlines,
inlines,
)?;
let client_sym = do_dump_syms(
&dump_syms.installed,
Expand All @@ -339,7 +352,7 @@ fn do_pipeline(cli: &Cli, config: &ConfigFile) -> Result<(), PipelineError> {
.as_ref()
.expect("crash-client must be rebuilt for dump_syms!"),
&env,
cli.inlines,
inlines,
)?;
let suite = do_get_suite(&app.installed)?;

Expand Down Expand Up @@ -710,6 +723,10 @@ fn build(to_build: &str, dep: &Dep, env: &BuildEnv) -> Result<InstallOutput, Pip
if cfg!(target_os = "macos") {
rustflags.push_str(" -Csplit-debuginfo=packed");
}
if let Some(rust_mangling) = &env.rust_mangling {
use std::fmt::Write;
write!(rustflags, " -Csymbol-mangling-version={}", rust_mangling).unwrap();
}

command.env("RUSTFLAGS", rustflags);
}
Expand Down