Skip to content

Commit

Permalink
Default to .NET9 (#17426)
Browse files Browse the repository at this point in the history
  • Loading branch information
vzarytovskii authored Jul 23, 2024
1 parent 8ac35dc commit 08f8476
Show file tree
Hide file tree
Showing 217 changed files with 4,078 additions and 5,952 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
},
"remoteEnv": {
"TARGET": "net8.0"
"TARGET": "net9.0"
},
"postCreateCommand": [ "dotnet", "build", "FSharp.Compiler.Service.sln"]
}
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// TODO: Shall we assume that it's already been built, or build it every time we debug?
"preLaunchTask": "${defaultBuildTask}",
// If you have changed target frameworks, make sure to update the program p
"program": "${workspaceFolder}/artifacts/bin/fsi/Debug/net8.0/fsi.dll",
"program": "${workspaceFolder}/artifacts/bin/fsi/Debug/net9.0/fsi.dll",
"args": [
"${input:fsiArgsPrompt}"
],
Expand Down Expand Up @@ -53,7 +53,7 @@
// TODO: Shall we assume that it's already been built, or build it every time we debug?
"preLaunchTask": "${defaultBuildTask}",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/artifacts/bin/fsc/Debug/net8.0/fsc.dll",
"program": "${workspaceFolder}/artifacts/bin/fsc/Debug/net9.0/fsc.dll",
"args": [
"--targetprofile:netstandard",
"--simpleresolution",
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"Speedscope",
"--",
"dotnet",
"${workspaceFolder}/artifacts/bin/fsi/Debug/net8.0/fsi.dll",
"${workspaceFolder}/artifacts/bin/fsi/Debug/net9.0/fsi.dll",
"${input:fsiArgsPrompt}"
],
"problemMatcher": "$msCompile",
Expand All @@ -118,7 +118,7 @@
"Speedscope",
"--",
"dotnet",
"${workspaceFolder}/artifacts/bin/fsc/Debug/net8.0/fsc.dll",
"${workspaceFolder}/artifacts/bin/fsc/Debug/net9.0/fsc.dll",
"--targetprofile:netstandard",
"--simpleresolution",
"${input:fscArgsPrompt}"
Expand Down
2 changes: 1 addition & 1 deletion DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ To use your custom build of `Fsc`, add the `DotnetFscCompilerPath` property to y

```xml
<PropertyGroup>
<DotnetFscCompilerPath>D:\Git\fsharp\artifacts\bin\fsc\Debug\net8.0\fsc.dll</DotnetFscCompilerPath>
<DotnetFscCompilerPath>D:\Git\fsharp\artifacts\bin\fsc\Debug\net9.0\fsc.dll</DotnetFscCompilerPath>
</PropertyGroup>
```

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<LangVersion Condition="'$(FSharpLangVersion)' != ''">$(FSharpLangVersion)</LangVersion>
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<FSharpNetCoreProductDefaultTargetFramework>net8.0</FSharpNetCoreProductDefaultTargetFramework>
<FSharpNetCoreProductDefaultTargetFramework>net9.0</FSharpNetCoreProductDefaultTargetFramework>
</PropertyGroup>

<!--
Expand Down
6 changes: 3 additions & 3 deletions UseLocalCompiler.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableAutoSetFscCompilerPath>true</DisableAutoSetFscCompilerPath>

