Skip to content

Commit 8d1e873

Browse files
authored
Sourcebuild perf perhaps (dotnet#16860)
* Sourcebuild perf * proto * publish * tweak * baseline * tweak * fix publish framework * temp * temp * temp * publish * props * UseCurrentRuntimeIdentifier * oops * publishing.props * BUILDING_USING_DOTNET * fsharpqa and ngen * Reqork -norealsig * update yaml * revert realsig changes
1 parent fc42ec9 commit 8d1e873

Some content is hidden

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

42 files changed

+325
-367
lines changed

Build.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore %*"
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "Measure-Command { & """%~dp0eng\build.ps1""" -build -restore %* } | Select-Object TotalMinutes, TotalSeconds"

Directory.Build.props

+6-14
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,11 @@
2727
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'false' and '$(DotnetProjInfo)' == 'true'">
2828
<BUILDING_USING_DOTNET>true</BUILDING_USING_DOTNET>
2929
</PropertyGroup>
30-
31-
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'true'">
32-
<!--
33-
When shipping Build fsharp.compiler.service dll using realsig visibility
34-
When testing we have a test pass built using old style visibility to improve
35-
testing coverage.
36-
37-
Don't use it explicitly when building with plain .NET (without Proto or Arcade).
38-
-->
39-
<OtherFlags Condition="'$(Configuration)' != 'Proto' and '$(TestingLegacyInternalSignature)' != 'true'">$(OtherFlags) --realsig-</OtherFlags>
40-
<!-- TBD: Fix MEF Export visibility issues in VS -->
41-
<OtherFlags Condition="'$(Configuration)' != 'Proto' and '$(TestingLegacyInternalSignature)' == 'true'">$(OtherFlags) --realsig+</OtherFlags>
4230

31+
<!-- pick realsig value -->
32+
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'true' and '$(Configuration)' != 'Proto'">
33+
<OtherFlags Condition="'$(BuildNoRealsig)' == 'true'">$(OtherFlags) --realsig-</OtherFlags>
34+
<OtherFlags Condition="'$(BuildNoRealsig)' != 'true'">$(OtherFlags) --realsig+</OtherFlags>
4335
</PropertyGroup>
4436

4537
<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition="Exists('$(RepoRoot)/Directory.Build.props.user')" />
@@ -53,8 +45,8 @@
5345
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
5446
<!-- Note, that default framework is used here (the one we use for development in the current cycle),
5547
since it's a non-arcade and non-sourcebuild scenario -->
56-
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fslex.dll</FsLexPath>
57-
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fsyacc.dll</FsYaccPath>
48+
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fslex.dll</FsLexPath>
49+
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fsyacc.dll</FsYaccPath>
5850
<DefineConstants>NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)</DefineConstants>
5951
</PropertyGroup>
6052
<Import Project="$(MSBuildThisFileDirectory)/eng/Versions.props" Condition="'$(DISABLE_ARCADE)' == 'true'" />

Directory.Build.targets

+8
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
<Import Project="FSharpTests.Directory.Build.targets" Condition = " '$(FSharpTestCompilerVersion)' != '' "/>
44
<Import Project="CoordinateXliff.targets" Condition = " '$(FSharpBuildAssemblyFile)' != '' and '$(XliffTasksAssembly)' != '' "/>
55

6+
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
7+
<!-- Note, that default framework is used here (the one we use for development in the current cycle),
8+
since it's a non-arcade and non-sourcebuild scenario -->
9+
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fslex.dll</FsLexPath>
10+
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fsyacc.dll</FsYaccPath>
11+
</PropertyGroup>
12+
613
<ItemGroup Condition="'$(UnitTestType)' == 'nunit'">
714
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
815
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnit3TestAdapterVersion)" />
916
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
1017
</ItemGroup>
18+
1119
<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
1220
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
1321
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVersion)" />

FSharpBuild.Directory.Build.targets

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(DISABLE_ARCADE)' != 'true'"/>
44
<Import Project="eng\targets\Imports.targets" Condition="'$(DISABLE_ARCADE)' != 'true'"/>
5-
<Import Project="eng\targets\NGenBinaries.targets" Condition="'$(DISABLE_ARCADE)' != 'true'"/>
65
<Import Project="eng\targets\NuGet.targets" Condition="'$(DISABLE_ARCADE)' != 'true'"/>
76
<Import Project="FSharp.Profiles.props" />
87

Microsoft.FSharp.Compiler.sln

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.1.32113.165
4+
VisualStudioVersion = 17.10.34710.37
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.fsproj", "{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}"
6+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Microsoft.FSharp.Compiler", "src\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.fsproj", "{196088D5-ED51-4A42-9B80-F0014D1ED28C}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {6FF31C5A-ED51-45C2-A405-5534CB7D283C}
23+
SolutionGuid = {CBCFE753-E7C1-4FFB-9F8F-26B50E5910E4}
2424
EndGlobalSection
2525
EndGlobal

Proto.sln

-34
This file was deleted.

azure-pipelines-PR.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ stages:
357357
- checkout: self
358358
clean: true
359359

360-
- script: eng\CIBuild.cmd -compressallmetadata -norealsig -testCoreclr -configuration Release
360+
- script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testCoreclr -configuration Release
361361
env:
362362
NativeToolsOnMachine: true
363363
displayName: Build
@@ -385,7 +385,7 @@ stages:
385385
- checkout: self
386386
clean: true
387387

388-
- script: eng\CIBuild.cmd -compressallmetadata -norealsig -testDesktop -configuration Release
388+
- script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release
389389
env:
390390
NativeToolsOnMachine: true
391391
displayName: Build

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ while [[ -h $source ]]; do
1313
done
1414

1515
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
16-
"$scriptroot/eng/build.sh" --build --restore $@
16+
time "$scriptroot/eng/build.sh" --build --restore $@

buildtools/AssemblyCheck/AssemblyCheck.fsproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
7-
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<PublishReadyToRun>true</PublishReadyToRun>
11+
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
812
</PropertyGroup>
913

1014
<ItemGroup>
1115
<Compile Include="AssemblyCheck.fs" />
1216
<Content Include="SkipVerifyEmbeddedPdb.txt">
13-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
17+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1418
</Content>
1519
</ItemGroup>
1620

buildtools/buildtools.proj

-35
This file was deleted.

buildtools/fslex/fslex.fsproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
7-
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
87
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
98
</PropertyGroup>
109

10+
<PropertyGroup>
11+
<PublishReadyToRun>true</PublishReadyToRun>
12+
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
13+
</PropertyGroup>
14+
1115
<ItemGroup>
1216
<Compile Include="Lexing.fsi" />
1317
<Compile Include="Lexing.fs" />

buildtools/fsyacc/fsyacc.fsproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
7-
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
87
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
98
</PropertyGroup>
109

10+
<PropertyGroup>
11+
<PublishReadyToRun>true</PublishReadyToRun>
12+
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
13+
</PropertyGroup>
14+
1115
<ItemGroup>
1216
<Compile Include="Lexing.fsi" />
1317
<Compile Include="Lexing.fs" />

eng/Build.ps1

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ param (
3535
# Options
3636
[switch][Alias('proto')]$bootstrap,
3737
[string]$bootstrapConfiguration = "Proto",
38-
[string]$bootstrapTfm = "net472",
38+
[string]$bootstrapTfm = "net8.0",
3939
[string]$fsharpNetCoreProductTfm = "net8.0",
4040
[switch][Alias('bl')]$binaryLog = $true,
4141
[switch][Alias('nobl')]$excludeCIBinaryLog = $false,
@@ -69,7 +69,7 @@ param (
6969
[switch]$sourceBuild,
7070
[switch]$skipBuild,
7171
[switch]$compressAllMetadata,
72-
[switch]$norealsig,
72+
[switch]$buildnorealsig,
7373
[switch]$verifypackageshipstatus = $false,
7474
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)
7575

@@ -132,7 +132,7 @@ function Print-Usage() {
132132
Write-Host " -sourceBuild Simulate building for source-build."
133133
Write-Host " -skipbuild Skip building product"
134134
Write-Host " -compressAllMetadata Build product with compressed metadata"
135-
Write-Host " -norealsig Build product with realsig- (default use realsig+)"
135+
Write-Host " -buildnorealsig Build product with realsig- (default use realsig+, where necessary)"
136136
Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget"
137137
Write-Host ""
138138
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
@@ -212,12 +212,12 @@ function Process-Arguments() {
212212
$script:compressAllMetadata = $True;
213213
}
214214

215-
if ($norealsig) {
216-
$script:realsig = $False;
215+
if ($buildnorealsig) {
216+
$script:buildnorealsig = $True
217217
$env:FSHARP_REALSIG="false"
218218
}
219219
else {
220-
$script:realsig = $True;
220+
$script:buildnorealsig = $False
221221
$env:FSHARP_REALSIG="true"
222222
}
223223
if ($verifypackageshipstatus) {
@@ -298,7 +298,7 @@ function BuildSolution([string] $solutionName, $nopack) {
298298
/p:TestTargetFrameworks=$testTargetFrameworks `
299299
/p:DotNetBuildFromSource=$sourceBuild `
300300
/p:CompressAllMetadata=$CompressAllMetadata `
301-
/p:TestingLegacyInternalSignature=$realsig `
301+
/p:BuildNoRealsig=$buildnorealsig `
302302
/v:$verbosity `
303303
$suppressExtensionDeployment `
304304
@properties
@@ -554,7 +554,7 @@ try {
554554
}
555555

556556
$script:BuildMessage = "Failure building product"
557-
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild) {
557+
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild -and -not $sourceBuild) {
558558
if ($noVisualStudio) {
559559
BuildSolution "FSharp.sln" $False
560560
}

eng/SourceBuildPrebuiltBaseline.xml

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
<UsagePattern IdentityGlob="System.Diagnostics.EventLog/7.0.0" />
1717
<UsagePattern IdentityGlob="System.Security.Cryptography.ProtectedData/7.0.0" />
1818

19+
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.linux-x64/8.0.2" />
20+
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/8.0.2" />
21+
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/8.0.2" />
22+
23+
1924
<!-- Tracked in https://github.com/dotnet/source-build/issues/3438 -->
2025
<UsagePattern IdentityGlob="Microsoft.VisualStudio.Setup.Configuration.Interop/3.2.2146" />
2126
</IgnorePatterns>

eng/build-utils.ps1

+4-22
Original file line numberDiff line numberDiff line change
@@ -240,33 +240,15 @@ function Make-BootstrapBuild() {
240240
# prepare FsLex and Fsyacc and AssemblyCheck
241241
$dotnetPath = InitializeDotNetCli
242242
$dotnetExe = Join-Path $dotnetPath "dotnet.exe"
243-
$buildToolsProject = "`"$RepoRoot\buildtools\buildtools.proj`""
244-
245-
$argNoRestore = if ($norestore) { " --no-restore" } else { "" }
246-
$argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" }
247-
248-
$args = "build $buildToolsProject -c $bootstrapConfiguration -v $verbosity" + $argNoRestore + $argNoIncremental
249-
if ($binaryLog) {
250-
$logFilePath = Join-Path $LogDir "toolsBootstrapLog.binlog"
251-
$args += " /bl:`"$logFilePath`""
252-
}
253-
Exec-Console $dotnetExe $args
254-
255-
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\fslex" -Force -Recurse
256-
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\fsyacc" -Force -Recurse
257-
Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\AssemblyCheck" -Force -Recurse
258243

259244
# prepare compiler
260-
$protoProject = "`"$RepoRoot\proto.sln`""
261-
$args = "build $protoProject -c $bootstrapConfiguration -v $verbosity " + $argNoRestore + $argNoIncremental
245+
$projectpath = "$RepoRoot" + "proto.proj"
246+
$args = "publish $projectpath -c $bootstrapConfiguration"
262247
if ($binaryLog) {
263-
$logFilePath = Join-Path $LogDir "protoBootstrapLog.binlog"
248+
$logFilePath = Join-Path $LogDir "bootstrap.binlog"
264249
$args += " /bl:`"$logFilePath`""
265250
}
251+
Write-Host "$dotnetExe $args"
266252
Exec-Console $dotnetExe $args
267-
268-
Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsc" -Force -Recurse
269-
Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsi" -Force -Recurse
270-
271253
return $dir
272254
}

0 commit comments

Comments
 (0)