Skip to content

Forward target options during detection - #2825

Open
Joldiges wants to merge 3 commits into
mozilla:mainfrom
Joldiges:upstream/forward-target-options
Open

Forward target options during detection#2825
Joldiges wants to merge 3 commits into
mozilla:mainfrom
Joldiges:upstream/forward-target-options

Conversation

@Joldiges

@Joldiges Joldiges commented Aug 27, 2026

Copy link
Copy Markdown

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 --target and -target options into the detection probe, including values supplied through response files. Normalize single-dash -target to 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-Clang was Clang-like was now failing

GitHub copilot was used for the debugging and resolution of this issue.

JamesOldigesOther and others added 2 commits August 27, 2026 03:32
Preserve target selection, including response-file arguments, when running the compiler identification preprocessor probe.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Joldiges Joldiges changed the title tasking: support compiler option files Forward target options during detection Aug 27, 2026
@Joldiges
Joldiges marked this pull request as ready for review August 27, 2026 09:36
Copilot AI lite review requested due to automatic review settings August 27, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --target and -target (including joined/separated spellings) into the compiler detection probe.
  • Expand @response files 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.

@Joldiges
Joldiges marked this pull request as draft August 27, 2026 21:00
@Joldiges
Joldiges marked this pull request as ready for review August 28, 2026 15:24
@codecov-commenter

codecov-commenter commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.11%. Comparing base (8ab3926) to head (3dac588).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2825      +/-   ##
==========================================
- Coverage   73.71%   70.11%   -3.61%     
==========================================
  Files          72       72              
  Lines       37932    37966      +34     
==========================================
- Hits        27963    26620    -1343     
- Misses       9969    11346    +1377     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants