1. 38
    1. 2

      My biggest problem is slow linking. Even if I only change a single file, I have to wait 5-10 seconds just for the linker. I was excited to try out faster lld linking, but none of the recommended lines worked (on x86_64-pc-windows-gnu).

      The RUSTFLAGS failed with

      error: failed to run `rustc` to learn about target-specific information
      
      Caused by:
        process didn't exit successfully: `rustc - --crate-name ___ --print=file-names "\"-C" "link-arg=-fuse-ld=lld\"" --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
        --- stderr
        error: multiple input filenames provided (first two filenames are `-` and `"-C`)
      

      Looks like there’s some escaping stuff going on when you do it on Windows.

      The Cargo.toml flags failed with unused manifest key warnings:

      warning: unused manifest key: target.x86_64-pc-windows-gnu.linker
      warning: unused manifest key: target.x86_64-unknown-linux-gnu.linker
      

      Not sure if I’m doing anything wrong or if the guide recommends things that weren’t tested at all.

      (EDIT: The tutorial is wrong. These keys have to be added to config.toml, not Cargo.toml. Now it cannot find lld but that’s already progress.)

Stories with similar links:

  1. The Rust Performance Book via teymour 7 months ago | 13 points | 2 comments