From f5d4a34328d4f7c82e3f546dc9b62d1feff47f1c Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 9 Feb 2024 14:00:54 +0100 Subject: [PATCH 01/14] WIP: Use Arcade's NetCurrent --- Directory.Build.props | 13 +++ FSharpTests.Directory.Build.props | 6 +- buildtools/AssemblyCheck/AssemblyCheck.fsproj | 2 +- .../FSharp.Compiler.Service_notshipped.fsproj | 4 +- buildtools/fslex/fslex.fsproj | 2 +- buildtools/fsyacc/fsyacc.fsproj | 2 +- eng/Build.ps1 | 79 ++++++++++--------- eng/build-utils.ps1 | 6 +- eng/build.sh | 12 +-- eng/test-determinism.ps1 | 1 + .../EditorService/EditorService.fsproj | 2 +- src/Compiler/FSharp.Compiler.Service.fsproj | 6 +- src/Compiler/Facilities/CompilerLocation.fs | 1 + .../Microsoft.FSharp.Compiler.fsproj | 3 +- .../Microsoft.FSharp.Compiler.nuspec | 28 +++---- src/fsc/fscProject/fsc.fsproj | 6 +- src/fsi/fsiProject/fsi.fsproj | 6 +- .../FSharp.Build.UnitTests.fsproj | 4 +- .../FSharp.Compiler.ComponentTests.fsproj | 4 +- ...ompiler.Private.Scripting.UnitTests.fsproj | 4 +- .../FSharp.Compiler.Service.Tests.fsproj | 4 +- .../FSharp.Compiler.UnitTests.fsproj | 4 +- .../FSharp.Core.UnitTests.fsproj | 4 +- .../FSharp.Test.Utilities.fsproj | 4 +- tests/fsharp/FSharpSuite.Tests.fsproj | 4 +- 25 files changed, 115 insertions(+), 96 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a1b18784e9..23a57c4da8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,6 +24,7 @@ + net8.0 true true false @@ -36,6 +37,18 @@ $(ArtifactsDir)/bin/fsyacc/$(Configuration)/net8.0/fsyacc.dll + + + + + $(NetCurrent) + + diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 03c26b4b07..2be5d4f270 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -22,18 +22,18 @@ $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net8.0\fsc.dll + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(FSharpNetCoreProductTargetFramework)\fsc.dll $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net8.0\fsi.dll + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\$(FSharpNetCoreProductTargetFramework)\fsi.dll <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472 - <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">net8.0 + <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">$(FSharpNetCoreProductTargetFramework) <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework) $(_FSharpBuildBinPath)\FSharp.Build.dll diff --git a/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/buildtools/AssemblyCheck/AssemblyCheck.fsproj index 46ffb722cd..1f01406c73 100644 --- a/buildtools/AssemblyCheck/AssemblyCheck.fsproj +++ b/buildtools/AssemblyCheck/AssemblyCheck.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true false diff --git a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj index 514b1f4ddf..8a0874bff6 100644 --- a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj +++ b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj @@ -1,9 +1,9 @@  - + - net8.0 + $(FSharpNetCoreProductTargetFramework) true $(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid()) $(CachePath)\bin diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj index 674dde7c75..50c1e4e366 100644 --- a/buildtools/fslex/fslex.fsproj +++ b/buildtools/fslex/fslex.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true false LatestMajor diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj index fc072b7cf0..0cc67482b3 100644 --- a/buildtools/fsyacc/fsyacc.fsproj +++ b/buildtools/fsyacc/fsyacc.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true false LatestMajor diff --git a/eng/Build.ps1 b/eng/Build.ps1 index fe7eb56a5b..6e0a9bf980 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -76,6 +76,9 @@ $ErrorActionPreference = "Stop" $BuildCategory = "" $BuildMessage = "" +$desktopTargetFramework = "net472" +$coreclrTargetFramework = "net8.0" + function Print-Usage() { Write-Host "Common settings:" Write-Host " -configuration Build configuration: 'Debug' or 'Release' (short: -c)" @@ -229,11 +232,11 @@ function Process-Arguments() { function Update-Arguments() { if ($script:noVisualStudio) { - $script:bootstrapTfm = "net8.0" + $script:bootstrapTfm = $script:coreclrTargetFramework $script:msbuildEngine = "dotnet" } - if ($bootstrapTfm -eq "net8.0") { + if ($bootstrapTfm -eq $script:coreclrTargetFramework) { if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) { $script:bootstrap = $True } @@ -255,7 +258,7 @@ function BuildSolution([string] $solutionName, $nopack) { $officialBuildId = if ($official) { $env:BUILD_BUILDNUMBER } else { "" } $toolsetBuildProj = InitializeToolset $quietRestore = !$ci - $testTargetFrameworks = if ($testCoreClr) { "net8.0" } else { "" } + $testTargetFrameworks = if ($testCoreClr) { $script:coreclrTargetFramework } else { "" } # Do not set the property to true explicitly, since that would override value projects might set. $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } @@ -312,8 +315,8 @@ function UpdatePath() { } TestAndAddToPath $subdir - TestAndAddToPath "$ArtifactsDir\bin\fsc\$configuration\net472" - TestAndAddToPath "$ArtifactsDir\bin\fsiAnyCpu\$configuration\net472" + TestAndAddToPath "$ArtifactsDir\bin\fsc\$configuration\$script:desktopTargetFramework" + TestAndAddToPath "$ArtifactsDir\bin\fsiAnyCpu\$configuration\$script:desktopTargetFramework" } function VerifyAssemblyVersionsAndSymbols() { @@ -565,18 +568,16 @@ try { $script:BuildCategory = "Test" $script:BuildMessage = "Failure running tests" - $desktopTargetFramework = "net472" - $coreclrTargetFramework = "net8.0" if ($testCoreClr) { - $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true + $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" # Collect output from background jobs Wait-job $bgJob | out-null @@ -584,14 +585,14 @@ try { } if ($testDesktop) { - $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true + $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" # Collect output from background jobs Wait-job $bgJob | out-null @@ -609,7 +610,7 @@ try { UpdatePath $env:HOSTED_COMPILER = 1 $env:CSC_PIPE = "$nugetPackages\Microsoft.Net.Compilers\4.3.0-1.22220.8\tools\csc.exe" - $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\net472\FSharp.Core.dll" + $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\$script:desktopTargetFramework\FSharp.Core.dll" $env:LINK_EXE = "$RepoRoot\tests\fsharpqa\testenv\bin\link\link.exe" $env:OSARCH = $env:PROCESSOR_ARCHITECTURE @@ -626,46 +627,46 @@ try { } if ($testFSharpCore) { - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" } if ($testCompiler) { - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" } if ($testCompilerComponentTests) { - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true } if ($testCompilerService) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" } if ($testCambridge) { - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" + TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" + TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" } if ($testScripting) { - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" } if ($testVs -and -not $noVisualStudio) { - TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" - TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\" + TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" + TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\" } if ($testIntegration) { - TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" + TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" } if ($testAOT) { diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index a0c5299cb9..e243714d75 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -251,9 +251,9 @@ function Make-BootstrapBuild() { } Exec-Console $dotnetExe $args - Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\net8.0" -Destination "$dir\fslex" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\net8.0" -Destination "$dir\fsyacc" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\net8.0" -Destination "$dir\AssemblyCheck" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fslex" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsyacc" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\AssemblyCheck" -Force -Recurse # prepare compiler $protoProject = "`"$RepoRoot\proto.sln`"" diff --git a/eng/build.sh b/eng/build.sh index b8915397d2..b8e129d856 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -72,6 +72,8 @@ properties="" docker=false args="" +tfm="net8.0" # This needs to be changed every time it's bumped by arcade/us. + BuildCategory="" BuildMessage="" @@ -269,8 +271,8 @@ function BuildSolution { MSBuild "$repo_root/buildtools/buildtools.proj" /restore "$bltools" /p:Configuration=$bootstrap_config mkdir -p "$bootstrap_dir" - cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net8.0 $bootstrap_dir/fslex - cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net8.0 $bootstrap_dir/fsyacc + cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/$tfm $bootstrap_dir/fslex + cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/$tfm $bootstrap_dir/fsyacc fi if [ ! -f "$bootstrap_dir/fsc.exe" ]; then local bltools="" @@ -279,7 +281,7 @@ function BuildSolution { fi BuildMessage="Error building bootstrap" MSBuild "$repo_root/Proto.sln" /restore "$bltools" /p:Configuration=$bootstrap_config - cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net8.0 $bootstrap_dir/fsc + cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/$tfm $bootstrap_dir/fsc fi fi @@ -321,7 +323,7 @@ InitializeDotNetCli $restore BuildSolution if [[ "$test_core_clr" == true ]]; then - coreclrtestframework=net8.0 + coreclrtestframework=$tfm TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework --notestfilter TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework @@ -331,7 +333,7 @@ if [[ "$test_core_clr" == true ]]; then fi if [[ "$test_compilercomponent_tests" == true ]]; then - coreclrtestframework=net8.0 + coreclrtestframework=$tfm TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter fi diff --git a/eng/test-determinism.ps1 b/eng/test-determinism.ps1 index 5b9a079f07..8e01385de7 100644 --- a/eng/test-determinism.ps1 +++ b/eng/test-determinism.ps1 @@ -379,6 +379,7 @@ try { $script:bootstrapConfiguration = "Proto" $script:bootstrapTfm = "net472" + if ($script:msbuildEngine -eq "dotnet") { $script.bootstrapTfm = "net8.0" } diff --git a/fcs-samples/EditorService/EditorService.fsproj b/fcs-samples/EditorService/EditorService.fsproj index e4103999fc..214bb75afc 100644 --- a/fcs-samples/EditorService/EditorService.fsproj +++ b/fcs-samples/EditorService/EditorService.fsproj @@ -1,7 +1,7 @@  - $(FcsTargetNetFxFramework);net8.0 + $(FcsTargetNetFxFramework);$(FSharpNetCoreProductTargetFramework) true Exe false diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index dd7b6e25c1..6a52de4602 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -543,15 +543,15 @@ - TargetFramework=net8.0 + TargetFramework=$(FSharpNetCoreProductTargetFramework) compile - TargetFramework=net8.0 + TargetFramework=$(FSharpNetCoreProductTargetFramework) compile - TargetFramework=net8.0 + TargetFramework=$(FSharpNetCoreProductTargetFramework) compile diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 11f944c5f3..31b87846be 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -118,6 +118,7 @@ module internal FSharpEnvironment = |] elif typeof.Assembly.GetName().Name = "System.Private.CoreLib" then [| + "net9.0" "net8.0" "net7.0" "net6.0" diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj index a427f7006d..99fe36eece 100644 --- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj +++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj @@ -3,8 +3,9 @@ true Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) Microsoft.FSharp.Compiler.nuspec + pkgTfm=$(FSharpNetCoreProductTargetFramework) true .NET Core compatible version of the F# compiler fsc.exe. /blob/main/release-notes.md#FSharp-Tools-$(FSProductVersionReleaseNotesVersion) diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec index ca36309d5d..b294802d96 100644 --- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec +++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec @@ -4,7 +4,7 @@ $CommonMetadataElements$ en-US - + @@ -26,16 +26,16 @@ this approach gives a very small deployment. Which is kind of necessary. --> - - - - - - + + + + + + + target="lib\$pkgTfm$" /> + target="lib\$pkgTfm$" /> @@ -45,14 +45,14 @@ - + + target="lib\$pkgTfm$" /> - + target="lib\$pkgTfm$" /> + + target="lib\$pkgTfm$" /> diff --git a/src/fsc/fscProject/fsc.fsproj b/src/fsc/fscProject/fsc.fsproj index 64c4651a7f..b382709200 100644 --- a/src/fsc/fscProject/fsc.fsproj +++ b/src/fsc/fscProject/fsc.fsproj @@ -3,15 +3,15 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) x86 Debug;Release;Proto;ReleaseCompressed net472 - net8.0 + $(FSharpNetCoreProductTargetFramework) x86 diff --git a/src/fsi/fsiProject/fsi.fsproj b/src/fsi/fsiProject/fsi.fsproj index dd17f8bd53..653122fc76 100644 --- a/src/fsi/fsiProject/fsi.fsproj +++ b/src/fsi/fsiProject/fsi.fsproj @@ -3,15 +3,15 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) x86 Debug;Release;Proto;ReleaseCompressed net472 - net8.0 + $(FSharpNetCoreProductTargetFramework) x86 diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index e3c796d0bd..0a2421f326 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -3,8 +3,8 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library true xunit diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index ec4fc441f2..ebfe6938aa 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -3,8 +3,8 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library false true diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj index cdfd467e5c..8f69b337c5 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj @@ -2,8 +2,8 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library true xunit diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 780ba10f3f..59b5fc43d6 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -3,8 +3,8 @@ Exe - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) $(NoWarn);44;75; true false diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index 0e4b91b42a..dd3e21cea9 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -3,8 +3,8 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library true $(DefineConstants);ASSUME_PREVIEW_FSHARP_CORE diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 4b6c5c5348..9acbcef398 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -3,8 +3,8 @@ - net8.0;net472 - net8.0 + $(FSharpNetCoreProductTargetFramework);net472 + $(FSharpNetCoreProductTargetFramework) Library FSharp.Core.UnitTests diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 607d3fb1c4..125887fac3 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -1,8 +1,8 @@  - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) win-x86;win-x64;linux-x64;osx-x64 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 true diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index b6d69d8ae1..ac97046351 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -2,8 +2,8 @@ - net472;net8.0 - net8.0 + net472;$(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) win-x86;win-x64 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 true From 02003fd9ce32ad14bdd65a25049cdc0d50cca4e8 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 9 Feb 2024 14:14:08 +0100 Subject: [PATCH 02/14] WIP: Use Arcade's NetCurrent --- Directory.Build.props | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 23a57c4da8..590c365894 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,10 +21,9 @@ true - + - net8.0 true true false @@ -37,20 +36,28 @@ $(ArtifactsDir)/bin/fsyacc/$(Configuration)/net8.0/fsyacc.dll - - + - - $(NetCurrent) - + This will likely include FCS and FSharp.Core as well ash shipped products. + Right now, it only covers producs we ship (FSC and FSI), not NuGet packages. --> + + + $(NetCurrent) + + + + + net8.0 + + + - From 902f1f76b68a4182929e142bccf743b114af5862 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 9 Feb 2024 14:24:52 +0100 Subject: [PATCH 03/14] Ordering of property groups --- Directory.Build.props | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 590c365894..ffc586b640 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -23,19 +23,6 @@ - - true - true - false - true - true - $(MSBuildThisFileDirectory)artifacts/ - $(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/ - $(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/ - $(ArtifactsDir)/bin/fslex/$(Configuration)/net8.0/fslex.dll - $(ArtifactsDir)/bin/fsyacc/$(Configuration)/net8.0/fsyacc.dll - - - - - - - - + + + + + + + target="lib\$fSharpNetCoreProductTargetFramework$" /> + target="lib\$fSharpNetCoreProductTargetFramework$" /> @@ -45,14 +45,14 @@ - + + target="lib\$fSharpNetCoreProductTargetFramework$" /> - + target="lib\$fSharpNetCoreProductTargetFramework$" /> + + target="lib\$fSharpNetCoreProductTargetFramework$" /> From 155e1661128c63d56e057306158d23c8bc8660c4 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Fri, 9 Feb 2024 15:39:57 -0600 Subject: [PATCH 08/14] Updates to support VMR build --- Directory.Build.props | 42 +++++++++++++++++++++--------------------- eng/SourceBuild.props | 2 +- eng/build.sh | 5 +++++ 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index ffc586b640..147c2683ed 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -23,27 +23,6 @@ - - - - - - $(NetCurrent) - - - - - net8.0 - - - - true true @@ -65,5 +44,26 @@ + + + + + + + $(NetCurrent) + + + + + net8.0 + + + diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 3ac9370d1a..d723cd7e4a 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -33,7 +33,7 @@ -bl enables the binlogs for the tools and Proto builds, which make debugging failures here easier --> diff --git a/eng/build.sh b/eng/build.sh index b8e129d856..6e5d09b79d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -34,6 +34,7 @@ usage() echo " --skipBuild Do not run the build" echo " --prepareMachine Prepare machine for CI run, clean up processes after build" echo " --sourceBuild Simulate building for source-build" + echo " --tfm Override the default target framework" echo "" echo "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -151,6 +152,10 @@ while [[ $# > 0 ]]; do --sourcebuild) source_build=true ;; + --tfm) + tfm=$2 + shift + ;; /p:*) properties="$properties $1" ;; From 7973c7c776604e6c721bb7c7b05537a49edf495a Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Fri, 9 Feb 2024 16:22:31 -0600 Subject: [PATCH 09/14] Only set tfm option if SourceBuildBootstrapTfm is set --- eng/SourceBuild.props | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index d723cd7e4a..550215bd64 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -24,6 +24,10 @@ + + + --tfm $(SourceBuildBootstrapTfm) + From f0e7c271ebd65cbb15179ade0c7e9c1679d403c4 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Feb 2024 13:32:03 +0100 Subject: [PATCH 10/14] Fix ordering, set tfm before we account for building without arcade --- Directory.Build.props | 44 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 147c2683ed..d6ba0057bb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,6 +21,29 @@ true + + + + + + $(NetCurrent) + + + + + net8.0 + + + + @@ -44,26 +67,5 @@ - - - - - - - $(NetCurrent) - - - - - net8.0 - - - From 55677f2ae6cfc32f20dfc01239920afacd7db296 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Feb 2024 14:30:47 +0100 Subject: [PATCH 11/14] Add rest of test projects --- eng/DumpPackageRoot/DumpPackageRoot.csproj | 2 +- eng/test-determinism.ps1 | 4 ++-- src/Compiler/Facilities/CompilerLocation.fs | 1 - .../SelfContained_Trimming_Test.fsproj | 6 +++--- .../StaticLinkedFSharpCore_Trimming_Test.fsproj | 6 +++--- .../BasicProvider.DesignTime.fsproj | 2 +- .../BasicProvider.Tests/BasicProvider.Tests.fsproj | 2 +- .../BasicProvider/BasicProvider/BasicProvider.fsproj | 2 +- .../MicroPerf/CS/MicroPerfCSharp.csproj | 2 +- .../CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj | 2 +- .../TaskPerf/TaskPerf/TaskPerf.fsproj | 2 +- .../TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj | 2 +- .../HistoricalBenchmark.Runner.fsproj | 2 +- .../BenchmarkComparison/HistoricalBenchmark.fsproj | 2 +- .../FSharp.Compiler.Benchmarks.fsproj | 2 +- .../FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj | 2 +- .../FSharp.Benchmarks.Common.fsproj | 2 +- .../Sample_ConsoleApp_net7.fsproj | 6 +++--- .../Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj | 6 +++--- .../LocalCompilerAndFslib.fsproj | 6 +++--- .../SelfDefinedTailCallAttribute/tailcallaltattr.fsproj | 2 +- 21 files changed, 31 insertions(+), 32 deletions(-) diff --git a/eng/DumpPackageRoot/DumpPackageRoot.csproj b/eng/DumpPackageRoot/DumpPackageRoot.csproj index 5cbfdca4db..da79505fcf 100644 --- a/eng/DumpPackageRoot/DumpPackageRoot.csproj +++ b/eng/DumpPackageRoot/DumpPackageRoot.csproj @@ -3,7 +3,7 @@ - net8.0 + $(FSharpNetCoreProductTargetFramework) diff --git a/eng/test-determinism.ps1 b/eng/test-determinism.ps1 index 8e01385de7..499c1187a0 100644 --- a/eng/test-determinism.ps1 +++ b/eng/test-determinism.ps1 @@ -378,10 +378,10 @@ try { $script:bootstrap = $true $script:bootstrapConfiguration = "Proto" $script:bootstrapTfm = "net472" - + $script:fsharpNetCoreProductTfm = "net8.0" if ($script:msbuildEngine -eq "dotnet") { - $script.bootstrapTfm = "net8.0" + $script.bootstrapTfm = $script:fsharpNetCoreProductTfm } $bootstrapDir = Make-BootstrapBuild diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 31b87846be..11f944c5f3 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -118,7 +118,6 @@ module internal FSharpEnvironment = |] elif typeof.Assembly.GetName().Name = "System.Private.CoreLib" then [| - "net9.0" "net8.0" "net7.0" "net6.0" diff --git a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj index 90842baa58..83676ad0ff 100644 --- a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) preview true @@ -16,8 +16,8 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll False True diff --git a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj index 7fd0dc7091..9cd13e4333 100644 --- a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) preview true false @@ -18,8 +18,8 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll False True diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj index b05e1882f6..ba15e56c35 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj @@ -2,7 +2,7 @@ Library - net8.0;net472 + $(FSharpNetCoreProductTargetFramework);net472 typeproviders NO_GENERATIVE IS_DESIGNTIME diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj index 5da0cbb3bf..da2c065fe4 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net8.0 + $(FSharpNetCoreProductTargetFramework) $(TestTargetFramework) false NO_GENERATIVE diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj index 96006f0667..4a8d1df230 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj @@ -2,7 +2,7 @@ Library - net8.0;net472 + $(FSharpNetCoreProductTargetFramework);net472 typeproviders $(FSharpCoreShippedPackageVersionValue) typeproviders diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj index 50bba8f6f2..168c8b546e 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj @@ -1,7 +1,7 @@ - net8.0 + $(FSharpNetCoreProductTargetFramework) Library 8.0 diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj index 919c4cc073..c96d342298 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj @@ -1,6 +1,6 @@ - net8.0 + $(FSharpNetCoreProductTargetFramework) Exe true diff --git a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj index 9706167ff6..31d404fb06 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/TaskPerf.fsproj @@ -1,7 +1,7 @@  - net8.0 + $(FSharpNetCoreProductTargetFramework) Exe true diff --git a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj index d23714e40f..29148a7450 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerfCSharp/TaskPerfCSharp.csproj @@ -1,7 +1,7 @@  - net8.0 + $(FSharpNetCoreProductTargetFramework) Library 8.0 diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj index fe6d95f905..1781b4784d 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj @@ -1,7 +1,7 @@ - net8.0 + $(FSharpNetCoreProductTargetFramework) true HistoricalBenchmark.Utilities $(NoWarn);NETSDK1206 diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj index 09ca5cb691..48cfa7b497 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true Release diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj index 043de02d37..c7a873a2cc 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true false diff --git a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj index 92255adb46..265ab45ac1 100644 --- a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj +++ b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/FCSSourceFiles.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true diff --git a/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj b/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj index 2e6b2e9ceb..615a5ab3a7 100644 --- a/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj +++ b/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj @@ -1,7 +1,7 @@  - net8.0 + $(FSharpNetCoreProductTargetFramework) true diff --git a/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj b/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj index 13d42aeb28..6fa21d9b26 100644 --- a/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj +++ b/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj @@ -2,13 +2,13 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) true - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll False True diff --git a/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj b/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj index bf06c1ce7a..94e78cddcf 100644 --- a/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj +++ b/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj @@ -2,13 +2,13 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) preview - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll False True diff --git a/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj b/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj index c2164b6566..4f47ab1a71 100644 --- a/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj +++ b/tests/projects/Sample_Local_Compiler_and_FSLib/LocalCompilerAndFslib.fsproj @@ -2,15 +2,15 @@ Exe - net8.0 + $(FSharpNetCoreProductTargetFramework) preview true true - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll - $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll False True diff --git a/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj b/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj index 92c5ae861d..45f9002aa1 100644 --- a/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj +++ b/tests/projects/misc/SelfDefinedTailCallAttribute/tailcallaltattr.fsproj @@ -7,7 +7,7 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Debug/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Debug/$(FSharpNetCoreProductTargetFramework)/fsc.dll From 74c3e531b5790bd52fbbb262a029c1d0695c9c47 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 12 Feb 2024 14:37:19 +0100 Subject: [PATCH 12/14] typos --- Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index d6ba0057bb..e4d4c4c4b9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,8 +29,8 @@ + This will likely include FCS and FSharp.Core as well as shipped products. + Right now, it only covers products we ship (FSC and FSI), not NuGet packages. --> From 0327096354687409df98cb37f2064fc51254050d Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Feb 2024 15:38:08 +0100 Subject: [PATCH 13/14] Trimming is isolated and can't use global TFM value --- .../SelfContained_Trimming_Test.fsproj | 6 +++--- .../StaticLinkedFSharpCore_Trimming_Test.fsproj | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj index 83676ad0ff..90842baa58 100644 --- a/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - $(FSharpNetCoreProductTargetFramework) + net8.0 preview true @@ -16,8 +16,8 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll False True diff --git a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj index 9cd13e4333..7fd0dc7091 100644 --- a/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj +++ b/tests/AheadOfTime/Trimming/StaticLinkedFSharpCore_Trimming_Test/StaticLinkedFSharpCore_Trimming_Test.fsproj @@ -2,7 +2,7 @@ Exe - $(FSharpNetCoreProductTargetFramework) + net8.0 preview true false @@ -18,8 +18,8 @@ - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll - $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(FSharpNetCoreProductTargetFramework)/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/net8.0/fsc.dll False True From cd7e7aa4125c0e3bf05a4d23bdebde8db2183894 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 19 Feb 2024 12:35:37 +0100 Subject: [PATCH 14/14] Fix arcade interaction with our build props --- Directory.Build.props | 59 +++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e4d4c4c4b9..497ce64113 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,12 +4,12 @@ $(FSharpLangVersion) $(MSBuildThisFileDirectory) true + net8.0 @@ -21,47 +21,50 @@ true + + + + true + true + false + true + true + $(MSBuildThisFileDirectory)artifacts/ + $(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/ + $(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/ + + $(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fslex.dll + $(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fsyacc.dll + + + + + we can utilize arcade's $(NetCurrent) property, and set it ourselves in the arcade-less scenarios. + For FCS solution, we set it to one for current dev cycle. + When used with arcade, and inserting/building for net8 branches, it will set it to net8.0, for net9 branches to net9.0 and so on. --> - + $(NetCurrent) - net8.0 + $(FSharpNetCoreProductDefaultTargetFramework) - - - - true - true - false - true - true - $(MSBuildThisFileDirectory)artifacts/ - $(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/ - $(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/ - $(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductTargetFramework)/fslex.dll - $(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductTargetFramework)/fsyacc.dll - - - - - + +