Make analyzers and ILLink trimming opt-in via MSBuild properties#123292
Make analyzers and ILLink trimming opt-in via MSBuild properties#123292
Conversation
|
@copilot we should still run the full checks on every pr, just not in the inner loop of the product build. |
|
We should also have a leg that triggers the "all configurations build" for libraries. I believe the way to do that nowadays is to pass |
|
Also, maybe we want to add this into the global-build.yml pipeline? I know it's not really a dev innerloop scenario but that pipeline already has these "build the whole repo with a slightly different than default configuration" style jobs |
|
@copilot please move this job into the global-build pipeline |
Added in 1970403. Created a new leg "Libraries_AllConfigurations" that uses
Done in 1970403. Moved all analyzer and linker jobs into global-build.yml and deleted the standalone pipeline. |
- Add RunAnalyzersInBuild property to control analyzer execution - Add RunILLinkInBuild property to control ILLink trimming - Default both to disabled for faster local builds and CI - Projects can still explicitly override via ILLinkTrimAssembly or RunAnalyzers Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
- Create runtime-analyzers-linker.yml pipeline for scheduled runs - Add documentation for RunAnalyzersInBuild and RunILLinkInBuild properties - Pipeline runs on main branch scheduled at 9:00 and 21:00 UTC Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
- Changed pr trigger from 'none' to run on main and release branches - Pipeline now runs on PRs to ensure code quality checks - Updated documentation to reflect PR runs - Keeps inner loop builds fast by using opt-in properties Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
- Move analyzer and linker jobs from standalone pipeline to global-build.yml - Add "all configurations" library build leg with -restore -build -pack - Delete runtime-analyzers-linker.yml standalone pipeline - Update documentation to reference global-build pipeline - Add path-based conditions for better PR filtering Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
- Combine all-configurations build with analyzer and linker checks - Run on linux_x64_dev_innerloop, linux_x64, windows_x64, osx_arm64 - Remove separate platform-specific analyzer jobs and Mono job - Build args: -subset libs -restore -build -pack with /p:RunAnalyzersInBuild=true /p:RunILLinkInBuild=true
1970403 to
1ab89f4
Compare
| # | ||
| # Build Libraries with all configurations including analyzers and linker | ||
| # | ||
| - template: /eng/pipelines/common/platform-matrix.yml |
There was a problem hiding this comment.
Combine this job with the AllConfigurations job earlier in this file?
There was a problem hiding this comment.
Done in a6263df. Removed the redundant Libraries_WithPackages job since Libraries_AllConfigurations supersedes it with more comprehensive testing (-restore -build -pack vs just -pack) and includes analyzer/linker checks.
- Libraries_AllConfigurations supersedes Libraries_WithPackages - AllConfigurations includes -restore -build -pack (more comprehensive than just -pack) - Runs on multiple platforms including linux_x64_dev_innerloop - Includes analyzer and linker checks - Addresses feedback to combine the jobs Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
eng/pipelines/global-build.yml
Outdated
| # | ||
| # Build Libraries (all TFMs) and create packages on a non Windows operating system. | ||
| # Build native assets on Alpine. This exercises more modern musl libc changes that have a tendendy to break source-build. | ||
| # We don't add this as a source-build job as the repo source-build infrastructure isn't set up to run on alpine effectively. |
There was a problem hiding this comment.
@copilot It looks like git is confused about the re-ordering here. Can you put it back like it was?
There was a problem hiding this comment.
Fixed in bbafa57. Moved the analyzer/linker jobs to before Musl_Validation (where Libraries_WithPackages used to be), so Musl_Validation stays in its original relative position and future diffs won't show it as moved.
|
@copilot "Stage Build job build_linux_x64_release_Libraries_AllConfigurations appears more than once. Job names must be unique within a stage." |
- Move analyzer/linker jobs before Musl_Validation - This puts them in the position where Libraries_WithPackages was - Musl_Validation now stays in its original relative position - Avoids git showing Musl_Validation as "moved" in diffs Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
|
@copilot "Build job build_linux_x64_release_Libraries_AllConfigurations appears more than once. Job names must be unique within a stage. Do we already have a Libraries_AllConfigurations build? Should this be folded into it? |
- Remove linux_x64 platform from Libraries_AllConfigurations job - Keep linux_x64_dev_innerloop, windows_x64, and osx_arm64 - Avoids duplicate job name "build_linux_x64_release_Libraries_AllConfigurations" - linux_x64 and linux_x64_dev_innerloop map to same job name Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Fixed in d4020d1. Removed the duplicate linux_x64 platform - both linux_x64 and linux_x64_dev_innerloop were generating the same job name. Now using only linux_x64_dev_innerloop, windows_x64, and osx_arm64. |
- Rename Libraries_AllConfigurations to Libraries_AnalyzersLinker - Rename CoreClr_and_Tools_AllConfigurations to CoreClr_Tools_AnalyzersLinker - Avoids potential name conflicts with existing jobs in other pipelines - Names now more clearly reflect their purpose (analyzer/linker checks) Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Fixed in e28a2dd. Renamed the jobs to avoid conflicts:
These names now more clearly reflect their purpose (running analyzers and linker checks) and avoid conflicts with existing AllConfigurations jobs in other pipelines like runtimelab.yml. |
Description
Analyzers and ILLink trimming now run only when explicitly enabled, reducing local build times and inner loop overhead. Comprehensive jobs in the global-build pipeline ensure code quality checks run on every PR.
Changes
MSBuild properties: Added
RunAnalyzersInBuildandRunILLinkInBuildproperties (default: disabled)eng/Analyzers.targets: DefaultsRunAnalyzers=falseunlessRunAnalyzersInBuild=truesrc/libraries/Directory.Build.targets: RequiresRunILLinkInBuild=truefor trimming in NetCoreApp source projectsRunAnalyzersorILLinkTrimAssemblystill respectedCI pipeline: Integrated into
eng/pipelines/global-build.ymlLibraries_AnalyzersLinkerjob with-restore -build -packplus analyzer/linker checks covering platforms: linux_x64_dev_innerloop, windows_x64, osx_arm64CoreClr_Tools_AnalyzersLinkerjob for CoreLib and tools with analyzer/linker checks on linux_x64_dev_innerloopLibraries_WithPackagesjob (superseded by new analyzer/linker jobs)Documentation: Added build examples in
docs/workflow/building/libraries/README.mdUsage
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.