Skip to content

Commit 975e10c

Browse files
brettfobaronfel
authored andcommitted
migrate to netcoreapp3.1 (#9448)
* migrate to netcoreapp3.1 * update comments * update tool versions
1 parent 34ff477 commit 975e10c

File tree

14 files changed

+41
-41
lines changed

14 files changed

+41
-41
lines changed

FSharpTests.Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
<FscToolPath>$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))</FscToolPath>
2323
<FscToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FscToolExe>
2424
<FscToolExe Condition="'$(OS)' == 'Unix'">dotnet</FscToolExe>
25-
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp3.0\fsc.exe</DotnetFscCompilerPath>
25+
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp3.1\fsc.exe</DotnetFscCompilerPath>
2626

2727
<FsiToolPath>$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))</FsiToolPath>
2828
<FsiToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FsiToolExe>
2929
<FsiToolExe Condition="'$(OS)' == 'Unix'">dotnet</FsiToolExe>
30-
<DotnetFsiCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp3.0\fsi.exe</DotnetFsiCompilerPath>
30+
<DotnetFsiCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp3.1\fsi.exe</DotnetFsiCompilerPath>
3131
</PropertyGroup>
3232

3333
<!-- SDK targets override -->
3434
<PropertyGroup>
3535
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472</_FSharpBuildTargetFramework>
36-
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp3.0</_FSharpBuildTargetFramework>
36+
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp3.1</_FSharpBuildTargetFramework>
3737
<_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)</_FSharpBuildBinPath>
3838

3939
<FSharpBuildAssemblyFile>$(_FSharpBuildBinPath)\FSharp.Build.dll</FSharpBuildAssemblyFile>

