Avoid fingerprint busting during builds (#4244)
* Avoid fingerprint busting during builds * delete `.fingerprint/package-hash` instead of modifying source code --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
f40f7a5aeb
commit
e477e0b485
2 files changed
+40
-14
No files matched your search
@@ -54,13 +54,23 @@ pub async fn run_rustc() {
|
||||
link_args: Default::default(),
|
||||
};
|
||||
|
||||
std::fs::create_dir_all(var_file.parent().expect("Failed to get parent dir"))
|
||||
.expect("Failed to create parent dir");
|
||||
std::fs::write(
|
||||
&var_file,
|
||||
serde_json::to_string(&rustc_args).expect("Failed to serialize rustc args"),
|
||||
)
|
||||
.expect("Failed to write rustc args to file");
|
||||
// Another terrible hack to avoid caching non-sensical args when
|
||||
// a build is completely fresh (rustc is invoked with --crate-name ___)
|
||||
if rustc_args
|
||||
.args
|
||||
.iter()
|
||||
.skip_while(|arg| *arg != "--crate-name")
|
||||
.nth(1)
|
||||
.is_some_and(|name| name != "___")
|
||||
{
|
||||
std::fs::create_dir_all(var_file.parent().expect("Failed to get parent dir"))
|
||||
.expect("Failed to create parent dir");
|
||||
std::fs::write(
|
||||
&var_file,
|
||||
serde_json::to_string(&rustc_args).expect("Failed to serialize rustc args"),
|
||||
)
|
||||
.expect("Failed to write rustc args to file");
|
||||
}
|
||||
|
||||
// Run the actual rustc command
|
||||
// We want all stdout/stderr to be inherited, so the running process can see the output
|
||||
|
||||
Reference in new issue
Block a user