Skip to content

Commit 8043910

Browse files
committed
Do not strip artifacts when DEBUGMOZJS
Signed-off-by: sagudev <[email protected]>
1 parent dbdd39b commit 8043910

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

mozjs-sys/build.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -888,19 +888,21 @@ fn compress_static_lib(build_dir: &Path) -> Result<(), std::io::Error> {
888888
&mut File::open(build_dir.join("gluebindings.rs")).unwrap(),
889889
)?;
890890
} else {
891-
let strip_bin = get_cc_rs_env_os("STRIP").unwrap_or_else(|| "strip".into());
892-
// Strip symbols from the static binary since it could bump up to 1.6GB on Linux.
893-
// TODO: Maybe we could separate symbols for thos who still want the debug ability.
894-
// https://github.com/GabrielMajeri/separate-symbols
895-
let mut strip = Command::new(strip_bin);
896-
if !target.contains("apple") {
897-
strip.arg("--strip-debug");
898-
};
899-
let status = strip
900-
.arg(build_dir.join("js/src/build/libjs_static.a"))
901-
.status()
902-
.unwrap();
903-
assert!(status.success());
891+
if env::var_os("CARGO_FEATURE_DEBUGMOZJS").is_none() {
892+
let strip_bin = get_cc_rs_env_os("STRIP").unwrap_or_else(|| "strip".into());
893+
// Strip symbols from the static binary since it could bump up to 1.6GB on Linux.
894+
// TODO: Maybe we could separate symbols for thos who still want the debug ability.
895+
// https://github.com/GabrielMajeri/separate-symbols
896+
let mut strip = Command::new(strip_bin);
897+
if !target.contains("apple") {
898+
strip.arg("--strip-debug");
899+
};
900+
let status = strip
901+
.arg(build_dir.join("js/src/build/libjs_static.a"))
902+
.status()
903+
.unwrap();
904+
assert!(status.success());
905+
}
904906

905907
// This is the static library of spidermonkey.
906908
tar.append_file(

0 commit comments

Comments
 (0)