mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
try to strip prefix via string
This commit is contained in:
parent
e74ff3f50a
commit
c556d96772
2 changed files with 5 additions and 8 deletions
|
@ -1208,18 +1208,12 @@ fn link_wasm32(
|
|||
// include wasi libc
|
||||
// using `-lc` is broken in zig 8 (and early 9) in combination with ReleaseSmall
|
||||
wasi_libc_path.to_str().unwrap(),
|
||||
&format!(
|
||||
"-femit-bin={}",
|
||||
output_path.display().to_string().trim_start_matches(r"\\?")
|
||||
),
|
||||
&format!("-femit-bin={}", output_path.display()),
|
||||
"-target",
|
||||
"wasm32-wasi-musl",
|
||||
"--pkg-begin",
|
||||
"str",
|
||||
zig_str_path
|
||||
.display()
|
||||
.to_string()
|
||||
.trim_start_matches(r"\\?"),
|
||||
&zig_str_path.display().to_string(),
|
||||
"--pkg-end",
|
||||
"--strip",
|
||||
"-O",
|
||||
|
|
|
@ -107,6 +107,9 @@ pub fn get_lib_path() -> Option<PathBuf> {
|
|||
let exe_relative_str_path_opt = std::env::current_exe().ok();
|
||||
|
||||
if let Some(exe_relative_str_path) = exe_relative_str_path_opt {
|
||||
let strip_windows_prefix = exe_relative_str_path.display().to_string();
|
||||
let exe_relative_str_path =
|
||||
std::path::Path::new(strip_windows_prefix.trim_start_matches(r"\\?\"));
|
||||
let mut curr_parent_opt = exe_relative_str_path.parent();
|
||||
|
||||
// this differs for regular build and nix releases, so we check in multiple spots.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue