-
Notifications
You must be signed in to change notification settings - Fork 13k
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
centralize build stamp logic #135281
base: master
Are you sure you want to change the base?
centralize build stamp logic #135281
Conversation
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
rustbot has assigned @albertlarsan68. Use |
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. |
Signed-off-by: onur-ozkan <[email protected]>
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. |
Signed-off-by: onur-ozkan <[email protected]>
(This would close #134962) |
Funny that I haven't even seen it... |
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
f6d3c02
to
51fd08e
Compare
|
I'll review this tmrw, I wanted to do some more manual local testing just in case. I had a brief glance at the changes, and I must say this is much easier to follow. So thank you for cleaning this up! |
"prefix can not start or end with '.'" | ||
); | ||
|
||
let stamp_filename = self.path.components().last().unwrap().as_os_str().to_str().unwrap(); |
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.
/// Creates a new `BuildStamp` for a given directory. | ||
/// | ||
/// By default, stamp will be an empty file named `.stamp` within the specified directory. | ||
pub fn new(dir: &Path) -> Self { | ||
Self { path: dir.join(".stamp"), stamp: String::new() } | ||
} |
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.
Expecting directory, so maybe assert that it is directory?
Maybe add single constructor like Hmm, ok, multiple calls to with_prefix is used. |
let stamp = out_dir.join("llvm-finished-building"); | ||
let stamp = HashStamp::new(stamp, Some(smart_stamp_hash)); | ||
let stamp = BuildStamp::new(&out_dir).with_prefix("llvm").with_stamp(smart_stamp_hash); |
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.
Stamp names mentioned in docs https://github.com/search?q=repo%3Arust-lang%2Frust+%22finished-building%22&type=code so need to do something with that.
run_cargo( | ||
builder, | ||
cargo, | ||
builder.config.free_args.clone(), | ||
&libstd_stamp(builder, compiler, target), | ||
vec![], | ||
true, | ||
false, | ||
); | ||
|
||
let stamp = build_stamp::libstd_stamp(builder, compiler, target).with_prefix("check"); | ||
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false); |
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.
Changes in 7b72325 for check.rs will somehow mangle prefix names?
Before: .libstd-check-stamp
After: .check-libstd-stamp
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.
I did this intentionally to keep it simple by avoiding the need to duplicate similar functions. I assume this rename shouldn't cause any issues. Maybe, at worst, it might require running x clean
after pulling these changes to remove old build artifacts.
Missing stamp refactor for lld: rust/src/bootstrap/src/core/build_steps/llvm.rs Lines 1019 to 1022 in b6b8361
|
This PR brings all the stamp file handling into one place inside
build_stamp
module, which takes care of everything related to build stamps. By doing this, we cut down on duplicated code and types and keep the codebase easier to maintain and more consistent.Main goals are:
Path
s around and manuallyjoin
on arbitrary directoriesResolves #134962