-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented build.build-dir
config option
#15104
base: master
Are you sure you want to change the base?
Conversation
This is in preparation for splitting the intermediate build artifacts from the `target` directory.
This commit adds a `build_dir` option to the `build` table in `config.toml` and adds the equivalent field to `Workspace` and `GlobalContext`.
This commits implements the seperation of the intermidate artifact directory (called "build directory") from the target directory. (see rust-lang#14125)
build.build-dir
config option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to make sure I didn't miss something. From what I can tell these directories/files have been removed right?
target/<profile>/.metabuild
target/<profile>/.fingerprint
target/<profile>/deps
target/<profile>/incremental
target/<profile>/build
target/.cargo-lock
target/tmp
target/.rustc_info.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually add some tests verifying a nightly flag is really gated.
@@ -290,7 +290,9 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> { | |||
}); | |||
} | |||
|
|||
super::output_depinfo(&mut self, unit)?; | |||
if !self.bcx.gctx.cli_unstable().build_dir { | |||
super::output_depinfo(&mut self, unit)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we stop generating this when build-dir
is enabled?
(still a work in progress)
What does this PR try to resolve?
This PR adds a new
build.build-dir
configuration option that was proposed in #14125 (comment)This new config option allows the user to specify a directory where intermediate build artifacts should be stored.
I have shortened it to just
build-dir
fromtarget-build-dir
, although naming is still subject to change.How should we test and review this PR?
This is probably best reviewed commit by commit. I document each commit.
I tied to follow the atomic commits recommendation in the Cargo contributors guide, but I split out some commits for ease of review. (Otherwise I think this would have ended up being 1 or 2 large commits 😅)
Questions
cargo clean
?target
and does not impact the build-dir but this is easily changable.cargo package
are was expecting just the.crate
file to be intarget
while all other output be stored inbuild.build-dir
? Not sure if we consider things likeCargo.toml
,Cargo.toml.orig
,.cargo_vcs_info.json
part of the user facing interface.TODO
build.build-dir