Skip to content

Fix build issue for wslsettings, and add more logging to the pipelines#40388

Open
florelis wants to merge 5 commits intomasterfrom
user/florch/wslsettingsbuild
Open

Fix build issue for wslsettings, and add more logging to the pipelines#40388
florelis wants to merge 5 commits intomasterfrom
user/florch/wslsettingsbuild

Conversation

@florelis
Copy link
Copy Markdown
Member

@florelis florelis commented May 1, 2026

Summary of the Pull Request

Fixes the recurring build error

CSC : error CS0016: Could not write to output file 'C:\__w\1\s\src\windows\wslsettings\obj\x64\Release\generated\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WslSettings.Views.Settings.AboutPage.WinRTVtable.g.cs' -- 'Could not find a part of the path 'C:\__w\1\s\src\windows\wslsettings\obj\x64\Release\generated\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WslSettings.Views.Settings.AboutPage.WinRTVtable.g.cs'.' [C:\__w\1\s\src\windows\wslsettings\wslsettings.csproj]

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

The build often fails when attempting to write auto-generated source files related to WinUI in wslsettings. The failure seems to happen because the directory for those files does not exist when trying to create the file. These generated files are usually compiled in memory, but on official builds CodeQL forces them to be written to disk for analysis by setting the MSBuild property EmitCompilerGeneratedFiles=true. MSBuild usually ensures that the directory exists with the CreateCompilerGeneratedFilesOutputPath target which is configured to run before the CoreCompile target. However, the WinUI auto-generated files are created in the XamlPreCompile target, which does not have a dependency on CreateCompilerGeneratedFilesOutputPath, so it is not guaranteed to run after it.

The fix for the build failure is to add a target that ensures the directory exists before XamlPreCompile runs.

This PR also sets MSBuild to output binlogs to the pipeline artifacts to make it easier to debug pipeline failures in the future.

Validation Steps Performed

Copilot AI review requested due to automatic review settings May 1, 2026 22:19
@florelis florelis requested a review from a team as a code owner May 1, 2026 22:19

This comment was marked as resolved.

@florelis florelis force-pushed the user/florch/wslsettingsbuild branch from d1e0aba to 6ce31d3 Compare May 4, 2026 18:49
Comment thread .pipelines/build-job.yml Outdated

- ${{ each target in parameters.targets }}:
- script: cmake --build . --config Release --target ${{ target.target }} -- -m
- script: cmake --build . --config Release --target ${{ target.target }} --verbose -- -m /bl:$(ob_outputDirectory)\binlogs\${{ parameters.platform }}-1.binlog
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's true for CI builds, but release builds actually run this multiple times (so each stage can sign before packaging).

I think the suggestion of appending the target names is a good idea to avoid overwriting the binlog

Comment thread .pipelines/build-job.yml Outdated
Copilot AI review requested due to automatic review settings May 4, 2026 23:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .pipelines/build-job.yml Outdated
Copilot AI review requested due to automatic review settings May 4, 2026 23:32

This comment was marked as resolved.

Comment thread .pipelines/build-job.yml

- ${{ each target in parameters.targets }}:
- script: cmake --build . --config Release --target ${{ target.target }} -- -m
- script: cmake --build . --config Release --target ${{ target.target }} -- -m /bl:$(ob_outputDirectory)\binlogs\${{ parameters.platform }}-1.binlog
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should prepend the target names to the binlog paths so this task doesn't overwrite the previous binlogs.

We could use something like this:

$[replace('${{ target.target }}', ';', '-')]

To get rid of the special characters

Or simplify the names via something like:

 ${{ split('${{ target.target }}', ';')[0] 

And just use the first executable in the target list

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