<DotnetFscCompilerPath>$(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net8.0/fsc.dll</DotnetFscCompilerPath>
<Fsc_DotNET_DotnetFscCompilerPath>$(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net8.0/fsc.dll</Fsc_DotNET_DotnetFscCompilerPath>
<DotnetFscCompilerPath>$(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net9.0/fsc.dll</DotnetFscCompilerPath>
<Fsc_DotNET_DotnetFscCompilerPath>$(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net9.0/fsc.dll</Fsc_DotNET_DotnetFscCompilerPath>

<FSharpPreferNetFrameworkTools>False</FSharpPreferNetFrameworkTools>
<FSharpPrefer64BitTools>True</FSharpPrefer64BitTools>

<LocalFSharpBuildBinPath>$(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net8.0</LocalFSharpBuildBinPath>
<LocalFSharpBuildBinPath>$(LocalFSharpCompilerPath)/artifacts/bin/fsc/$(LocalFSharpCompilerConfiguration)/net9.0</LocalFSharpBuildBinPath>
<FSharpBuildAssemblyFile>$(LocalFSharpBuildBinPath)/FSharp.Build.dll</FSharpBuildAssemblyFile>
<FSharpTargetsPath>$(LocalFSharpBuildBinPath)/Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpPropsShim>$(LocalFSharpBuildBinPath)/Microsoft.FSharp.NetSdk.props</FSharpPropsShim>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="$(MSBuildProjectDirectory)\..\..\eng\Versions.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<CachePath>$(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid())</CachePath>
<OutputPath>$(CachePath)\bin</OutputPath>
Expand Down
6 changes: 3 additions & 3 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ param (
# Options
[switch][Alias('proto')]$bootstrap,
[string]$bootstrapConfiguration = "Proto",
[string]$bootstrapTfm = "net8.0",
[string]$fsharpNetCoreProductTfm = "net8.0",
[string]$bootstrapTfm = "net9.0",
[string]$fsharpNetCoreProductTfm = "net9.0",
[switch][Alias('bl')]$binaryLog = $true,
[switch][Alias('nobl')]$excludeCIBinaryLog = $false,
[switch][Alias('nolog')]$noBinaryLog = $false,
Expand Down Expand Up @@ -80,7 +80,7 @@ $BuildCategory = ""
$BuildMessage = ""

$desktopTargetFramework = "net472"
$coreclrTargetFramework = "net8.0"
$coreclrTargetFramework = "net9.0"

function Print-Usage() {
Write-Host "Common settings:"
Expand Down
1 change: 1 addition & 0 deletions eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

<PropertyGroup>
<SourceBuildBootstrapTfmArg Condition="$(SourceBuildBootstrapTfm) != ''">--tfm $(SourceBuildBootstrapTfm)</SourceBuildBootstrapTfmArg>
<SourceBuildUseMonoRuntime Condition="'$(SourceBuildUseMonoRuntime)' == ''">false</SourceBuildUseMonoRuntime>
</PropertyGroup>

<!-- this runs the source-build bootstrap path as described in https://github.com/dotnet/fsharp/blob/95df49e380ea8dbf33653fa4209f89dba29413f5/eng/build.sh#L247
Expand Down
6 changes: 3 additions & 3 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<UsagePattern IdentityGlob="System.Resources.Extensions/8.0.0" />
<UsagePattern IdentityGlob="System.Diagnostics.DiagnosticSource/8.0.0" />

<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.linux-x64/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/8.0.*" />
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Runtime.linux-x64/9.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/9.0.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/9.0.*" />

<!-- Tracked in https://github.com/dotnet/source-build/issues/3438 -->
<UsagePattern IdentityGlob="Microsoft.VisualStudio.Setup.Configuration.Interop/3.2.2146" />
Expand Down
14 changes: 10 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,23 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24311.3">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24352.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c214b6ad17aedca4fa48294d80f6c52ef2463081</Sha>
<Sha>4a7d983f833d6b86365ea1b2b4d6ee72fbdbf944</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24352.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>4a7d983f833d6b86365ea1b2b4d6ee72fbdbf944</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23475.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23475.1"
CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
<Uri>https://github.com/dotnet/xliff-tasks</Uri>
<Sha>73f0850939d96131c28cf6ea6ee5aacb4da0083a</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.xliff-tasks" Version="1.0.0-beta.23475.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
<Dependency Name="Microsoft.SourceBuild.Intermediate.xliff-tasks" Version="1.0.0-beta.23475.1">
<Uri>https://github.com/dotnet/xliff-tasks</Uri>
<Sha>73f0850939d96131c28cf6ea6ee5aacb4da0083a</Sha>
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
Expand Down
2 changes: 1 addition & 1 deletion eng/build-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $nodeReuse = if (Test-Path variable:nodeReuse) { $nodeReuse } else { $false }
$bootstrapDir = if (Test-Path variable:bootstrapDir) { $bootstrapDir } else { "" }
$bootstrapConfiguration = if (Test-Path variable:bootstrapConfiguration) { $bootstrapConfiguration } else { "Proto" }
$bootstrapTfm = if (Test-Path variable:bootstrapTfm) { $bootstrapTfm } else { "net472" }
$fsharpNetCoreProductTfm = if (Test-Path variable:fsharpNetCoreProductTfm) { $fsharpNetCoreProductTfm } else { "net8.0" }
$fsharpNetCoreProductTfm = if (Test-Path variable:fsharpNetCoreProductTfm) { $fsharpNetCoreProductTfm } else { "net9.0" }
$properties = if (Test-Path variable:properties) { $properties } else { @() }

function GetProjectOutputBinary([string]$fileName, [string]$projectName = "", [string]$configuration = $script:configuration, [string]$tfm = "net472", [string]$rid = "", [bool]$published = $false) {
Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ properties=""
docker=false
args=""

tfm="net8.0" # This needs to be changed every time it's bumped by arcade/us.
tfm="net9.0" # This needs to be changed every time it's bumped by arcade/us.

BuildCategory=""
BuildMessage=""
Expand Down
52 changes: 28 additions & 24 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
# under <packageSourceCredentials> for each Maestro managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
# This script needs to be called in every job that will restore packages and which the base repo has
# private AzDO feeds in the NuGet.config.
#
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
#
# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing
# See example call for this script below.
#
# - task: PowerShell@2
# displayName: Setup Private Feeds Credentials
Expand All @@ -21,11 +14,18 @@
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
#
# Note that the NuGetAuthenticate task should be called after SetupNugetSources.
# This ensures that:
# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt)
# - The credential provider is installed.
#
# This logic is also abstracted into enable-internal-sources.yml.

[CmdletBinding()]
param (
[Parameter(Mandatory = $true)][string]$ConfigFile,
[Parameter(Mandatory = $true)][string]$Password
$Password
)

$ErrorActionPreference = "Stop"
Expand All @@ -48,11 +48,17 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Usern
else {
Write-Host "Package source $SourceName already present."
}

AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd
}

# Add a credential node for the specified source
function AddCredential($creds, $source, $username, $pwd) {
# If no cred supplied, don't do anything.
if (!$pwd) {
return;
}

# Looks for credential configuration for the given SourceName. Create it if none is found.
$sourceElement = $creds.SelectSingleNode($Source)
if ($sourceElement -eq $null)
Expand Down Expand Up @@ -110,11 +116,6 @@ if (!(Test-Path $ConfigFile -PathType Leaf)) {
ExitWithExitCode 1
}

if (!$Password) {
Write-PipelineTelemetryError -Category 'Build' -Message 'Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Please supply a valid PAT'
ExitWithExitCode 1
}

# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
Expand All @@ -127,11 +128,14 @@ if ($sources -eq $null) {
$doc.DocumentElement.AppendChild($sources) | Out-Null
}

# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-Null
$creds = $null
if ($Password) {
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-Null
}
}

# Check for disabledPackageSources; we'll enable any darc-int ones we find there
Expand Down Expand Up @@ -164,4 +168,4 @@ foreach ($dotnetVersion in $dotnetVersions) {
}
}

$doc.Save($filename)
$doc.Save($filename)
60 changes: 28 additions & 32 deletions eng/common/SetupNugetSources.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
#!/usr/bin/env bash

# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
#
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
# under <packageSourceCredentials> for each Maestro's managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
#
# This script needs to be called in every job that will restore packages and which the base repo has
# private AzDO feeds in the NuGet.config.
#
# See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)`
# from the AzureDevOps-Artifact-Feeds-Pats variable group.
#
# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing.
# See example call for this script below.
#
# - task: Bash@3
# displayName: Setup Private Feeds Credentials
# displayName: Setup Internal Feeds
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
# arguments: $(Build.SourcesDirectory)/NuGet.config $Token
# arguments: $(Build.SourcesDirectory)/NuGet.config
# condition: ne(variables['Agent.OS'], 'Windows_NT')
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
# - task: NuGetAuthenticate@1
#
# Note that the NuGetAuthenticate task should be called after SetupNugetSources.
# This ensures that:
# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt)
# - The credential provider is installed.
#
# This logic is also abstracted into enable-internal-sources.yml.

ConfigFile=$1
CredToken=$2
Expand All @@ -48,11 +47,6 @@ if [ ! -f "$ConfigFile" ]; then
ExitWithExitCode 1
fi

if [ -z "$CredToken" ]; then
Write-PipelineTelemetryError -category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Please supply a valid PAT"
ExitWithExitCode 1
fi

if [[ `uname -s` == "Darwin" ]]; then
NL=$'\\\n'
TB=''
Expand Down Expand Up @@ -140,18 +134,20 @@ PackageSources+="$IFS"
PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
IFS=$PrevIFS

for FeedName in ${PackageSources[@]} ; do
# Check if there is no existing credential for this FeedName
grep -i "<$FeedName>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding credentials for $FeedName."
if [ "$CredToken" ]; then
for FeedName in ${PackageSources[@]} ; do
# Check if there is no existing credential for this FeedName
grep -i "<$FeedName>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding credentials for $FeedName."

PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"
PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"

sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
fi
done
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
fi
done
fi

# Re-enable any entries in disabledPackageSources where the feed name contains darc-int
grep -i "<disabledPackageSources>" $ConfigFile
Expand Down
3 changes: 3 additions & 0 deletions eng/common/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" %*"
exit /b %ErrorLevel%
3 changes: 3 additions & 0 deletions eng/common/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Param(
[switch] $pack,
[switch] $publish,
[switch] $clean,
[switch][Alias('pb')]$productBuild,
[switch][Alias('bl')]$binaryLog,
[switch][Alias('nobl')]$excludeCIBinarylog,
[switch] $ci,
Expand Down Expand Up @@ -58,6 +59,7 @@ function Print-Usage() {
Write-Host " -sign Sign build outputs"
Write-Host " -publish Publish artifacts (e.g. symbols)"
Write-Host " -clean Clean the solution"
Write-Host " -productBuild Build the solution in the way it will be built in the full .NET product (VMR) build (short: -pb)"
Write-Host ""

Write-Host "Advanced settings:"
Expand Down Expand Up @@ -120,6 +122,7 @@ function Build {
/p:Deploy=$deploy `
/p:Test=$test `
/p:Pack=$pack `
/p:DotNetBuildRepo=$productBuild `
/p:IntegrationTest=$integrationTest `
/p:PerformanceTest=$performanceTest `
/p:Sign=$sign `
Expand Down
Loading

0 comments on commit 08f8476

Please sign in to comment.