Unverified Commit 7a0d898a authored by Winter's avatar Winter Committed by GitHub
Browse files

buildRustCrate: remap rustc store path to break rust-src closure leak (#502714)

parents 3b9b472d e85060f5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -32,6 +32,12 @@ let
    (if release then "-C opt-level=3" else "-C debuginfo=2")
    "-C codegen-units=${toString codegenUnits}"
    "--remap-path-prefix=$NIX_BUILD_TOP=/"
    # When the rust-src component is present (common with rust-overlay
    # toolchains), rustc unvirtualises libstd source paths. Panic
    # locations from monomorphised generic std code then embed the
    # toolchain store path in .rodata, pulling the entire toolchain into
    # the closure. Remap to a stable placeholder to break the reference.
    "--remap-path-prefix=${rustc}=/rustc"
    (mkRustcDepArgs dependencies crateRenames)
    (mkRustcFeatureArgs crateFeatures)
  ]