Skip to content

Commit

Permalink
hash all cicc inputs now that file names are deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Aug 12, 2024
1 parent aff0d27 commit 92c2a89
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/compiler/cicc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,30 @@ where
take_next = false;
&mut common_args
},
Some(Output(o)) => {
take_next = false;
let path = cwd.join(o);
outputs.insert("obj", ArtifactDescriptor { path, optional: false });
continue
},
Some(Unhashed(_)) => {
take_next = false;
&mut unhashed_args
},
Some(UnhashedInput(o)) => {
Some(ExtraInput(o)) => {
take_next = false;
let path = cwd.join(o);
extra_inputs.push(path);
&mut unhashed_args
&mut common_args
}
Some(UnhashedOutput(o)) => {
Some(ExtraOutput(o)) => {
take_next = false;
let path = cwd.join(o);
if let Some(flag) = arg.flag_str() {
outputs.insert(flag, ArtifactDescriptor { path, optional: false });
}
&mut unhashed_args
&mut common_args
}
Some(Output(o)) => {
take_next = false;
let path = cwd.join(o);
outputs.insert("obj", ArtifactDescriptor { path, optional: false });
continue
},
Some(Unhashed(_)) => {
take_next = false;
&mut unhashed_args
},
None => match arg {
Argument::Raw(ref p) => {
if take_next {
Expand Down Expand Up @@ -274,20 +274,19 @@ pub fn generate_compile_commands(

ArgData! { pub
Output(PathBuf),
ExtraInput(PathBuf),
ExtraOutput(PathBuf),
PassThrough(OsString),
Unhashed(OsString),
UnhashedInput(PathBuf),
UnhashedOutput(PathBuf),
}

use self::ArgData::*;

counted_array!(pub static ARGS: [ArgInfo<ArgData>; _] = [
// These are always randomly generated/different between nvcc invocations
take_arg!("--gen_c_file_name", PathBuf, Separated, UnhashedOutput),
take_arg!("--gen_device_file_name", PathBuf, Separated, UnhashedOutput),
take_arg!("--gen_c_file_name", PathBuf, Separated, ExtraOutput),
take_arg!("--gen_device_file_name", PathBuf, Separated, ExtraOutput),
take_arg!("--include_file_name", OsString, Separated, PassThrough),
take_arg!("--module_id_file_name", PathBuf, Separated, UnhashedInput),
take_arg!("--stub_file_name", PathBuf, Separated, UnhashedOutput),
take_arg!("--module_id_file_name", PathBuf, Separated, ExtraInput),
take_arg!("--stub_file_name", PathBuf, Separated, ExtraOutput),
take_arg!("-o", PathBuf, Separated, Output),
]);

0 comments on commit 92c2a89

Please sign in to comment.