-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an opt-in AOT regression check to the CI pipeline #40629
Conversation
/azp run net - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
API change check API changes are not detected in this pull request. |
/azp run net - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
I'm excited to use this! |
Why an internal wiki and not a .md file in the repo? |
@eerhardt I should have said "the internal wiki" - all of our pipeline/release/engineering related docs are currently located in an internal wiki that is accessible to the Azure SDK team & any partner teams that utilize our repos to release. I'll get some feedback about if there's a better place for it. |
/azp run net - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the yaml looks good
This PR adds a new opt-in AOT pipeline that can be enabled in the CI pipeline. This would be paired with documentation along the lines of what I included below, which will most likely live in an internal wiki:
Enable AOT compatibility regression testing in CI pipelines
An increasing number of .NET Azure SDK libraries are committed to making their libraries compatible with native AOT. To help support this work, there is now an opt-in pipeline step called "Check for AOT compatibility regressions in [Package Name]". This pipeline creates a small sample app that uses a project reference to collect the set of trimming warnings reported for the specified library. This approach for collecting warnings is described in this article.
How to enable the pipeline for your package
Collect any expected trimming warnings
You can use any of the approaches described in the articles linked at the bottom of this document to find the warnings reported from your library. In an ideal scenario, this would be zero. However, there are cases where a library needs to baseline an expected set of warnings. Sometimes warnings are not straightforward (or are even impossible) to resolve, but are not expected to impact the majority of customer use cases. In other cases, warnings may be dependent on other work finishing first (for example, adding a net6.0 target, or upgrading a package dependency version).
The text file should be formatted with each warning on its own line. The pipeline uses pattern matching to validate warnings. This means that warnings will need to be edited to avoid using special characters incorrectly. Even though it seems easier to just do simple string matching, the errors are formatted differently depending on the environment, so using correctly formatted pattern matching makes it easier.
Example:
Actual warning:
Line in the text file:
Note: In my case, my local environment uses forward slashes in filepaths, while the pipeline uses back slashes, so using a wildcard was the easiest way to reconcile this.
Update ci.yml file
The ci.yml file needs to be updated to include the following information:
Example:
Example 2:
How to resolve trimming warnings
The following three articles provide comprehensive guidance for how to resolve trimming warnings and make libraries compatible with AOT:
Learning how to use source generation for serialization/deserialization:
Resolves: #38226 #37761