Skip to content

Commit 7bfb032

Browse files
mmitchepsfinaki
andauthored
Switch to new VMR control set (#17703)
* Now that fsharp is on 9.0, we can switch to the new control set. Generally: - DotNetBuildFromSource -> DotNetBuildSourceOnly - Building a source-only build. - DotnetBuildFromSourceFlavor == Product -> DotNetBuildOrchestrator == true - Building in the VMR, could be source-only or MS's build. - ArcadeBuildFromSource -> DotNetBuildRepo == true -> Indicates an outer repo build. * Split out source build args * Split out source build args * Remove unnecessary source build env var set * Add properties to the bootstrap compiler build * BuildRepo -> BuildInnerRepo * Only build proto repo in inner build * Additional VMR properties for completeness * Rename sourcebuild.props -> dotnetbuild.props --------- Co-authored-by: Petr <[email protected]>
1 parent f4860a4 commit 7bfb032

9 files changed

+25
-16
lines changed

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
88
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
99
<FSharpNetCoreProductDefaultTargetFramework>net9.0</FSharpNetCoreProductDefaultTargetFramework>
10-
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildFromSource)</IgnoreMibc>
10+
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildSourceOnly)</IgnoreMibc>
1111
</PropertyGroup>
1212

1313
<!--
@@ -73,7 +73,7 @@
7373
we should also support $(NetPrevious) for all releases.
7474
This will likely include FCS and FSharp.Core as well as shipped products.
7575
Right now, it only covers products we ship (FSC and FSI), not NuGet packages. -->
76-
<When Condition="'$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product'">
76+
<When Condition="'$(DotNetBuildSourceOnly)' == 'true' AND '$(DotNetBuildOrchestrator)' == 'true'">
7777
<PropertyGroup>
7878
<FSharpNetCoreProductTargetFramework>$(NetCurrent)</FSharpNetCoreProductTargetFramework>
7979
</PropertyGroup>

Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
When .NET gets built from source, make the SDK aware there are bootstrap packages
2727
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
2828
-->
29-
<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
29+
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
3030
<KnownRuntimePack Update="Microsoft.NETCore.App">
3131
<RuntimePackRuntimeIdentifiers
3232
Condition="'%(TargetFramework)' == '$(NetCurrent)'">%(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>

FSharpBuild.Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
<EnableXlfLocalization Condition="'$(EnableXlfLocalization)' == '' AND ('$(Configuration)' == 'Proto' OR '$(MonoPackaging)' == 'true')">false</EnableXlfLocalization>
7474
</PropertyGroup>
7575

76-
<!-- source build -->
77-
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true' OR '$(ArcadeBuildFromSource)' == 'true'">
76+
<!-- Do not publish in source-only modes. This switch is present in both inner and outer builds. -->
77+
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
7878
<PublishWindowsPdb>false</PublishWindowsPdb>
7979
</PropertyGroup>
8080

eng/Build.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ function BuildSolution([string] $solutionName, $nopack) {
292292
# Do not set the property to true explicitly, since that would override value projects might set.
293293
$suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" }
294294

295+
$sourceBuildArgs = if ($sourceBuild) { "/p:DotNetBuildSourceOnly=true /p:DotNetBuildRepo=true" } else { "" }
296+
295297
$BUILDING_USING_DOTNET_ORIG = $env:BUILDING_USING_DOTNET
296298

297299
$env:BUILDING_USING_DOTNET="false"
@@ -314,10 +316,10 @@ function BuildSolution([string] $solutionName, $nopack) {
314316
/p:QuietRestore=$quietRestore `
315317
/p:QuietRestoreBinaryLog=$binaryLog `
316318
/p:TestTargetFrameworks=$testTargetFrameworks `
317-
/p:DotNetBuildFromSource=$sourceBuild `
318319
/p:CompressAllMetadata=$CompressAllMetadata `
319320
/p:BuildNoRealsig=$buildnorealsig `
320321
/v:$verbosity `
322+
$sourceBuildArgs `
321323
$suppressExtensionDeployment `
322324
@properties
323325

eng/SourceBuild.props renamed to eng/DotNetBuild.props

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
-->
1414
<Target Name="ConfigureInnerBuildArg"
1515
BeforeTargets="GetSourceBuildCommandConfiguration"
16-
Condition="'$(ArcadeBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'">
16+
Condition="'$(DotNetBuildSourceOnly)' == 'true'">
1717
<PropertyGroup>
1818
<InnerBuildArgs>$(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\Microsoft.FSharp.Compiler.sln"</InnerBuildArgs>
1919
</PropertyGroup>
@@ -26,7 +26,7 @@
2626
<Target Name="BuildBootstrap"
2727
DependsOnTargets="PrepareInnerSourceBuildRepoRoot"
2828
BeforeTargets="RunInnerSourceBuildCommand"
29-
Condition="'$(ArcadeBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'">
29+
Condition="'$(DotNetBuildSourceOnly)' == 'true'">
3030

3131
<PropertyGroup>
3232
<SourceBuildBootstrapTfmArg Condition="$(SourceBuildBootstrapTfm) != ''">--tfm $(SourceBuildBootstrapTfm)</SourceBuildBootstrapTfmArg>
@@ -41,9 +41,9 @@
4141
-bl enables the binlogs for the tools and Proto builds, which make debugging failures here easier
4242
-->
4343
<Exec
44-
Command="./build.sh --bootstrap --skipBuild -bl $(SourceBuildBootstrapTfmArg) /p:SourceBuildUseMonoRuntime=$(SourceBuildUseMonoRuntime)"
44+
Command="./build.sh --bootstrap --skipBuild -bl $(SourceBuildBootstrapTfmArg) /p:SourceBuildUseMonoRuntime=$(SourceBuildUseMonoRuntime) /p:DotNetBuildSourceOnly=true /p:DotNetBuildInnerRepo=true /p:DotNetBuildRepo=true /p:DotNetBuildOrchestrator=$(DotNetBuildOrchestrator)"
4545
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
46-
EnvironmentVariables="@(InnerBuildEnv);DotNetBuildFromSource=true" />
46+
EnvironmentVariables="@(InnerBuildEnv)" />
4747
</Target>
4848

4949
</Project>

eng/build.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ function BuildSolution {
241241
if [[ "$UNAME" == "Darwin" ]]; then
242242
enable_analyzers=false
243243
fi
244+
245+
local source_build_args=""
246+
if [[ "$source_build" == true ]]; then
247+
source_build_args="/p:DotNetBuildRepo=true /p:DotNetBuildSourceOnly=true"
248+
fi
244249

245250
# NuGet often exceeds the limit of open files on Mac and Linux
246251
# https://github.com/NuGet/Home/issues/2163
@@ -274,7 +279,7 @@ function BuildSolution {
274279
fi
275280

276281
BuildMessage="Error building tools"
277-
local args=" publish $repo_root/proto.proj $blrestore $bltools /p:Configuration=Proto /p:ArcadeBuildFromSource=$source_build $properties"
282+
local args=" publish $repo_root/proto.proj $blrestore $bltools /p:Configuration=Proto $source_build_args $properties"
278283
echo $args
279284
"$DOTNET_INSTALL_DIR/dotnet" $args #$args || exit $?
280285
fi
@@ -296,8 +301,8 @@ function BuildSolution {
296301
/p:ContinuousIntegrationBuild=$ci \
297302
/p:QuietRestore=$quiet_restore \
298303
/p:QuietRestoreBinaryLog="$binary_log" \
299-
/p:ArcadeBuildFromSource=$source_build \
300304
/p:BuildNoRealsig=$buildnorealsig \
305+
$source_build_args \
301306
$properties
302307
fi
303308
}

eng/test-determinism.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function Run-Build([string]$rootDir, [string]$increment) {
7878
/p:ContinuousIntegrationBuild=false `
7979
/p:OfficialBuildId="" `
8080
/p:QuietRestore=false `
81-
/p:DotNetBuildFromSource=false `
81+
/p:DotNetBuildSourceOnly=false `
8282
/p:Deterministic=true `
8383
/p:DebugDeterminism=true `
8484
/p:Features="debug-determinism" `

proto.proj

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<RootDir Condition="'$(RootDir)'==''">Bootstrap</RootDir>
55
</PropertyGroup>
66

7-
<!-- Skip on sourcebuild -->
8-
<ItemGroup Condition="'$(ArcadeBuildFromSource)'!='true'">
7+
<!-- This needs to be built only in the inner VMR build proto invocation, but not the outer VMR build invocation.
8+
The project does not import Arcade targets so we only have the properties that were passed in, rather than
9+
calculated properties like DotNetBuildPhase. -->
10+
<ItemGroup Condition="'$(DotNetBuildSourceOnly)'!='true' or '$(DotNetBuildInnerRepo)' == 'true'">
911
<Projects Include="buildtools\fslex\fslex.fsproj" />
1012
<Projects Include="buildtools\fsyacc\fsyacc.fsproj" />
1113
<Projects Include="buildtools\AssemblyCheck\AssemblyCheck.fsproj" />

setup/Swix/Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<Target Name="Build"
1717
DependsOnTargets="ResolveProjectReferences"
18-
Condition="'$(DotNetBuildFromSource)' != 'true' AND '$(ArcadeBuildFromSource)' != 'true'">
18+
Condition="'$(DotNetBuildSourceOnly)' != 'true'">
1919
<MakeDir Directories="$(IntermediateOutputPath)" ContinueOnError="True"/>
2020
</Target>
2121

0 commit comments

Comments
 (0)