File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ run! = |maybe_roc|
5151
5252 build_stub_app_lib!(roc_cmd, stub_lib_path)?
5353
54- cargo_build_host!({} )?
54+ cargo_build_host!(os_and_arch )?
5555
5656 rust_target_folder = get_rust_target_folder!({})?
5757
@@ -98,14 +98,20 @@ get_rust_target_folder! = |{}|
9898
9999 Ok (" target/release/" )
100100
101- cargo_build_host ! : {} => Result {} _
102- cargo_build_host ! = |{} |
101+ cargo_build_host ! : OSAndArch => Result {} _
102+ cargo_build_host ! = |os_and_arch |
103103
104104 info!(" Building rust host ..." )?
105105
106- Cmd . new ("cargo ")
107- |> Cmd . args (["build ", " --release" ])
108- |> Cmd . env ("RUSTFLAGS ", " -C link-arg=-Wl,-headerpad,0x1000" )
106+ cmd = Cmd . new ("cargo ") |> Cmd . args (["build ", " --release" ])
107+
108+ # Apply RUSTFLAGS only on macOS x64 to fix "Not enough free space" linker error
109+ cmd_with_flags =
110+ when os_and_arch is
111+ MacosX64 -> cmd |> Cmd . env ("RUSTFLAGS ", " -C link-arg=-Wl,-headerpad,0x1000" )
112+ _ -> cmd
113+
114+ cmd_with_flags
109115 |> Cmd . exec_cmd !()
110116 |> Result . map_err (ErrBuildingHostBinaries )
111117
You can’t perform that action at this time.
0 commit comments