Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Description

Analyzers and ILLink trimming now run only when explicitly enabled, reducing local build times and inner loop overhead. Jobs in the global-build pipeline ensure code quality checks run on every PR.

Changes

  • MSBuild properties: Added RunAnalyzersInBuild and RunILLinkInBuild properties (default: disabled)

    • eng/Analyzers.targets: Defaults RunAnalyzers=false unless RunAnalyzersInBuild=true
    • src/libraries/Directory.Build.targets: Requires RunILLinkInBuild=true for trimming in NetCoreApp source projects
    • Project-level overrides via RunAnalyzers or ILLinkTrimAssembly still respected
  • CI pipeline: Integrated into eng/pipelines/global-build.yml

    • Runs on all PRs to main and release branches with path-based filtering
    • Added analyzer and linker jobs for Windows/Linux/OSX (CoreCLR) and Linux (Mono)
    • Added "all configurations" library build leg with -restore -build -pack
    • Uses opt-in properties to enable analyzers and linker checks
  • Documentation: Added build examples in docs/workflow/building/libraries/README.md

Usage

# Enable analyzers only
./build.sh libs -c Release /p:RunAnalyzersInBuild=true

# Enable trimming only
./build.sh libs -c Release /p:RunILLinkInBuild=true

# Enable both
./build.sh libs -c Release /p:RunAnalyzersInBuild=true /p:RunILLinkInBuild=true
Original prompt

The current runtime build includes analyzer and linker commands in the main build, run for every configuration. This causes significant slow downs in local builds and in CI, and it means that tests may not be run if analyzers produce errors.

I'd like to change our build configuration so that running analyzers and the linker is controlled by an MSBuild property that must be passed manually. Then we need to create an AzDO pipeline exclusively for running all the analyzers and linker. Can you help implement this? Work incrementally, in small commits.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update build configuration for analyzer and linker control Make analyzers and ILLink trimming opt-in via MSBuild properties Jan 16, 2026
Copilot AI requested a review from agocke January 16, 2026 22:02
@agocke
Copy link
Member

agocke commented Jan 17, 2026

@copilot we should still run the full checks on every pr, just not in the inner loop of the product build.

Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot we should still run the full checks on every pr, just not in the inner loop of the product build.

Updated in ed5458b. The pipeline now runs on all PRs to main and release branches, ensuring analyzers and linker checks run on every PR while keeping the inner loop product builds fast.

@jkoritzinsky
Copy link
Member

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 -restore -build -pack to the build script.

@jkoritzinsky
Copy link
Member

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

@agocke
Copy link
Member

agocke commented Jan 23, 2026

@copilot please move this job into the global-build pipeline

Copy link
Contributor Author

Copilot AI commented Jan 23, 2026

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 -restore -build -pack to the build script.

Added in 1970403. Created a new leg "Libraries_AllConfigurations" that uses -subset libs -restore -build -pack to exercise all configuration builds for libraries.

@copilot please move this job into the global-build pipeline

Done in 1970403. Moved all analyzer and linker jobs into global-build.yml and deleted the standalone pipeline.

Copilot AI and others added 7 commits January 22, 2026 22:28
- 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
@agocke agocke force-pushed the copilot/update-build-configuration-analyzers branch from 1970403 to 1ab89f4 Compare January 23, 2026 06:42
#
# Build Libraries with all configurations including analyzers and linker
#
- template: /eng/pipelines/common/platform-matrix.yml
Copy link
Member

Choose a reason for hiding this comment

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

Combine this job with the AllConfigurations job earlier in this file?

@stephentoub stephentoub added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Jan 26, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants