Skip to content

shared target dir not fully working #2746

@rphmeier

Description

@rphmeier

cc #1657

I have a directory structure like this

project/
| Cargo.toml
| .cargo/
| |  config
|
| src/
| | main.rs
|
| subcrate1/
| | Cargo.toml
| | build.rs
| | src/
| | | lib.rs
|
| target/

.cargo/config:

[build]
target-dir = "./target" # it wouldn't build at all with just "target"

So we have a lot of dependencies that are shared between these crates, and it would greatly increase our travis testing times to not recompile all the dependencies for each subcrate. However, when I cd into a subcrate and run cargo build, it builds the dependencies into both the "shared" target directory and the local target directory. If I then go into another subcrate and type cargo build, it rebuilds all of the dependencies even though they are already compiled in the shared target dir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions