Starlarkify declare_compile_output_file and declare_other_output_file#758
Starlarkify declare_compile_output_file and declare_other_output_file#758dzbarsky wants to merge 2 commits into
Conversation
Declare compile outputs as shareable artifacts under the package _objs directory using the rule context. Remove the redundant configuration arguments from _get_compile_output_file and its callers.
Declare per-object debug and ThinLTO indexing outputs beside the object file with actions.declare_file. This preserves the object file parent directory without calling the native helper.
lilygorsheneva
left a comment
There was a problem hiding this comment.
I ran into LTO issues when trying to change declare_other_output_file; curious to see if this will run into the same issues; approving for internal testing.
Internal testing shows "CppLTOIndexing failed post-execution validation" errors; I'll see if I can reproduce it in the LTO tests in this repo. Failure in LTO tests migrated from Java (merged today) https://buildkite.com/bazel/google-rules-cc-presubmit/builds/2539/canvas?jid=019f14e4-33c3-49b2-ba62-84ca63afcff2&tab=output |
cool i'll rebase and take a look |
|
I'm not yet sure why tests/integration/lto_tests.sh isn't catching these validation errors. |
|
Looks like the validation issues all happen in paths that nest LTO and _objs subdirectories (via a rule I haven't found an external equivalent of yet) |
Summary
Replace
_cc_internal.declare_compile_output_fileand_cc_internal.declare_other_output_filewith Starlark output declarations. Compile outputs are declared as shareable artifacts at<package>/_objs/<label.name>/<output_name>, while.dwoand ThinLTO indexing outputs are declared beside their object files withactions.declare_file(..., sibling = object_file).The rule context already provides the configuration used by every caller, so this also removes redundant
configurationarguments from_get_compile_output_file,_maybe_declare_dotd_file,_maybe_declare_diagnostics_file,_maybe_declare_gcno_file, and their callers.