Forward target options during detection - #2825
Conversation
Preserve target selection, including response-file arguments, when running the compiler identification preprocessor probe. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes C/C++ compiler vendor detection for Clang-compatible cross-compilers by forwarding target-selection flags into the preprocessing probe used during detection (including when those flags come from @response files). This prevents detection failures when a compiler requires an explicit target to run even in -E mode.
Changes:
- Forward
--targetand-target(including joined/separated spellings) into the compiler detection probe. - Expand
@responsefiles during detection argument scanning so target flags provided via response files are preserved. - Add unit tests covering forwarding and normalization behavior for
--target/-target, including response-file input.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2825 +/- ##
===========================================
- Coverage 76.22% 28.27% -47.95%
===========================================
Files 72 71 -1
Lines 39890 36761 -3129
===========================================
- Hits 30406 10396 -20010
- Misses 9484 26365 +16881 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
please fix the conflict |
…rd-target-options
Done, thank you Accidentally done in 2 pushes. Sorry about that and the extra CI time/cost consumed |
Compiler identification runs a preprocessing probe without preserving target selection. Clang-compatible cross-compilers that require an explicit target can therefore fail detection before a compilation is considered for caching.
Forward GNU/Clang
--targetand-targetoptions into the detection probe, including values supplied through response files. Normalize single-dash-targetto the separated form accepted by standard Clang and add coverage for all joined and separated forms.This change was primarily made to fix an assumed regression in v0.17 where informing SCcache that
ARM-ClangwasClang-likewas now failingGitHub copilot was used for the debugging and resolution of this issue.