Preserve default Ninja behavior when MSBuild property is unset - #134471
Merged
Merged
Conversation
Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com>
Copilot
AI
changed the title
Fix Ninja default handling in native builds
Preserve default Ninja behavior when MSBuild property is unset
Sep 22, 2026
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot created this pull request from a session on behalf of
jtschuster
September 22, 2026 22:24
View session
jtschuster
marked this pull request as ready for review
September 22, 2026 23:51
jtschuster
requested review from
am11 and
jkoritzinsky
and
a lite review from Copilot
September 22, 2026 23:51
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Preserves Ninja as the default generator when the Ninja MSBuild property is unset.
Changes:
- Passes
-ninja falseonly for explicitNinja=false. - Retains explicit
Ninja=trueand Windows-specific behavior. - Applies consistently across CoreCLR, corehost, and native libraries.
| File | Description |
|---|---|
src/native/libs/build-native.proj |
Preserves native library build defaults. |
src/native/corehost/corehost.proj |
Preserves corehost’s default Ninja selection. |
src/coreclr/runtime.proj |
Adjusts CoreCLR generator argument handling. |
jkoritzinsky
approved these changes
Sep 23, 2026
This was referenced Sep 23, 2026
am11
approved these changes
Sep 23, 2026
am11
left a comment
Member
There was a problem hiding this comment.
UX nit: we could make it --option instead of --arg <val>, e.g. settle on ninja being default and --no-ninja to turn it off.
Member
|
/ba-g unrelated crypto failure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unset
Ninjaproperties were treated as explicitly disabled, overriding the native build scripts’ default generator selection. Elsewhere in the clr build, Ninja is treated as the default. Usually this is propagated from the outer ./build.sh, but when building one of these project directly (as trimmer tests do) without explicitly setting/p:Ninja=true, it defaults to Makefiles. This causes the build to fail if CMakeCache.txt is present after previous build used the defaultNinja.Changes
-ninja falseonly whenNinja=false.Ninja=truebehavior.Validation
clr+libs+host.true, andfalseproperty handling across all affected projects.