Skip to content

Cache libstd artifacts between projects #84

@jyn514

Description

@jyn514

Right now, cargo rebuilds std for each target directory:

; cargo build -Z build-std --target x86_64-unknown-linux-gnu
   Compiling compiler_builtins v0.1.91
   Compiling core v0.0.0 (/home/jyn/.local/lib/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
...
   Compiling inner v0.1.0 (/home/jyn/src/example/inner)
    Finished dev [unoptimized + debuginfo] target(s) in 8.43s
; cd ..
; c b -Z build-std --target x86_64-unknown-linux-gnu
   Compiling compiler_builtins v0.1.91
   Compiling core v0.0.0 (/home/jyn/.local/lib/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
...
   Compiling inner v0.1.0 (/home/jyn/src/example/inner)
   Compiling example v0.1.0 (/home/jyn/src/example)
    Finished dev [unoptimized + debuginfo] target(s) in 8.63s

It would be nice to cache this (in CARGO_HOME/.cargo?) so that it's not duplicated. This should follow all of cargo's normal caching rules, so e.g. changing RUSTFLAGS or profile.dev.debug would rebuild.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-needs-designStatus: needs design workplan before stabilizationThis needs a plan for how to address before stabilization, but does not need to be implemented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions