Skip to content

Commit 389835b

Browse files
authored
Move MSBuild projects out of the native build scripts (dotnet#31701)
* Move coreclr managed tools that don't need to be published and System.Private.CoreLib into their own subsets in Subsets.props and drive their builds via Arcade instead of the coreclr scripts. * Remove building System.Private.CoreLib from build scripts. Eventing sources TBD. * Build packages via an Arcade subset instead of within build.cmd/build.sh * Remove packages and test build from build.cmd. Clean up options on build.cmd and build.sh * Generate eventing sources for System.Private.CoreLib within MSBuild instead of in the build.cmd/sh scripts. Clean up the build.sh usage documentation (lots of copy-paste errors). * Remove check-definitions.py script and supporting goo. * Fix eventing generation. * Wire up TargetArchitecture and OSGroup to coreclr's BuildArch and BuildOS to enable building System.Private.CoreLib for the correct output given the script parameters. * Stop passing down now non-existent skiptests parameter. * Fix coreclr .nuget rid parsing to account for linux-musl correctly. * Update build scripts to use Arcade to build packages. * Convert from Properties to AdditionalProperties. * Build crossgen as part of Arcade (self-contained publish TBD). * Pull down .NET runtime CLI for helix runs with crossgen2. * Output crossgen2 to the BinDir/crossgen when built from the project file. Enable the test shell scripts to either resolve the dotnet CLI from the path or from relative to Core_Root if the __DotNet variable is undefined. * Generate distro rid during windows build. * Various fixes to get files binplaced correctly and builds to work on Linux. * Fix search for dotnet in repo on bash. * Remove __BuildTest variable and fix up the script. * Fix steps in build-job to build S.P.CL before the runtime and build managed tools after the runtime. * Fix casing typo. * Refactor detecting system OS and Architecture. * Fix wasm rid calculation. * Run crossgen2 on corerun so we run it on the runtime we're going to ship it with. * Assemble a live self-contained publish in the crossgen2 package. * Fix init-os-and-arch resolution. * Ensure that the runtime files we package in crossgen2 are the crossgened ones. * Remove extraneous /bl * Build R2RDump to a subfolder instead of the product dir. * Seperate out the crosssgening corelib step into a separate script. * Fix permissions on crossgen-corelib.sh * Rename build.cmd/sh to build-runtime.cmd/sh * Fix parameters in crossgen2determinism test. * Run crossgen on System.Private.CoreLib in CI. * Restore original build.cmd/sh scripts with a deprecation warning and update instructions. * Initialize developer prompt in crossgen-corelib.cmd script so we can find DIA on CI machines. * Make sure vs tools are enabled so we can resolve DiaSymReader. * Call build-native instead of build. * Fix build-native -> build-runtime. * Fix permissions. * Remove dead MSBuild code. * Factor out python locating targets to make them available to the whole repo. * PR Feedback/simplification. * Create a self-contained deps.json for crossgen2 and add it to the package. * Pass runtimeconfiguration as configuration for crossgen2 deps file generation. * Try specifying rids directly in crossgen2 project to get the restore correct for the live-build pipeline. * Run crossgen2 via corerun in R2R.SuperILC. * Add binlogs to build-runtime.cmd * Combine non build-runtime steps into a single step so we get one binlog that doesn't get overwritten. * Add reference to issue describing new workflow. * Quote python path * Set arch default. * PR Feedback and clean up crossgen-corelib's argument list. * Fix subset name matching to work when one subset name is a substring of another. * Pass the official build id as an msbuild arg at all times. Additional cleanup for crossgen-corelib step. * PR Feedback. * Fix default subset list construction. * Add deprecation warnings at beginning and end of build.cmd and build.sh. * Setup dirs in crossgen-corelib.sh * Move enforcepgo argument to before the official build arg so that it gets consumed correctly. * Add cross-os DAC builds as subsets. Clean up build-runtime parameters and passing the official build ID from runtime.proj. * Update script usage docs. * Skip the cross-os dac on x86. * Build windows->linux cross dac on PR and CI. * Don't build the cross-OS linux dac on Windows x86.
1 parent e66e9fa commit 389835b

43 files changed

Lines changed: 1840 additions & 644 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Build.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
99
</PropertyGroup>
1010

11-
<Import Project="$(RepositoryEngineeringDir)/liveBuilds.targets" />
11+
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
12+
<Import Project="$(RepositoryEngineeringDir)python.targets" />
1213
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(SkipImportArcadeSdkFromRoot)' != 'true'" />
1314

1415
<PropertyGroup>

docs/workflow/building/coreclr/linux-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ To ensure that your system can allocate enough file-handles for the libraries bu
124124
Build the Runtime and System.Private.CoreLib
125125
=============================================
126126

127-
To build the runtime on Linux, run build.sh from the root of the runtime repository:
127+
To build the runtime on Linux, run build.sh to build the CoreCLR subset category of the runtime:
128128

129129
```
130-
./src/coreclr/build.sh
130+
./build.sh -subsetCategory coreclr
131131
```
132132

133133
After the build is completed, there should some files placed in `runtime/artifacts/bin/coreclr/Linux.x64.Debug`. The ones we are most interested in are:

docs/workflow/building/coreclr/osx-instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ brew install icu4c
4040
brew link --force icu4c
4141
```
4242

43-
Build the Runtime and Microsoft Core Library
43+
Build the Runtime and System.Private.CoreLib
4444
============================================
4545

46-
To Build CoreCLR, run build.sh from the root of the coreclr repo.
46+
To Build CoreCLR, run build.sh to build the CoreCLR subset category of the runtime:
4747

48-
```sh
49-
./src/coreclr/build.sh
48+
```
49+
./build.sh -subsetCategory coreclr
5050
```
5151

5252
After the build has completed, there should some files placed in `artifacts/bin/coreclr/OSX.x64.Debug`. The ones we are interested in are:
@@ -75,4 +75,4 @@ an environment variable to the Core_Root folder.
7575
```sh
7676
export CORE_ROOT=/path/to/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
7777
$CORE_ROOT/corerun hello_world.dll
78-
```
78+
```

eng/Subsets.props

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,19 @@
6161
<DefaultInstallerSubsets>corehost-managed-depproj-pkgproj-bundle-installers-test</DefaultInstallerSubsets>
6262
<!-- TODO: Split into multiple sets. -->
6363
<DefaultLibrariesSubsets>all</DefaultLibrariesSubsets>
64-
<DefaultCoreClrSubsets>all</DefaultCoreClrSubsets>
64+
<DefaultCoreClrSubsets>runtime-linuxdac-corelib-nativecorelib-tools-packages</DefaultCoreClrSubsets>
6565
<DefaultMonoSubsets>all</DefaultMonoSubsets>
6666

6767
<_subsetCategory Condition="'$(SubsetCategory)' != ''">$(SubsetCategory.ToLowerInvariant())</_subsetCategory>
6868
<_subsetCategory Condition="'$(SubsetCategory)' == ''">$(DefaultSubsetCategories)</_subsetCategory>
6969
<_subset Condition="'$(Subset)' != ''">$(Subset.ToLowerInvariant())</_subset>
7070
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('installer'))">$(DefaultInstallerSubsets)</_subset>
71-
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('libraries'))">$(_subset)$(DefaultLibrariesSubsets)</_subset>
72-
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('coreclr'))">$(_subset)$(DefaultCoreClrSubsets)</_subset>
73-
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('mono'))">$(_subset)$(DefaultMonoSubsets)</_subset>
71+
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('libraries'))">$(_subset)-$(DefaultLibrariesSubsets)</_subset>
72+
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('coreclr'))">$(_subset)-$(DefaultCoreClrSubsets)</_subset>
73+
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('mono'))">$(_subset)-$(DefaultMonoSubsets)</_subset>
74+
75+
<!-- Surround _subset in dashes to simplify checks below -->
76+
<_subset>-$(_subset)-</_subset>
7477
</PropertyGroup>
7578

7679
<ItemGroup>
@@ -81,7 +84,13 @@
8184
<SubsetName Include="All" Category="Libraries" Description="The .NET libraries comprising the shared framework." />
8285

8386
<!-- CoreClr -->
84-
<SubsetName Include="All" Category="CoreClr" Description="The .NET runtime." />
87+
<SubsetName Include="Runtime" Category="CoreClr" Description="The CoreCLR .NET runtime." />
88+
<SubsetName Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="LinuxDac" Category="CoreClr" Description="The cross-OS Windows->libc-based Linux DAC. Skipped on x86." />
89+
<SubsetName Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="AlpineDac" Category="CoreClr" OnDemand="true" Description="The cross-OS Windows->musl-libc-based Linux DAC. Skipped on x86." />
90+
<SubsetName Include="CoreLib" Category="CoreClr" Description="The managed System.Private.CoreLib library for CoreCLR." />
91+
<SubsetName Include="NativeCoreLib" Category="CoreClr" Description="Run crossgen on System.Private.CoreLib library for CoreCLR." />
92+
<SubsetName Include="Tools" Category="CoreClr" Description="Managed tools that support CoreCLR development and testing." />
93+
<SubsetName Include="Packages" Category="CoreClr" Description="The projects that produce NuGet packages for the CoreCLR runtime, crossgen, and IL tools." />
8594

8695
<!-- Mono -->
8796
<SubsetName Include="All" Category="Mono" Description="The Mono .NET runtime." />
@@ -98,14 +107,26 @@
98107
</ItemGroup>
99108

100109
<!-- Global sets -->
101-
<ItemGroup Condition="$(_subset.Contains('regeneratereadmetable'))">
110+
<ItemGroup Condition="$(_subset.Contains('-regeneratereadmetable-'))">
102111
<ProjectToBuild Include="$(RepoToolsLocalDir)regenerate-readme-table.proj" />
103112
</ItemGroup>
104113

105114
<ItemDefinitionGroup Condition="'$(CoreCLRConfiguration)' != ''">
106115
<CoreClrProjectToBuild>
107116
<AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
108117
</CoreClrProjectToBuild>
118+
<CoreClrCoreLibProjectToBuild>
119+
<AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
120+
</CoreClrCoreLibProjectToBuild>
121+
<CoreClrNativeCoreLibProjectToBuild>
122+
<AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
123+
</CoreClrNativeCoreLibProjectToBuild>
124+
<CoreClrManagedToolsProjectToBuild>
125+
<AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
126+
</CoreClrManagedToolsProjectToBuild>
127+
<CoreClrPackagesProjectToBuild>
128+
<AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
129+
</CoreClrPackagesProjectToBuild>
109130
</ItemDefinitionGroup>
110131

111132
<ItemDefinitionGroup Condition="'$(MonoConfiguration)' != ''">
@@ -121,58 +142,90 @@
121142
</ItemDefinitionGroup>
122143

123144
<!-- CoreClr sets -->
124-
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('all'))">
125-
<CoreClrProjectToBuild Include="$(CoreClrProjectRoot)coreclr.proj" BuildInParallel="false" />
145+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-corelib-'))">
146+
<CoreClrCoreLibProjectToBuild Include="$(CoreClrProjectRoot)src\System.Private.CoreLib\System.Private.CoreLib.csproj" BuildInParallel="false" />
147+
<ProjectToBuild Include="@(CoreClrCoreLibProjectToBuild)" />
148+
</ItemGroup>
149+
150+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-runtime-'))">
151+
<CoreClrProjectToBuild Include="$(CoreClrProjectRoot)runtime.proj" BuildInParallel="false" />
126152
<ProjectToBuild Include="@(CoreClrProjectToBuild)" />
127153
</ItemGroup>
128154

155+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-linuxdac-')) and $([MSBuild]::IsOsPlatform(Windows)) and '$(TargetArchitecture)' != 'x86'">
156+
<CoreClrLinuxDacProjectToBuild Include="$(CoreClrProjectRoot)runtime.proj" BuildInParallel="false" AdditionalProperties="%(AdditionalProperties);CrossDac=linux" />
157+
<ProjectToBuild Include="@(CoreClrLinuxDacProjectToBuild)" />
158+
</ItemGroup>
159+
160+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-alpinedac-')) and $([MSBuild]::IsOsPlatform(Windows)) and '$(TargetArchitecture)' != 'x86'">
161+
<CoreClrAlpineLinuxDacProjectToBuild Include="$(CoreClrProjectRoot)runtime.proj" BuildInParallel="false" AdditionalProperties="%(AdditionalProperties);CrossDac=alpine" />
162+
<ProjectToBuild Include="@(CoreClrAlpineLinuxDacProjectToBuild)" />
163+
</ItemGroup>
164+
165+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-nativecorelib-'))">
166+
<CoreClrNativeCoreLibProjectToBuild Include="$(CoreClrProjectRoot)crossgen-corelib.proj" BuildInParallel="false" />
167+
<ProjectToBuild Include="@(CoreClrNativeCoreLibProjectToBuild)" />
168+
</ItemGroup>
169+
170+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-tools-'))">
171+
<CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\runincontext\runincontext.csproj" />
172+
<CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\r2rdump\R2RDump.csproj" />
173+
<CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\ReadyToRun.SuperIlc\ReadyToRun.SuperIlc.csproj" />
174+
<CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\crossgen2\crossgen2\crossgen2.csproj" BuildInParallel="false" />
175+
<ProjectToBuild Include="@(CoreClrManagedToolsProjectToBuild)" />
176+
</ItemGroup>
177+
178+
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-packages-'))">
179+
<CoreClrPackagesProjectToBuild Include="$(CoreClrProjectRoot)src\.nuget\packages.builds" BuildInParallel="false" />
180+
<ProjectToBuild Include="@(CoreClrPackagesProjectToBuild)" />
181+
</ItemGroup>
129182
<!-- Mono sets -->
130-
<ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('all'))">
183+
<ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('-all-'))">
131184
<MonoProjectToBuild Include="$(MonoProjectRoot)mono.proj" BuildInParallel="false" />
132185
<MonoProjectToBuild Include="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj" BuildInParallel="false" />
133186
<ProjectToBuild Include="@(MonoProjectToBuild)" />
134187
</ItemGroup>
135188

136189
<!-- Libraries sets -->
137-
<ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('all'))">
190+
<ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-all-'))">
138191
<LibrariesProjectToBuild Include="$(LibrariesProjectRoot)build.proj" BuildInParallel="false" />
139192
<ProjectToBuild Include="@(LibrariesProjectToBuild)" />
140193
</ItemGroup>
141194

142195
<!-- Installer sets -->
143-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('corehost'))">
196+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-corehost-'))">
144197
<CorehostProjectToBuild Include="$(InstallerProjectRoot)corehost\build.proj" SignPhase="Binaries" />
145198
<ProjectToBuild Include="@(CorehostProjectToBuild)" />
146199
</ItemGroup>
147200

148-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('managed'))">
201+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-managed-'))">
149202
<ManagedProjectToBuild Include="$(InstallerProjectRoot)managed\**\*.csproj" SignPhase="Binaries" />
150203
<ManagedProjectToBuild Include="$(InstallerProjectRoot)pkg\packaging\pack-managed.proj" />
151204
<ProjectToBuild Include="@(ManagedProjectToBuild)" />
152205
</ItemGroup>
153206

154-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('depproj'))">
207+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-depproj-'))">
155208
<DepprojProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\**\*.depproj" SignPhase="R2RBinaries" BuildInParallel="false" />
156209
<ProjectToBuild Include="@(DepprojProjectToBuild)" />
157210
</ItemGroup>
158211

159-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('pkgproj'))">
212+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-pkgproj-'))">
160213
<PkgprojProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\**\*.pkgproj" SignPhase="MsiFiles" BuildInParallel="false" />
161214
<ProjectToBuild Include="@(PkgprojProjectToBuild)" />
162215
</ItemGroup>
163216

164-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('bundle'))">
217+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-bundle-'))">
165218
<BundleProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\**\*.bundleproj" SignPhase="BundleInstallerFiles" BuildInParallel="false" />
166219
<ProjectToBuild Include="@(BundleProjectToBuild)" />
167220
</ItemGroup>
168221

169-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('installers'))">
222+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-installers-'))">
170223
<InstallerProjectToBuild Include="$(InstallerProjectRoot)pkg\packaging\installers.proj" BuildInParallel="false" />
171224
<InstallerProjectToBuild Include="$(InstallerProjectRoot)pkg\packaging\vs-insertion-packages.proj" BuildInParallel="false" />
172225
<ProjectToBuild Include="@(InstallerProjectToBuild)" />
173226
</ItemGroup>
174227

175-
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('test'))">
228+
<ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-test-'))">
176229
<TestProjectToBuild Include="$(InstallerProjectRoot)test\Microsoft.NET.HostModel.Tests\AppHost.Bundle.Tests\AppHost.Bundle.Tests.csproj" />
177230
<TestProjectToBuild Include="$(InstallerProjectRoot)test\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.AppHost.Tests\Microsoft.NET.HostModel.AppHost.Tests.csproj" />
178231
<TestProjectToBuild Include="$(InstallerProjectRoot)test\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.Bundle.Tests\Microsoft.NET.HostModel.Bundle.Tests.csproj" />

eng/build.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Param(
1111
[switch]$allconfigurations,
1212
[switch]$coverage,
1313
[string]$testscope,
14-
[string]$arch,
14+
[string]$arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant(),
1515
[string]$subsetCategory,
1616
[string]$subset,
1717
[ValidateSet("Debug","Release","Checked")][string]$runtimeConfiguration,
@@ -146,11 +146,13 @@ foreach ($argument in $PSBoundParameters.Keys)
146146
"framework" { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
147147
"os" { $arguments += " /p:OSGroup=$($PSBoundParameters[$argument])" }
148148
"allconfigurations" { $arguments += " /p:BuildAllConfigurations=true" }
149-
"arch" { $arguments += " /p:ArchGroup=$($PSBoundParameters[$argument]) /p:TargetArchitecture=$($PSBoundParameters[$argument])" }
149+
"arch" { $arch = $PSBoundParameters[$argument]; $arguments += " /p:ArchGroup=$arch /p:TargetArchitecture=$arch" }
150150
"properties" { $arguments += " " + $properties }
151151
default { $arguments += " /p:$argument=$($PSBoundParameters[$argument])" }
152152
}
153153
}
154154

155+
$env:__DistroRid="win-$arch"
156+
155157
Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $arguments"
156158
exit $lastExitCode

eng/build.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,35 @@ usage()
6060
echo "Arguments can also be passed in with a single hyphen."
6161
}
6262

63+
initDistroRid()
64+
{
65+
source $scriptroot/native/init-distro-rid.sh
66+
67+
local passedRootfsDir=""
68+
local buildOs="$1"
69+
local buildArch="$2"
70+
local isCrossBuild="$3"
71+
# For RID calculation purposes, say we are always a portable build
72+
# All of our packages that use the distro rid (CoreCLR packages) are portable.
73+
local isPortableBuild=1
74+
75+
# Only pass ROOTFS_DIR if __DoCrossArchBuild is specified.
76+
if (( isCrossBuild == 1 )); then
77+
passedRootfsDir=${ROOTFS_DIR}
78+
fi
79+
initDistroRidGlobal ${buildOs} ${buildArch} ${isPortableBuild} ${passedRootfsDir}
80+
}
81+
6382
arguments=''
6483
cmakeargs=''
6584
extraargs=''
6685
build=false
6786
buildtests=false
6887
subsetCategory=''
6988
checkedPossibleDirectoryToBuild=false
89+
crossBuild=0
90+
91+
source $scriptroot/native/init-os-and-arch.sh
7092

7193
# Check if an action is passed in
7294
declare -a actions=("r" "restore" "b" "build" "buildtests" "rebuild" "t" "test" "pack" "sign" "publish" "clean")
@@ -89,6 +111,7 @@ while [[ $# > 0 ]]; do
89111
shift 2
90112
;;
91113
-arch)
114+
arch=$2
92115
arguments="$arguments /p:ArchGroup=$2 /p:TargetArchitecture=$2"
93116
shift 2
94117
;;
@@ -103,6 +126,7 @@ while [[ $# > 0 ]]; do
103126
shift 2
104127
;;
105128
-os)
129+
os=$2
106130
arguments="$arguments /p:OSGroup=$2"
107131
shift 2
108132
;;
@@ -141,6 +165,7 @@ while [[ $# > 0 ]]; do
141165
shift 2
142166
;;
143167
-cross)
168+
crossBuild=1
144169
arguments="$arguments /p:CrossBuild=True"
145170
shift 1
146171
;;
@@ -187,6 +212,8 @@ if [ ${#actInt[@]} -eq 0 ]; then
187212
arguments="-restore -build $arguments"
188213
fi
189214

215+
initDistroRid $os $arch $crossBuild
216+
190217
# URL-encode space (%20) to avoid quoting issues until the msbuild call in /eng/common/tools.sh.
191218
# In *proj files (XML docs), URL-encoded string are rendered in their decoded form.
192219
cmakeargs="${cmakeargs// /%20}"

0 commit comments

Comments
 (0)