Skip to content

Commit f7f2fa5

Browse files
Ensure generate-copyright is executed from the project root.
1 parent f9c1699 commit f7f2fa5

File tree

2 files changed

+7
-1
lines changed
  • src
    • bootstrap/src/core/build_steps
    • tools/generate-copyright/src

2 files changed

+7
-1
lines changed

src/bootstrap/src/core/build_steps/run.rs

+3
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ impl Step for GenerateCopyright {
218218
cmd.env("DEST_LIBSTD", &dest_libstd);
219219
cmd.env("OUT_DIR", &builder.out);
220220
cmd.env("CARGO", &builder.initial_cargo);
221+
// it is important that generate-copyright runs from the root of the
222+
// source tree, because it uses relative paths
223+
cmd.current_dir(&builder.src);
221224
cmd.run(builder);
222225

223226
vec![dest, dest_libstd]

src/tools/generate-copyright/src/main.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ mod cargo_metadata;
88

99
/// The entry point to the binary.
1010
///
11-
/// You should probably let `bootstrap` execute this program instead of running it directly.
11+
/// You should probably let `bootstrap` execute this program instead of running
12+
/// it directly. It assumes that the current working directory is the root of a
13+
/// Rust git repository checkout, and constructs a bunch of relative paths based
14+
/// on that assumption.
1215
///
1316
/// Run `x.py run generate-copyright`
1417
fn main() -> Result<(), Error> {

0 commit comments

Comments
 (0)