Skip to content

Sync Csc invocations from CoreCompile to XamlPreCompile#9786

Merged
rainersigwald merged 2 commits intodotnet:mainfrom
rainersigwald:sync-xamlprecompile
Aug 22, 2024
Merged

Sync Csc invocations from CoreCompile to XamlPreCompile#9786
rainersigwald merged 2 commits intodotnet:mainfrom
rainersigwald:sync-xamlprecompile

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

@rainersigwald rainersigwald commented Feb 26, 2024

The Csc task invocation in XamlPreCompile has drifted from the one in CoreCompile in the Roslyn repo. I'm attempting to bring them back into sync.

This will fix #9785.

I did this in two parts to make future updates easier:

  • 18671e8 is a clean copy/paste of the Csc & Vbc calls from Roslyn.

  • The subsequent commit modifies them to (hopefully) have the differences we expect here.

In the future, we can update from Roslyn by syncing to caa45ead28a51cbd6322b79bec72b29102c04ce1, making a new commit of a clean update copy/paste of the task, and then merging with the subsequent edits.

@rainersigwald rainersigwald requested a review from a team February 26, 2024 18:14
Copy link
Copy Markdown
Member Author

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

@jaredpar Here are some comments on the changes I'm proposing from CoreCompile. Would love to get compiler team review on them please.

@jaredpar
Copy link
Copy Markdown
Member

@RikkiGibson, @chsienki, @jjonescz FYI

@RikkiGibson
Copy link
Copy Markdown
Member

I do not think I understand what the XamlPreCompile step is doing well enough to say which arguments can be left out or not. I would lean toward including all the same arguments from the original task invocation from Roslyn as much as possible, except for those where there is a specific detrimental effect to keeping them.

@jaredpar
Copy link
Copy Markdown
Member

@RikkiGibson part of my motivation for pinging is making you all aware that this exists. It was something I was unaware of.

I would lean toward including all the same arguments from the original task invocation from Roslyn as much as possible, except for those where there is a specific detrimental effect to keeping them.

Largely agree. I'm okay with a few items like disable PDB generation but overall would keep same where possible. In cases we do change arguments would use explicit values vs. implicit defaults to make it clear the item was considered.

These are the adjustments to the standard Csc invocation that we want to
apply to this precompilation process. Most important are the
OutputAssembly adjustment (to avoid overwriting final output) and
SkipAnalyzers=true (for performance and warning deduplication).
@rainersigwald
Copy link
Copy Markdown
Member Author

Largely agree. I'm okay with a few items like disable PDB generation but overall would keep same where possible. In cases we do change arguments would use explicit values vs. implicit defaults to make it clear the item was considered.

This makes total sense and I've just tried to do so. I think it's probably best at this point to try an experimental VS with this contents and validate that we can build some WPF projects--I'll do that. Marking this as "draft" until that's done.

@rainersigwald
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rainersigwald rainersigwald marked this pull request as ready for review August 16, 2024 14:30
Copy link
Copy Markdown
Member

@YuliiaKovalova YuliiaKovalova left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Looks good.
Though I do not feel 100% qualified to assess all the csc task adjustments. More details about whythose are made might be helpful.

@rainersigwald rainersigwald merged commit 064ac2e into dotnet:main Aug 22, 2024
@rainersigwald rainersigwald deleted the sync-xamlprecompile branch August 22, 2024 13:33
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.

Error CS9137 Occurred When Building a MAUI Project Targetting to Windows

5 participants