Skip to content

Commit e21eb61

Browse files
Remove support for different src directory
This requires that bootstrap is run from the same worktree as the sources it'll build, but this is basically required for the build to work anyway. You can still run it from a different directory, just that the files it builds must be beside it.
1 parent 6d19561 commit e21eb61

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/bootstrap/bootstrap.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,6 @@ def bootstrap(help_triggered):
966966
parser = argparse.ArgumentParser(description='Build rust')
967967
parser.add_argument('--config')
968968
parser.add_argument('--build')
969-
parser.add_argument('--src')
970969
parser.add_argument('--clean', action='store_true')
971970
parser.add_argument('-v', '--verbose', action='count', default=0)
972971

@@ -975,7 +974,7 @@ def bootstrap(help_triggered):
975974

976975
# Configure initial bootstrap
977976
build = RustBuild()
978-
build.rust_root = args.src or os.path.abspath(os.path.join(__file__, '../../..'))
977+
build.rust_root = os.path.abspath(os.path.join(__file__, '../../..'))
979978
build.verbose = args.verbose
980979
build.clean = args.clean
981980

@@ -1032,7 +1031,6 @@ def bootstrap(help_triggered):
10321031
args = [build.bootstrap_binary()]
10331032
args.extend(sys.argv[1:])
10341033
env = os.environ.copy()
1035-
env["SRC"] = build.rust_root
10361034
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
10371035
env["BOOTSTRAP_PYTHON"] = sys.executable
10381036
env["BUILD_DIR"] = build.build_dir

src/bootstrap/config.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ impl Config {
488488

489489
// set by bootstrap.py
490490
config.build = TargetSelection::from_user(&env!("BUILD_TRIPLE"));
491-
config.src = Config::path_from_python("SRC");
491+
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
492+
// Undo `src/bootstrap`
493+
config.src = manifest_dir.parent().unwrap().parent().unwrap().to_owned();
492494
config.out = Config::path_from_python("BUILD_DIR");
493495

494496
config.initial_rustc = Config::path_from_python("RUSTC");

0 commit comments

Comments
 (0)