eng/Build.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ function Process-Arguments() {
152152

153153
function Update-Arguments() {
154154
if ($script:noVisualStudio) {
155-
$script:bootstrapTfm = "netcoreapp3.0"
155+
$script:bootstrapTfm = "netcoreapp3.1"
156156
$script:msbuildEngine = "dotnet"
157157
}
158158

159-
if ($bootstrapTfm -eq "netcoreapp3.0") {
159+
if ($bootstrapTfm -eq "netcoreapp3.1") {
160160
if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) {
161161
$script:bootstrap = $True
162162
}
@@ -178,7 +178,7 @@ function BuildSolution() {
178178
$officialBuildId = if ($official) { $env:BUILD_BUILDNUMBER } else { "" }
179179
$toolsetBuildProj = InitializeToolset
180180
$quietRestore = !$ci
181-
$testTargetFrameworks = if ($testCoreClr) { "netcoreapp3.0" } else { "" }
181+
$testTargetFrameworks = if ($testCoreClr) { "netcoreapp3.1" } else { "" }
182182

183183
# Do not set the property to true explicitly, since that would override value projects might set.
184184
$suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" }
@@ -264,7 +264,7 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) {
264264
}
265265

266266
function BuildCompiler() {
267-
if ($bootstrapTfm -eq "netcoreapp3.0") {
267+
if ($bootstrapTfm -eq "netcoreapp3.1") {
268268
$dotnetPath = InitializeDotNetCli
269269
$dotnetExe = Join-Path $dotnetPath "dotnet.exe"
270270
$fscProject = "$RepoRoot\src\fsharp\fsc\fsc.fsproj"
@@ -277,14 +277,14 @@ function BuildCompiler() {
277277
$logFilePath = Join-Path $LogDir "fscBootstrapLog.binlog"
278278
$args += " /bl:$logFilePath"
279279
}
280-
$args = "build $fscProject -c $configuration -v $verbosity -f netcoreapp3.0" + $argNoRestore + $argNoIncremental
280+
$args = "build $fscProject -c $configuration -v $verbosity -f netcoreapp3.1" + $argNoRestore + $argNoIncremental
281281
Exec-Console $dotnetExe $args
282282

283283
if ($binaryLog) {
284284
$logFilePath = Join-Path $LogDir "fsiBootstrapLog.binlog"
285285
$args += " /bl:$logFilePath"
286286
}
287-
$args = "build $fsiProject -c $configuration -v $verbosity -f netcoreapp3.0" + $argNoRestore + $argNoIncremental
287+
$args = "build $fsiProject -c $configuration -v $verbosity -f netcoreapp3.1" + $argNoRestore + $argNoIncremental
288288
Exec-Console $dotnetExe $args
289289
}
290290
}
@@ -448,7 +448,7 @@ try {
448448
$script:BuildCategory = "Test"
449449
$script:BuildMessage = "Failure running tests"
450450
$desktopTargetFramework = "net472"
451-
$coreclrTargetFramework = "netcoreapp3.0"
451+
$coreclrTargetFramework = "netcoreapp3.1"
452452

453453
if ($testDesktop -and -not $noVisualStudio) {
454454
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework

eng/build-utils.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,16 @@ function Make-BootstrapBuild() {
244244
$argNoRestore = if ($norestore) { " --no-restore" } else { "" }
245245
$argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" }
246246

247-
$args = "build $buildToolsProject -c $bootstrapConfiguration -v $verbosity -f netcoreapp3.0" + $argNoRestore + $argNoIncremental
247+
$args = "build $buildToolsProject -c $bootstrapConfiguration -v $verbosity -f netcoreapp3.1" + $argNoRestore + $argNoIncremental
248248
if ($binaryLog) {
249249
$logFilePath = Join-Path $LogDir "toolsBootstrapLog.binlog"
250250
$args += " /bl:$logFilePath"
251251
}
252252
Exec-Console $dotnetExe $args
253253

254-
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp3.0" -Destination "$dir\fslex" -Force -Recurse
255-
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp3.0" -Destination "$dir\fsyacc" -Force -Recurse
256-
Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\netcoreapp3.0" -Destination "$dir\AssemblyCheck" -Force -Recurse
254+
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp3.1" -Destination "$dir\fslex" -Force -Recurse
255+
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp3.1" -Destination "$dir\fsyacc" -Force -Recurse
256+
Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\netcoreapp3.1" -Destination "$dir\AssemblyCheck" -Force -Recurse
257257

258258
# prepare compiler
259259
$protoProject = "$RepoRoot\proto.proj"

eng/build.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ function BuildSolution {
244244
/t:Publish
245245

246246
mkdir -p "$bootstrap_dir"
247-
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp3.0/publish $bootstrap_dir/fslex
248-
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp3.0/publish $bootstrap_dir/fsyacc
247+
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp3.1/publish $bootstrap_dir/fslex
248+
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp3.1/publish $bootstrap_dir/fsyacc
249249
fi
250250
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
251251
BuildMessage="Error building bootstrap"
@@ -254,7 +254,7 @@ function BuildSolution {
254254
/p:Configuration=$bootstrap_config \
255255
/t:Publish
256256

257-
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp3.0/publish $bootstrap_dir/fsc
257+
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp3.1/publish $bootstrap_dir/fsc
258258
fi
259259

260260
# do real build
@@ -293,8 +293,7 @@ InitializeDotNetCli $restore
293293
BuildSolution
294294

295295
if [[ "$test_core_clr" == true ]]; then
296-
coreclrtestframework=netcoreapp3.0
297-
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework
296+
coreclrtestframework=netcoreapp3.1
298297
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework
299298
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework
300299
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework

fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\netfx.props" />
33
<Import Project="..\..\eng\Versions.props"/> <!-- keep our test deps in line with the overall compiler -->
44
<PropertyGroup>
5-
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp3.0</TargetFrameworks>
5+
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp3.1</TargetFrameworks>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
<DefaultFSharpPackageVersion>4.1.19</DefaultFSharpPackageVersion>
88
<NoWarn>$(NoWarn);44;75;</NoWarn>
@@ -73,7 +73,7 @@
7373
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\ScriptOptionsTests.fs">
7474
<Link>ScriptOptionsTests.fs</Link>
7575
</Compile>
76-
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\Program.fs" Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
76+
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\Program.fs" Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
7777
<Link>Program.fs</Link>
7878
</Compile>
7979
<NoneSubstituteText Include="App.config">

fcs/build.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Target.create "Restore" (fun _ ->
5959

6060
Target.create "Build" (fun _ ->
6161
runDotnet __SOURCE_DIRECTORY__ "build" "../src/buildtools/buildtools.proj -v n -c Proto"
62-
let fslexPath = Path.GetFullPath <| Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fslex/Proto/netcoreapp3.1/fslex.dll")
63-
let fsyaccPath = Path.GetFullPath <| Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fsyacc/Proto/netcoreapp3.1/fsyacc.dll")
62+
let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp3.1/fslex.dll"
63+
let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp3.1/fsyacc.dll"
6464
runDotnet __SOURCE_DIRECTORY__ "build" (sprintf "FSharp.Compiler.Service.sln -nodereuse:false -v n -c Release /p:DisableCompilerRedirection=true /p:FsLexPath=%s /p:FsYaccPath=%s" fslexPath fsyaccPath)
6565
)
6666

fcs/samples/EditorService/EditorService.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\netfx.props" />
33
<PropertyGroup>
4-
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp3.1</TargetFrameworks>
55
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
66
<OutputType>Exe</OutputType>
77
<IsPackable>false</IsPackable>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"tools": {
3-
"dotnet": "3.1.200",
3+
"dotnet": "3.1.301",
44
"vs": {
5-
"version": "16.4",
5+
"version": "16.6",
66
"components": [
77
"Microsoft.VisualStudio.Component.FSharp"
88
]

proto.proj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
<ItemGroup>
99
<Projects Include="src\fsharp\FSharp.Build\FSharp.Build.fsproj">
10-
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.0</AdditionalProperties>
10+
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.1</AdditionalProperties>
1111
</Projects>
1212
<Projects Include="src\fsharp\fsc\fsc.fsproj">
13-
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.0</AdditionalProperties>
13+
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.1</AdditionalProperties>
1414
</Projects>
1515
<Projects Include="src\fsharp\fsi\fsi.fsproj">
16-
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.0</AdditionalProperties>
16+
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.1</AdditionalProperties>
1717
</Projects>
1818
</ItemGroup>
1919

src/absil/ilreflect.fs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,14 +1481,13 @@ let emitParameter cenv emEnv (defineParameter: int * ParameterAttributes * strin
14811481
// buildMethodPass2
14821482
//----------------------------------------------------------------------------
14831483

1484-
#if !FX_RESHAPED_REFEMIT || NETCOREAPP3_0
1484+
#if !FX_RESHAPED_REFEMIT || NETCOREAPP3_1
14851485

14861486
let enablePInvoke = true
14871487

14881488
#else
14891489

1490-
// We currently build targeting netcoreapp2_1, and will continue to do so through this VS cycle
1491-
// but we can run on Netcoreapp3.0 so ... use reflection to invoke the api, when we are executing on netcoreapp3.0
1490+
// Use reflection to invoke the api when we are executing on a platform that doesn't directly have this API.
14921491
let definePInvokeMethod =
14931492
typeof<TypeBuilder>.GetMethod("DefinePInvokeMethod", [|
14941493
typeof<string>
@@ -1541,13 +1540,12 @@ let rec buildMethodPass2 cenv tref (typB: TypeBuilder) emEnv (mdef: ILMethodDef)
15411540
(* p.CharBestFit *)
15421541
(* p.NoMangle *)
15431542

1544-
#if !FX_RESHAPED_REFEMIT || NETCOREAPP3_0
1545-
// DefinePInvokeMethod was removed in early versions of coreclr, it was added back in NETCORE_APP3_0.
1543+
#if !FX_RESHAPED_REFEMIT || NETCOREAPP3_1
1544+
// DefinePInvokeMethod was removed in early versions of coreclr, it was added back in NETCOREAPP3.
15461545
// It has always been available in the desktop framework
15471546
let methB = typB.DefinePInvokeMethod(mdef.Name, p.Where.Name, p.Name, attrs, cconv, rty, null, null, argtys, null, null, pcc, pcs)
15481547
#else
1549-
// We currently build targeting netcoreapp2_1, and will continue to do so through this VS cycle
1550-
// but we can run on Netcoreapp3.0 so ... use reflection to invoke the api, when we are executing on netcoreapp3.0
1548+
// Use reflection to invoke the api when we are executing on a platform that doesn't directly have this API.
15511549
let methB =
15521550
System.Diagnostics.Debug.Assert(definePInvokeMethod <> null, "Runtime does not have DefinePInvokeMethod") // Absolutely can't happen
15531551
definePInvokeMethod.Invoke(typB, [| mdef.Name; p.Where.Name; p.Name; attrs; cconv; rty; null; null; argtys; null; null; pcc; pcs |]) :?> MethodBuilder

0 commit comments

Comments
 (0)