Skip to content

Commit

Permalink
More debug prints for hash stamp invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Apr 20, 2024
1 parent 3bb4fd6 commit 5995003
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,12 @@ impl HashStamp {

fn is_done(&self) -> bool {
match fs::read(&self.path) {
Ok(h) => self.hash.as_deref().unwrap_or(b"") == h.as_slice(),
Ok(h) => {
let unwrapped = self.hash.as_deref().unwrap_or(b"");
let res = unwrapped == h.as_slice();
eprintln!("Result for {:?}: {res:?} for expected '{unwrapped:?}' and read '{h:?}'", self.path);
res
},
Err(e) if e.kind() == io::ErrorKind::NotFound => false,
Err(e) => {
panic!("failed to read stamp file `{}`: {}", self.path.display(), e);
Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,11 @@ pub fn generate_smart_stamp_hash(dir: &Path, additional_input: &str) -> String {
hasher.update(status);
hasher.update(additional_input);

hex_encode(hasher.finalize().as_slice())
let result = hex_encode(hasher.finalize().as_slice());

eprintln!("Final hash: {result:?}");

result
}

/// Ensures that the behavior dump directory is properly initialized.
Expand Down

0 comments on commit 5995003

Please sign in to comment.