Skip to content

Conversation

@exoosh
Copy link
Contributor

@exoosh exoosh commented Nov 7, 2025

This reintroduces #1835 (FYI: @AudranDoublet). Copying the details over here:


VS_UNICODE_OUTPUT is set by Visual Studio to a value that tells MS tools running from within the IDE where to send their output. Thus, cl.exe invocation used to retrieve the /showIncludes prefix returns an empty output when this variable is set to a valid value.

The proposed fix is to use /E option that tells cl.exe to output file content in stdout and retrieved headers in stderr. When set, cl.exe ignores the value of VS_UNICODE_OUTPUT.

Another fix could be to explicitly unset VS_UNICODE_OUTPUT in the command invocation.

#1830 #909 mentioning these issues as it may fix them.

MSBuild may provide as output file (/Fo) plus a folder ending with a
trailing backslash, for example /FoRelease\.

msvc detects this case and chooses {folder}/{input_file_name}.obj as
output file. For example, for /cfoo.c /FoRelease\, the expected output
path (by linker and msbuild) is Release/foo.obj.

Fixes mozilla#1687 mozilla#1844.
@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.87%. Comparing base (764daee) to head (2f2e1f9).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler/msvc.rs 0.00% 23 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (764daee) and HEAD (2f2e1f9). Click for more details.

HEAD has 10 uploads less than BASE
Flag BASE (764daee) HEAD (2f2e1f9)
11 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2483       +/-   ##
===========================================
- Coverage   71.14%   27.87%   -43.27%     
===========================================
  Files          64       54       -10     
  Lines       35207    33494     -1713     
===========================================
- Hits        25047     9338    -15709     
- Misses      10160    24156    +13996     

☔ View full report in Codecov by Sentry.
📢 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.

@exoosh
Copy link
Contributor Author

exoosh commented Nov 7, 2025

Trying to tend to the failed checks. It also turns out that this fix does not address #1830 for me on VS2022 with cl.exe 19.43.34810, @AudranDoublet.

But your finding certainly is an excellent starting point for me to investigate further.

@exoosh exoosh force-pushed the bug/msvc/detect-showIncludes-fail_VS_UNICODE_OUTPUT branch from 5b3675f to c28a5aa Compare November 10, 2025 13:46
@exoosh exoosh force-pushed the bug/msvc/detect-showIncludes-fail_VS_UNICODE_OUTPUT branch from c28a5aa to 0259e04 Compare November 10, 2025 16:14
@exoosh
Copy link
Contributor Author

exoosh commented Nov 10, 2025

Will rebase against main before this comes out of draft. Currently I rebased #2482 against main and added this change on top. The result seems to be a usable sccache.exe from the VS IDE.

@exoosh exoosh force-pushed the bug/msvc/detect-showIncludes-fail_VS_UNICODE_OUTPUT branch from 0259e04 to e2c6d31 Compare November 10, 2025 16:33
@exoosh exoosh force-pushed the bug/msvc/detect-showIncludes-fail_VS_UNICODE_OUTPUT branch from e2c6d31 to 2f2e1f9 Compare November 10, 2025 17:45
@sylvestre
Copy link
Collaborator

most of the jobs are failing

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.

3 participants