Skip to content

Is --out-dir justified or can we find another way of accomplishing it? #6100

@withoutboats

Description

@withoutboats

I noticed that cargo build has two subcommands, both added this year. I believe this accurately describes their behavior:

(I'm not 100% certain I've accurately described their behavior in relationship to the profile specific subdirectories.)

--out-dir is still unstable, but --target-dir was instantly stabilized (by mistake, I believe).

I can't help but notice that these two flags do very similar things! They also seem to have been designed for very similar purposes (build integration, the meson project is mentioned specifically in both of them).

I'm not certain I agree that either of them should have been added as flags (an argument is made that flags are better than env vars, and while I agree in principle for user oriented APIs, I don't think that build system integration is a user oriented API in the relevant sense), but I'm definitely suspicious of having both of these very similar flags provided. Since target-dir is stable, I'm not sure if there's an available avenue to unify these flags other than just only providing target-dir.

cc @rust-lang/cargo

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-out-dirNightly: --out-dir

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions