Skip to content

Commit bb2575c

Browse files
authored
Add .NET 9 support, remove .NET 6 (#422)
1 parent 50061dd commit bb2575c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+185
-201
lines changed

.ado/publish.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trigger: none
1111
parameters:
1212
# Matrix with target build platforms.
1313
# x86 versions are not supported by Native AOT.
14-
# Use net8.0 as the latest stable version.
14+
# Use net9.0 as the latest stable version.
1515
- name: buildMatrix
1616
type: object
1717
default:
@@ -64,41 +64,41 @@ parameters:
6464
os: windows
6565
TargetRuntime: win-x64
6666
DotNetVersion: net472
67-
- Name: win_x64_net60
67+
- Name: win_x64_net80
6868
Pool:
6969
name: Azure-Pipelines-1ESPT-ExDShared
7070
vmImage: windows-latest
7171
os: windows
7272
TargetRuntime: win-x64
73-
DotNetVersion: net6.0
74-
- Name: win_x64_net80
73+
DotNetVersion: net8.0
74+
- Name: win_x64_net90
7575
Pool:
7676
name: Azure-Pipelines-1ESPT-ExDShared
7777
vmImage: windows-latest
7878
os: windows
7979
TargetRuntime: win-x64
80-
DotNetVersion: net8.0
81-
- Name: osx_x64_net80
80+
DotNetVersion: net9.0
81+
- Name: osx_x64_net90
8282
Pool:
8383
name: Azure Pipelines
8484
vmImage: macos-14
8585
os: macOS
8686
TargetRuntime: osx-x64
87-
DotNetVersion: net8.0
88-
- Name: osx_arm64_net80
87+
DotNetVersion: net9.0
88+
- Name: osx_arm64_net90
8989
Pool:
9090
name: Azure Pipelines
9191
vmImage: macos-14-arm64
9292
os: macOS
9393
TargetRuntime: osx-arm64
94-
DotNetVersion: net8.0
95-
- Name: linux_x64_net80
94+
DotNetVersion: net9.0
95+
- Name: linux_x64_net90
9696
Pool:
9797
name: Azure-Pipelines-1ESPT-ExDShared
9898
image: ubuntu-latest
9999
os: linux
100100
TargetRuntime: linux-x64
101-
DotNetVersion: net8.0
101+
DotNetVersion: net9.0
102102

103103
resources:
104104
repositories:
@@ -141,7 +141,7 @@ extends:
141141
cancelTimeoutInMinutes: 45 # to allow more time to collect CodeQL debug info.
142142

143143
variables:
144-
DotNetMoniker: net8.0
144+
DotNetMoniker: net9.0
145145
${{ if and( variables.DisableOsxArm64CodeQL, eq( MatrixEntry.TargetRuntime, 'osx-arm64' )) }}:
146146
ONEES_ENFORCED_CODEQL_ENABLED: false
147147

@@ -233,12 +233,12 @@ extends:
233233
- checkout: self
234234
displayName: Shallow git fetch
235235

236-
- ${{ if eq( MatrixEntry.DotNetVersion, 'net6.0' ) }}:
236+
- ${{ if eq( MatrixEntry.DotNetVersion, 'net8.0' ) }}:
237237
- task: UseDotNet@2
238-
displayName: Install .Net 6.0.x
238+
displayName: Install .Net 8.0.x
239239
inputs:
240240
packageType: sdk
241-
version: 6.0.x
241+
version: 8.0.x
242242

243243
- task: UseDotNet@2
244244
displayName: Install .NET SDK using global.json

.github/workflows/build.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ windows-latest, macos-latest, ubuntu-latest ]
15-
dotnet-version: [ net472, net6.0, net8.0]
16-
node-version: [ 18.x, 20.x ]
15+
dotnet-version: [ net472, net8.0, net9.0]
16+
node-version: [ 18.x, 22.x ]
1717
configuration: [ Release ]
1818
exclude:
19-
# Exclude Node 18.x on .NET < 8, to thin the matrix.
20-
- dotnet-version: net6.0
19+
# Exclude Node 18.x on .NET < 9, to thin the matrix.
20+
- dotnet-version: net8.0
2121
node-version: 18.x
2222
- dotnet-version: net472
2323
node-version: 18.x
2424
# Exclude .NET 4.x on non-Windows OS.
2525
- os: macos-latest
26-
dotnet-version: net472
26+
dotnet-version: net472
2727
- os: ubuntu-latest
2828
dotnet-version: net472
2929

@@ -36,20 +36,15 @@ jobs:
3636
with:
3737
fetch-depth: 0 # Deep clone is required for versioning on git commit height
3838

39-
- name: Link libdl.so # Required by .NET 6
40-
if: matrix.os == 'ubuntu-latest'
41-
run: sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so
42-
43-
- name: Setup .NET 6
39+
- name: Setup .NET 8
4440
uses: actions/setup-dotnet@v4
4541
with:
46-
dotnet-version: 6.0.x
42+
dotnet-version: 8.0.x
4743

48-
# The .NET 8 SDK is required even when the build matrix targets other .NET versions.
49-
- name: Setup .NET 8
44+
- name: Setup .NET 9
5045
uses: actions/setup-dotnet@v4
5146
with:
52-
dotnet-version: 8.0.x
47+
dotnet-version: 9.0.x
5348

5449
- name: Setup Node.js ${{ matrix.node-version }}
5550
uses: actions/setup-node@v4
@@ -67,7 +62,7 @@ jobs:
6762
# limit-access-to-actor: true
6863

6964
- name: Upload build artifacts
70-
if: matrix.dotnet-version == 'net8.0' && matrix.node-version == '20.x'
65+
if: matrix.dotnet-version == 'net9.0' && matrix.node-version == '22.x'
7166
uses: actions/upload-artifact@v4
7267
with:
7368
name: ${{ matrix.os }}-${{ matrix.configuration }}-packages
@@ -87,8 +82,7 @@ jobs:
8782
continue-on-error: true
8883

8984
- name: Upload test logs
90-
# upload-artifact@v4 breaks the test reporter: https://github.com/dorny/test-reporter/issues/343
91-
uses: actions/upload-artifact@v3
85+
uses: actions/upload-artifact@v4
9286
with:
9387
name: test-logs-${{ matrix.os }}-${{matrix.dotnet-version}}-node${{matrix.node-version}}-${{matrix.configuration}}
9488
path: |

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ jobs:
4747
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
4848
# queries: security-extended,security-and-quality
4949

50-
- name: Setup .NET 8
50+
- name: Setup .NET 9
5151
if: matrix.language == 'csharp'
5252
uses: actions/setup-dotnet@v4
5353
with:
54-
dotnet-version: 8.0.x
54+
dotnet-version: 9.0.x
5555

5656
- name: Build C#
5757
if: matrix.language == 'csharp'
58-
run: dotnet build -f:net8.0 -p:Configuration=Debug -p:NBGV_GitEngine=Disabled
59-
# Just build the .NET 8 target framework; other targets would be redundant for CodeQL.
58+
run: dotnet build -f:net9.0 -p:Configuration=Debug -p:NBGV_GitEngine=Disabled
59+
# Just build the .NET 9 target framework; other targets would be redundant for CodeQL.
6060
# Disable git-versioning to prevent the shallow clone from causing build errors.
6161

6262
- name: Perform CodeQL Analysis

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
- name: Setup Node.js
3737
uses: actions/setup-node@v4
3838
with:
39-
node-version: 20
39+
node-version: 22
4040
cache: npm
4141
cache-dependency-path: './docs/package-lock.json'
4242
- name: Setup .NET
4343
uses: actions/setup-dotnet@v4
4444
with:
45-
dotnet-version: 8.0.x
45+
dotnet-version: 9.0.x
4646
- name: Setup Pages
4747
uses: actions/configure-pages@v4
4848

.github/workflows/test-report.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
strategy:
1919
matrix: # This must be kept in sync with the PR build matrix.
2020
os: [ windows-latest, macos-latest, ubuntu-latest ]
21-
dotnet-version: [ net472, net6.0, net8.0]
22-
node-version: [ 18.x, 20.x ]
21+
dotnet-version: [ net472, net8.0, net9.0]
22+
node-version: [ 18.x, 22.x ]
2323
configuration: [ Release ]
2424
exclude:
25-
# Exclude Node 18.x on .NET < 8, to thin the matrix.
26-
- dotnet-version: net6.0
25+
# Exclude Node 18.x on .NET < 9, to thin the matrix.
26+
- dotnet-version: net8.0
2727
node-version: 18.x
2828
- dotnet-version: net472
2929
node-version: 18.x
3030
# Exclude .NET 4.x on non-Windows OS.
3131
- os: macos-latest
32-
dotnet-version: net472
32+
dotnet-version: net472
3333
- os: ubuntu-latest
3434
dotnet-version: net472
3535

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"-c",
4747
"Release",
4848
"-f",
49-
"net8.0",
49+
"net9.0",
5050
"--",
5151
"--filter",
5252
"*.NonAot.*"
@@ -68,7 +68,7 @@
6868
"-c",
6969
"Release",
7070
"-f",
71-
"net8.0",
71+
"net9.0",
7272
"--",
7373
"--filter",
7474
"*.Aot.*"

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and ! $([MSBuild]::IsOsPlatform('Windows')) ">net8.0;net6.0;netstandard2.0</TargetFrameworks>
4-
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and $([MSBuild]::IsOsPlatform('Windows')) ">net8.0;net6.0;netstandard2.0;net472</TargetFrameworks>
5-
<TargetFrameworks Condition=" '$(PublishAot)' == 'true' ">net8.0</TargetFrameworks>
3+
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and ! $([MSBuild]::IsOsPlatform('Windows')) ">net9.0;net8.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and $([MSBuild]::IsOsPlatform('Windows')) ">net9.0;net8.0;netstandard2.0;net472</TargetFrameworks>
5+
<TargetFrameworks Condition=" '$(PublishAot)' == 'true' ">net9.0</TargetFrameworks>
66
<LangVersion>12</LangVersion>
77
<Nullable>enable</Nullable>
88
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>

bench/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<!-- The main purpose of this file is to prevent use of the root Directory.Build.props file,
33
because Benchmark.NET does not like the build output paths to be redirected. -->
44
<PropertyGroup>
5-
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and ! $([MSBuild]::IsOsPlatform('Windows')) ">net8.0;net6.0</TargetFrameworks>
6-
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and $([MSBuild]::IsOsPlatform('Windows')) ">net8.0;net6.0;net472</TargetFrameworks>
5+
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and ! $([MSBuild]::IsOsPlatform('Windows')) ">net9.0;net8.0</TargetFrameworks>
6+
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' and $([MSBuild]::IsOsPlatform('Windows')) ">net9.0;net8.0;net472</TargetFrameworks>
77
<LangVersion>12</LangVersion>
88
<Nullable>enable</Nullable>
99
<PackRelease>false</PackRelease>

bench/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ though the "Dynamic" benchmarks are CLR-only.
99
1010
### Run all benchmarks
1111
```
12-
dotnet run -c Release -f net8.0 --filter *
12+
dotnet run -c Release -f net9.0 --filter *
1313
```
1414

1515
### Run only CLR or only AOT benchmarks
1616
```
17-
dotnet run -c Release -f net8.0 --filter *clr.*
18-
dotnet run -c Release -f net8.0 --filter *aot.*
17+
dotnet run -c Release -f net9.0 --filter *clr.*
18+
dotnet run -c Release -f net9.0 --filter *aot.*
1919
```
2020

2121
### Run a specific benchmark
2222
```
23-
dotnet run -c Release -f net8.0 --filter *clr.CallDotnetFunction
23+
dotnet run -c Release -f net9.0 --filter *clr.CallDotnetFunction
2424
```
2525

2626
### List benchmarks
2727
```
28-
dotnet run -c Release -f net8.0 --list flat
28+
dotnet run -c Release -f net9.0 --list flat
2929
```

docs/features/type-definitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The easiest way to generate type definitions is to leverage the provided MSBuild
2020
the `Microsoft.JavaScript.NodeApi.Generator` NuGet package:
2121
```xml
2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.7.*-*" />
23+
<PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.*-*" />
2424
</ItemGroup>
2525
```
2626

0 commit comments

Comments
 (0)