Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcebuild perf perhaps #16860

Merged
merged 29 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
eab73df
Sourcebuild perf
KevinRansom Mar 12, 2024
a824ded
proto
KevinRansom Apr 1, 2024
d6af111
publish
KevinRansom Apr 1, 2024
ac784a1
tweak
KevinRansom Apr 1, 2024
02cb3a9
baseline
KevinRansom Apr 1, 2024
585e678
tweak
KevinRansom Apr 1, 2024
7a3967d
fix publish framework
KevinRansom Apr 2, 2024
94bef8e
temp
KevinRansom Apr 3, 2024
ccaaf10
temp
KevinRansom Apr 4, 2024
ee0b13a
temp
KevinRansom Apr 4, 2024
f8c892c
publish
KevinRansom Apr 4, 2024
7568fa6
props
KevinRansom Apr 4, 2024
f7d6e6e
Merge branch 'main' into investigatebuild
KevinRansom Apr 5, 2024
db64fff
UseCurrentRuntimeIdentifier
KevinRansom Apr 5, 2024
4b389df
oops
KevinRansom Apr 5, 2024
48f8d22
publishing.props
KevinRansom Apr 5, 2024
b17c0d0
BUILDING_USING_DOTNET
KevinRansom Apr 5, 2024
f16faa0
Merge branch 'main' into investigatebuild
KevinRansom Apr 8, 2024
bc98e89
Merge branch 'main' into investigatebuild
KevinRansom Apr 8, 2024
ce73646
fsharpqa and ngen
KevinRansom Apr 9, 2024
d90187f
Reqork -norealsig
KevinRansom Apr 11, 2024
fa209c3
update yaml
KevinRansom Apr 12, 2024
aa7cc16
merge
KevinRansom Apr 12, 2024
ca36628
revert realsig changes
KevinRansom Apr 26, 2024
61dbd3f
Merge branch 'main' into investigatebuild
KevinRansom Apr 26, 2024
cda3c71
Merge branch 'main' into investigatebuild
KevinRansom Apr 29, 2024
05c06ea
Merge branch 'main' into investigatebuild
KevinRansom May 7, 2024
1189350
Merge branch 'main' into investigatebuild
psfinaki May 7, 2024
9349fd2
SourceBuild prebuilt baseline
KevinRansom May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore %*"
powershell -ExecutionPolicy ByPass -NoProfile -command "Measure-Command { & """%~dp0eng\build.ps1""" -build -restore %* } | Select-Object TotalMinutes, TotalSeconds"
19 changes: 6 additions & 13 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,11 @@
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'false' and '$(DotnetProjInfo)' == 'true'">
<BUILDING_USING_DOTNET>true</BUILDING_USING_DOTNET>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'true'">
<!--
When shipping Build fsharp.compiler.service dll using realsig visibility
When testing we have a test pass built using old style visibility to improve
testing coverage.

Don't use it explicitly when building with plain .NET (without Proto or Arcade).
-->
<OtherFlags Condition="'$(Configuration)' != 'Proto' and '$(TestingLegacyInternalSignature)' != 'true'">$(OtherFlags) --realsig-</OtherFlags>
<OtherFlags Condition="'$(Configuration)' != 'Proto' and '$(TestingLegacyInternalSignature)' == 'true'">$(OtherFlags) --realsig+</OtherFlags>

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

<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition="Exists('$(RepoRoot)/Directory.Build.props.user')" />
Expand All @@ -46,8 +39,8 @@
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
<!-- Note, that default framework is used here (the one we use for development in the current cycle),
since it's a non-arcade and non-sourcebuild scenario -->
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fslex.dll</FsLexPath>
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fsyacc.dll</FsYaccPath>
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fslex.dll</FsLexPath>
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fsyacc.dll</FsYaccPath>
<DefineConstants>NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)/eng/Versions.props" Condition="'$(DISABLE_ARCADE)' == 'true'" />
Expand Down
8 changes: 8 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
<Import Project="FSharpTests.Directory.Build.targets" Condition = " '$(FSharpTestCompilerVersion)' != '' "/>
<Import Project="CoordinateXliff.targets" Condition = " '$(FSharpBuildAssemblyFile)' != '' and '$(XliffTasksAssembly)' != '' "/>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<!-- Note, that default framework is used here (the one we use for development in the current cycle),
since it's a non-arcade and non-sourcebuild scenario -->
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fslex.dll</FsLexPath>
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fsyacc.dll</FsYaccPath>
</PropertyGroup>

<ItemGroup Condition="'$(UnitTestType)' == 'nunit'">
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnit3TestAdapterVersion)" />
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVersion)" />
Expand Down
1 change: 0 additions & 1 deletion FSharpBuild.Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

Expand Down
14 changes: 7 additions & 7 deletions Microsoft.FSharp.Compiler.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32113.165
VisualStudioVersion = 17.10.34710.37
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.fsproj", "{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Microsoft.FSharp.Compiler", "src\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.fsproj", "{196088D5-ED51-4A42-9B80-F0014D1ED28C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}.Release|Any CPU.Build.0 = Release|Any CPU
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{196088D5-ED51-4A42-9B80-F0014D1ED28C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6FF31C5A-ED51-45C2-A405-5534CB7D283C}
SolutionGuid = {CBCFE753-E7C1-4FFB-9F8F-26B50E5910E4}
EndGlobalSection
EndGlobal
34 changes: 0 additions & 34 deletions Proto.sln

This file was deleted.

4 changes: 2 additions & 2 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ stages:
- checkout: self
clean: true

- script: eng\CIBuild.cmd -compressallmetadata -norealsig -testCoreclr -configuration Release
- script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testCoreclr -configuration Release
env:
NativeToolsOnMachine: true
displayName: Build
Expand Down Expand Up @@ -385,7 +385,7 @@ stages:
- checkout: self
clean: true

- script: eng\CIBuild.cmd -compressallmetadata -norealsig -testDesktop -configuration Release
- script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release
env:
NativeToolsOnMachine: true
displayName: Build
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/eng/build.sh" --build --restore $@
time "$scriptroot/eng/build.sh" --build --restore $@
8 changes: 6 additions & 2 deletions buildtools/AssemblyCheck/AssemblyCheck.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
<OutputType>Exe</OutputType>
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>

<PropertyGroup>
<PublishReadyToRun>true</PublishReadyToRun>
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
<Compile Include="AssemblyCheck.fs" />
<Content Include="SkipVerifyEmbeddedPdb.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

Expand Down
35 changes: 0 additions & 35 deletions buildtools/buildtools.proj

This file was deleted.

6 changes: 5 additions & 1 deletion buildtools/fslex/fslex.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
<OutputType>Exe</OutputType>
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
</PropertyGroup>

<PropertyGroup>
<PublishReadyToRun>true</PublishReadyToRun>
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
<Compile Include="Lexing.fsi" />
<Compile Include="Lexing.fs" />
Expand Down
6 changes: 5 additions & 1 deletion buildtools/fsyacc/fsyacc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
<OutputType>Exe</OutputType>
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
</PropertyGroup>

<PropertyGroup>
<PublishReadyToRun>true</PublishReadyToRun>
T-Gro marked this conversation as resolved.
Show resolved Hide resolved
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
<Compile Include="Lexing.fsi" />
<Compile Include="Lexing.fs" />
Expand Down
16 changes: 8 additions & 8 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ param (
# Options
[switch][Alias('proto')]$bootstrap,
[string]$bootstrapConfiguration = "Proto",
[string]$bootstrapTfm = "net472",
[string]$bootstrapTfm = "net8.0",
[string]$fsharpNetCoreProductTfm = "net8.0",
[switch][Alias('bl')]$binaryLog = $true,
[switch][Alias('nobl')]$excludeCIBinaryLog = $false,
Expand Down Expand Up @@ -69,7 +69,7 @@ param (
[switch]$sourceBuild,
[switch]$skipBuild,
[switch]$compressAllMetadata,
[switch]$norealsig,
[switch]$buildnorealsig,
[switch]$verifypackageshipstatus = $false,
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)

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

if ($norealsig) {
$script:realsig = $False;
if ($buildnorealsig) {
$script:buildnorealsig = $True;
}
else {
$script:realsig = $True;
$script:buildnorealsig = $False;
}
if ($verifypackageshipstatus) {
$script:verifypackageshipstatus = $True;
Expand Down Expand Up @@ -296,7 +296,7 @@ function BuildSolution([string] $solutionName, $nopack) {
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:DotNetBuildFromSource=$sourceBuild `
/p:CompressAllMetadata=$CompressAllMetadata `
/p:TestingLegacyInternalSignature=$realsig `
/p:BuildNoRealsig=$buildnorealsig `
/v:$verbosity `
$suppressExtensionDeployment `
@properties
Expand Down Expand Up @@ -552,7 +552,7 @@ try {
}

$script:BuildMessage = "Failure building product"
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild) {
if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild -and -not $sourceBuild) {
KevinRansom marked this conversation as resolved.
Show resolved Hide resolved
if ($noVisualStudio) {
BuildSolution "FSharp.sln" $False
}
Expand Down
11 changes: 11 additions & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<Project>

<ItemGroup>
<!--
Additional packages needed to avoid prebuilts in VMR - https://github.com/dotnet/source-build/issues/4203
-->
<ItemsToPushToBlobFeed Include="$(ArtifactsPackagesDir)Dependency\**\*.nupkg"
IsShipping="true"
UploadPathSegment="Runtime"
Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

<PropertyGroup>
<PublishingVersion>3</PublishingVersion>
</PropertyGroup>
Expand Down
8 changes: 8 additions & 0 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<UsagePattern IdentityGlob="System.Diagnostics.EventLog/7.0.0" />
<UsagePattern IdentityGlob="System.Security.Cryptography.ProtectedData/7.0.0" />

<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.linux-x64/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.win-x64/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Host.win-x64/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.win-x64/8.0.1" />
vzarytovskii marked this conversation as resolved.
Show resolved Hide resolved


<!-- Tracked in https://github.com/dotnet/source-build/issues/3438 -->
<UsagePattern IdentityGlob="Microsoft.VisualStudio.Setup.Configuration.Interop/3.2.2146" />
</IgnorePatterns>
Expand Down
26 changes: 4 additions & 22 deletions eng/build-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -240,33 +240,15 @@ function Make-BootstrapBuild() {
# prepare FsLex and Fsyacc and AssemblyCheck
$dotnetPath = InitializeDotNetCli
$dotnetExe = Join-Path $dotnetPath "dotnet.exe"
$buildToolsProject = "`"$RepoRoot\buildtools\buildtools.proj`""

$argNoRestore = if ($norestore) { " --no-restore" } else { "" }
$argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" }

$args = "build $buildToolsProject -c $bootstrapConfiguration -v $verbosity" + $argNoRestore + $argNoIncremental
if ($binaryLog) {
$logFilePath = Join-Path $LogDir "toolsBootstrapLog.binlog"
$args += " /bl:`"$logFilePath`""
}
Exec-Console $dotnetExe $args

Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\fslex" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\fsyacc" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\$fsharpNetCoreProductTfm" -Destination "$dir\AssemblyCheck" -Force -Recurse

# prepare compiler
$protoProject = "`"$RepoRoot\proto.sln`""
$args = "build $protoProject -c $bootstrapConfiguration -v $verbosity " + $argNoRestore + $argNoIncremental
$projectpath = "$RepoRoot" + "proto.proj"
$args = "publish $projectpath -c $bootstrapConfiguration"
if ($binaryLog) {
$logFilePath = Join-Path $LogDir "protoBootstrapLog.binlog"
$logFilePath = Join-Path $LogDir "bootstrap.binlog"
$args += " /bl:`"$logFilePath`""
}
Write-Host "$dotnetExe $args"
Exec-Console $dotnetExe $args

Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsc" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsi" -Force -Recurse

return $dir
}
Loading
Loading