Skip to content

Commit

Permalink
[Feature](INF-2296) infra: fix sccache bug for dwo file generate
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouronghua committed Sep 30, 2024
1 parent 29d17c7 commit 8d3296f
Show file tree
Hide file tree
Showing 10 changed files with 5,435 additions and 1 deletion.
5,419 changes: 5,419 additions & 0 deletions log/log.txt

Large diffs are not rendered by default.

Binary file added o1/test.dwo
Binary file not shown.
Binary file added o1/test.o
Binary file not shown.
Binary file added o2/test.dwo
Binary file not shown.
Binary file added o2/test.o
Binary file not shown.
Binary file added o3/test.dwo
Binary file not shown.
Binary file added o3/test.o
Binary file not shown.
5 changes: 5 additions & 0 deletions src/compiler/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ where
// use in creating a hash key
let mut common_and_arch_args = parsed_args.common_args.clone();
common_and_arch_args.extend(parsed_args.arch_args.to_vec());
debug!(
"[{}]: common_and_arch_args: {:?}",
parsed_args.output_pretty(),
common_and_arch_args
);

let key = {
hash_key(
Expand Down
11 changes: 10 additions & 1 deletion src/compiler/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ where
};
if split_dwarf {
let dwo = output.with_extension("dwo");
common_args.push(OsString::from("-D_gsplit_dwarf_path=".to_owned() + dwo.to_str().unwrap()));
// -gsplit-dwarf doesn't guarantee .dwo file if no -g is specified
outputs.insert(
"dwo",
Expand Down Expand Up @@ -1075,6 +1076,12 @@ mod test {
CompilerArguments::Ok(args) => args,
o => panic!("Got unexpected parse result: {:?}", o),
};
let mut common_and_arch_args = common_args.clone();
common_and_arch_args.extend(common_args.to_vec());
debug!(
"common_and_arch_args: {:?}",
common_and_arch_args
);
assert_eq!(Some("foo.cpp"), input.to_str());
assert_eq!(Language::Cxx, language);
assert_map_contains!(
Expand All @@ -1095,7 +1102,9 @@ mod test {
)
);
assert!(preprocessor_args.is_empty());
assert_eq!(ovec!["-gsplit-dwarf"], common_args);
assert!(common_args.contains(&"-gsplit-dwarf".into())
&& common_args.contains(&"-D_gsplit_dwarf_path=foo.dwo".into())
);
assert!(!msvc_show_includes);
}

Expand Down
1 change: 1 addition & 0 deletions test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int test(){}

0 comments on commit 8d3296f

Please sign in to comment.