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 19 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"
17 changes: 2 additions & 15 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@
<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>

</PropertyGroup>

<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition="Exists('$(RepoRoot)/Directory.Build.props.user')" />

Expand All @@ -46,8 +33,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
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.

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 $@
7 changes: 6 additions & 1 deletion buildtools/AssemblyCheck/AssemblyCheck.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
<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.

5 changes: 5 additions & 0 deletions buildtools/fslex/fslex.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<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
5 changes: 5 additions & 0 deletions buildtools/fsyacc/fsyacc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<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
4 changes: 2 additions & 2 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 @@ -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
}
53 changes: 21 additions & 32 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ function BuildSolution {
BUILDING_USING_DOTNET=false
BuildCategory="Build"
BuildMessage="Error preparing build"
local solution="FSharp.sln"
echo "$solution:"

InitializeToolset
local toolset_build_proj=$_InitializeToolset
Expand All @@ -238,7 +236,9 @@ function BuildSolution {
bl="/bl:\"$log_dir/Build.binlog\""
fi

local projects="$repo_root/$solution"
local projects="$repo_root/FSharp.sln"

echo "$projects:"

# https://github.com/dotnet/roslyn/issues/23736
local enable_analyzers=!$skip_analyzers
Expand All @@ -262,37 +262,26 @@ function BuildSolution {
node_reuse=false

# build bootstrap tools
# source_build=true means we are currently in the outer/wrapper source-build,
# and building bootstrap needs to wait. The source-build targets will run this
# script again without setting source_build=true when it is done setting up
# the build environment. See 'eng/SourceBuild.props'.
if [[ "$source_build" != true ]]; then
bootstrap_config=Proto
bootstrap_dir=$artifacts_dir/Bootstrap
if [[ "$force_bootstrap" == true ]]; then
rm -fr $bootstrap_dir
fi
if [ ! -f "$bootstrap_dir/fslex.dll" ]; then
local bltools=""
if [[ "$bl" != "" ]]; then
bltools=$bl+".lex.binlog"
fi
BuildMessage="Error building tools"
MSBuild "$repo_root/buildtools/buildtools.proj" /restore "$bltools" /p:Configuration=$bootstrap_config

mkdir -p "$bootstrap_dir"
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/$tfm $bootstrap_dir/fslex
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/$tfm $bootstrap_dir/fsyacc
# source_build=In source build proto does no work, except cause sourcebuild in wrapper to build
bootstrap_dir=$artifacts_dir/Bootstrap
if [[ "$force_bootstrap" == true ]]; then
rm -fr $bootstrap_dir
fi
if [ ! -f "$bootstrap_dir/fslex/fslex.dll" ]; then
local bltools=""
if [[ "$bl" != "" ]]; then
bltools=$bl+".proto.binlog"
fi
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
local bltools=""
if [[ "$bl" != "" ]]; then
bltools=$bl+".bootstrap.binlog"
fi
BuildMessage="Error building bootstrap"
MSBuild "$repo_root/Proto.sln" /restore "$bltools" /p:Configuration=$bootstrap_config
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/$tfm $bootstrap_dir/fsc

local blrestore=""
if [[ "$source_build" != "true" ]]; then
blrestore="/restore"
fi

BuildMessage="Error building tools"
local args=" publish $repo_root/proto.proj $blrestore $bltools /p:Configuration=Proto /p:ArcadeBuildFromSource=$source_build"
echo $args
"$DOTNET_INSTALL_DIR/dotnet" $args #$args || exit $?
fi

if [[ "$skip_build" != true ]]; then
Expand Down
Loading
Loading