Skip to content

Commit

Permalink
Use our own release profile to insulate from custom release profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
RossSmyth committed Feb 25, 2024
1 parent cb6c757 commit 0d0e3df
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,23 @@ version = "0.0.0"
# empty dummy, just so that things are being built
path = "lib.rs"
[profile.sysroot_release]
# While it says "inherits", we override all settings.
# This is to insulate us from any custom release profile.
# The only reason we use inherits is because it's required.
inherits = "release"
opt-level = 3
debug = false
strip = "none"
split-debuginfo = 'off'
debug-assertions = false
overflow-checks = false
lto = false
panic = 'unwind'
incremental = false
codegen-units = 16
rpath = false
{crates}
{patches}
Expand Down Expand Up @@ -374,7 +391,7 @@ path = "lib.rs"
Some(v) => v,
None => rustc_version::version_meta()?,
};

// The whole point of this crate is to build the standard library in nonstandard
// configurations, which may trip lints due to untested combinations of cfgs.
// Cargo applies --cap-lints=allow or --cap-lints=warn when handling -Zbuild-std, which we
Expand Down Expand Up @@ -426,7 +443,8 @@ path = "lib.rs"
// Run cargo.
let mut cmd = cargo;
cmd.arg(self.mode.as_str());
cmd.arg("--release");
cmd.arg("--profile");
cmd.arg("sysroot_release");
cmd.arg("--manifest-path");
cmd.arg(&manifest_file);
cmd.arg("--target");
Expand Down

0 comments on commit 0d0e3df

Please sign in to comment.