Repository navigation
Pass CLR_CROSS_COMPONENTS_BUILD as a separate -cmakeargs - #135517
Merged
Merged
Conversation
The host cross-components, linuxdac and alpinedac builds appended -DCLR_CROSS_COMPONENTS_BUILD=1 to $(CMakeArgs) with a space. runtime.proj passes each CMakeArgs item as one quoted -cmakeargs value, and build-runtime.cmd keeps that value as a single CMake argument, so on Windows a user -cmakeargs such as -DCLR_PROBE_NOOP=1 fused with the flag: CMake defined CLR_PROBE_NOOP as "1 -DCLR_CROSS_COMPONENTS_BUILD=1" and never saw CLR_CROSS_COMPONENTS_BUILD. A Windows arm64 build then failed assembling arm64 sources with ml64, and linuxdac failed at configure. Set ClrCrossComponentsBuild=true instead and have runtime.proj emit the define as its own -cmakeargs, like the other internal defines. It is listed before the user's CMakeArgs: build-runtime.cmd and build-commons.sh prepend each -cmakeargs, so it lands after the user's arguments and keeps precedence over them. The new property joins CMakeArgs in NativeBuildPartitionPropertiesToRemove. Fixes dotnet#135468
|
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. |
Contributor
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
jkoritzinsky
approved these changes
Oct 9, 2026
This was referenced Oct 9, 2026
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.
Fixes #135468
The host cross-components build and the
linuxdacandalpinedacbuilds ineng/Subsets.propsappended the flag to the user's CMake arguments:runtime.projturns eachCMakeArgsitem into one-cmakeargs "%(Identity)", so the flag shares a value with the last user argument.build-runtime.cmdkeeps a quoted-cmakeargsvalue as a single CMake argument: on Windows,-cmakeargs -DCLR_PROBE_NOOP=1reached CMake as one definition ofCLR_PROBE_NOOPwith the value1 -DCLR_CROSS_COMPONENTS_BUILD=1, andCLR_CROSS_COMPONENTS_BUILDwas never defined. On Linux, the sharedbuild_nativefunction ineng/native/build-commons.shreparses the accumulated arguments witheval, so the flag still arrived as a separate argument.This sets
ClrCrossComponentsBuild=trueon those three projects instead, andruntime.projpasses-cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1"as its own entry, the way it already passesFEATURE_INTERPRETERand the other internal defines. The user'sCMakeArgsstill reaches the sub-builds unchanged, as a global property.ClrCrossComponentsBuildjoinsCMakeArgsinNativeBuildPartitionPropertiesToRemove, soruntime-prereqs.projandcdac-build-toolare not built again because of it.The new entry is listed before the user's
CMakeArgs. Bothbuild-runtime.cmdandeng/native/build-commons.shprepend each-cmakeargs, so it ends up after all of the user's arguments on the CMake command line, and a user-DCLR_CROSS_COMPONENTS_BUILD=0does not override it. For-cmakeargsgiven tobuild.shorbuild.cmd, which arrive as a singleCMakeArgsitem, this is the order Linux already had.Splitting
CMakeArgson spaces inruntime.projwould also make these builds pass, but it would break a CMake argument that contains a space.Validation
There is no test harness for these MSBuild files, so this was checked by building from fresh obj dirs at 716a871 and reading the
build-runtimecommand lines and each sub-build'sCMakeCache.txt.CLR_PROBE_NOOPandCLR_PROBE_TWOare placeholder names.Windows x64 host:
build.cmd clr.runtime -a arm64 -c Debug -cmakeargs -DCLR_PROBE_NOOP=1x64\debug\di\floatconversion.asm(2748) : error A2008:syntax error : GBLA;x64\CMakeCache.txthasCLR_PROBE_NOOP:UNINITIALIZED=1 -DCLR_CROSS_COMPONENTS_BUILD=1x64\CMakeCache.txthasCLR_CROSS_COMPONENTS_BUILD=1andCLR_PROBE_NOOP=1as separate entriesbuild.cmd clr.runtime -a arm64 -c DebugCLR_CROSS_COMPONENTS_BUILD=1inx64\CMakeCache.txtbuild.cmd linuxdac -a x64 -c Debug -cmakeargs -DCLR_PROBE_NOOP=1System.Net.Security.Native/extra_libs.cmake:30), with the same fused cache entrymscordaccoreandmscordbiLinux x64,
./build.sh clr.crossarchtools -a arm64 -c Debug(builds only the x64-hosted cross components):-cmakeargs-DCLR_PROBE_NOOP=1 -cmakeargs -DCLR_PROBE_TWO=2CLR_CROSS_COMPONENTS_BUILD=1,CLR_PROBE_NOOP=1,CLR_PROBE_TWO=2CLR_CROSS_COMPONENTS_BUILD=1-DCLR_CROSS_COMPONENTS_BUILD=0CLR_CROSS_COMPONENTS_BUILD=1CLR_CROSS_COMPONENTS_BUILD=1alpinedactakes the same path aslinuxdacand was not built separately.