Ensure generate-copyright is executed from the project root.

This commit is contained in:
Jonathan Pallant
2025-01-06 11:02:30 +00:00
parent f9c16997dc
commit f7f2fa540f
2 changed files with 7 additions and 1 deletions
@@ -218,6 +218,9 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
cmd.env("DEST_LIBSTD", &dest_libstd);
cmd.env("OUT_DIR", &builder.out);
cmd.env("CARGO", &builder.initial_cargo);
// it is important that generate-copyright runs from the root of the
// source tree, because it uses relative paths
cmd.current_dir(&builder.src);
cmd.run(builder);
vec![dest, dest_libstd]
+4 -1
View File
@@ -8,7 +8,10 @@
/// The entry point to the binary.
///
/// You should probably let `bootstrap` execute this program instead of running it directly.
/// You should probably let `bootstrap` execute this program instead of running
/// it directly. It assumes that the current working directory is the root of a
/// Rust git repository checkout, and constructs a bunch of relative paths based
/// on that assumption.
///
/// Run `x.py run generate-copyright`
fn main() -> Result<(), Error> {