Skip to content

Commit 031de01

Browse files
authored
Strip a possible -git suffix from emcc version (#2470)
Compare here: https://github.com/python/cpython/blob/main/configure.ac#L810 which just uses `cut -f1 -d-` to delete everything after the `-`. But we're only after deleting `-git`.
1 parent 2861bf1 commit 031de01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/build_context.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,10 @@ fn emcc_version() -> Result<String> {
12351235
.arg("-dumpversion")
12361236
.output()
12371237
.context("Failed to run emcc to get the version")?;
1238-
Ok(String::from_utf8(emcc.stdout)?.trim().into())
1238+
let ver = String::from_utf8(emcc.stdout)?;
1239+
let mut trimmed = ver.trim();
1240+
trimmed = trimmed.strip_suffix("-git").unwrap_or(trimmed);
1241+
Ok(trimmed.into())
12391242
}
12401243

12411244
#[cfg(test)]

0 commit comments

Comments
 (0)