Skip to content

Commit ba128ed

Browse files
david-staniec-octopusacodringtonrhysparry
authored
Migrating to .NET 8 (#617)
* Migrating to .net8 from .net6 * Better handling of SYSLIB0051 * Improved handling of VSTHRD103 and other pragmas * Fix to update target in Halibut build schema * Disable dotMemory Unit tests on net8.0 builds * Disable memory dumps * Add env var workaround for .NET7+ virtual memory alloc * No need to get the runtime as well * Add env var to skip backwards compat test * Add env override to ignore duplicated loggers * Restore test blame behaviour * Don't ignore duplicated loggers * Propagate, rather than hardcode GC hard limit * Major version bump +semver: major * Remove obsolete files from solution * Add stub WindowsNet60 target * Update Nuke build schema * Remove extraneous comma * Fix some comments --------- Co-authored-by: Adrian Codrington <[email protected]> Co-authored-by: Rhys Parry <[email protected]>
1 parent a539299 commit ba128ed

36 files changed

+220
-67
lines changed

.nuke/build.schema.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"Clean",
8888
"Compile",
8989
"CompileNet48",
90-
"CompileNet60",
90+
"CompileNet80",
9191
"CopyToLocalPackages",
9292
"Default",
9393
"Pack",
@@ -96,7 +96,8 @@
9696
"TestLinux",
9797
"TestWindows",
9898
"TestWindowsNet48",
99-
"TestWindowsNet60"
99+
"TestWindowsNet60",
100+
"TestWindowsNet80"
100101
]
101102
}
102103
},
@@ -113,7 +114,7 @@
113114
"Clean",
114115
"Compile",
115116
"CompileNet48",
116-
"CompileNet60",
117+
"CompileNet80",
117118
"CopyToLocalPackages",
118119
"Default",
119120
"Pack",
@@ -122,7 +123,8 @@
122123
"TestLinux",
123124
"TestWindows",
124125
"TestWindowsNet48",
125-
"TestWindowsNet60"
126+
"TestWindowsNet60",
127+
"TestWindowsNet80"
126128
]
127129
}
128130
},

build.ps1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ else {
6565
} else {
6666
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
6767
}
68-
# Octopus Modification
69-
# Install the .NET 6.0 runtime as well (this is required to run the tests)
70-
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Runtime dotnet -Channel 6.0 -NoPath }
71-
# End Octopus Modification
7268
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
7369
}
7470

build.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ else
5454
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
5555
fi
5656

57-
# Octopus Modification
58-
# Install the .NET 6.0 runtime as well (this is required to run the tests)
59-
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --runtime dotnet --channel 6.0 --no-path
60-
# End Octopus Modification
6157
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
6258
fi
6359

build/Build.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Build : NukeBuild
8181

8282
Target CompileNet48 => _ => CompileDefinition(_, "net48");
8383

84-
Target CompileNet60 => _ => CompileDefinition(_, "net6.0");
84+
Target CompileNet80 => _ => CompileDefinition(_, "net8.0");
8585

8686
ITargetDefinition CompileDefinition(ITargetDefinition targetDefinition, [CanBeNull] string framework)
8787
{
@@ -100,7 +100,7 @@ ITargetDefinition CompileDefinition(ITargetDefinition targetDefinition, [CanBeNu
100100
}
101101

102102
[PublicAPI]
103-
Target TestWindows => _ => TestDefinition(_, Compile, null, runDotMemoryTests: true);
103+
Target TestWindows => _ => TestDefinition(_, Compile, null, runDotMemoryTests: false);
104104

105105
[PublicAPI]
106106
Target TestLinux => _ => TestDefinition(_, Compile, null, runDotMemoryTests: false);
@@ -109,7 +109,12 @@ ITargetDefinition CompileDefinition(ITargetDefinition targetDefinition, [CanBeNu
109109
Target TestWindowsNet48 => _ => TestDefinition(_, CompileNet48, "net48", runDotMemoryTests: true);
110110

111111
[PublicAPI]
112-
Target TestWindowsNet60 => _ => TestDefinition(_, CompileNet60, "net6.0", runDotMemoryTests: true);
112+
Target TestWindowsNet80 => _ => TestDefinition(_, CompileNet80, "net8.0", runDotMemoryTests: false);
113+
114+
// This temporary target is included to run the net8 tests on a pipeline configured for net6.0
115+
// It can be removed once the build pipeline is updated to reference the new target.
116+
[PublicAPI]
117+
Target TestWindowsNet60 => t => t.DependsOn(TestWindowsNet80);
113118

114119
ITargetDefinition TestDefinition(ITargetDefinition targetDefinition, Target dependsOn, [CanBeNull] string framework, bool runDotMemoryTests)
115120
{

source/Halibut.TestProxy/Halibut.TestProxy.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<PropertyGroup Condition="!$([MSBuild]::IsOSUnixLike())">
11-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
11+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
1212
</PropertyGroup>
1313
<PropertyGroup Condition="$([MSBuild]::IsOSUnixLike())">
14-
<TargetFramework>net6.0</TargetFramework>
14+
<TargetFramework>net8.0</TargetFramework>
1515
</PropertyGroup>
1616

1717
<ItemGroup>

source/Halibut.TestProxy/TcpListenerHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static async Task<TcpListener> GetTcpListener(string listenEndpoint)
3636
throw new ArgumentException($"Listening endpoint '{listenEndpoint}' could not be parsed");
3737
}
3838

39-
// Taken from net6.0 and adapted to support net48
39+
// Taken from net8.0 and adapted to support net48
4040
public static bool TryParse(string s, out IPEndPoint? result)
4141
{
4242
int addressLength = s.Length; // If there's no port then send the entire string to the address parser

source/Halibut.TestUtils.CompatBinary.Base/Halibut.TestUtils.CompatBinary.Base.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<PropertyGroup Condition="!$([MSBuild]::IsOSUnixLike())">
11-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
11+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
1212
</PropertyGroup>
1313
<PropertyGroup Condition="$([MSBuild]::IsOSUnixLike())">
14-
<TargetFramework>net6.0</TargetFramework>
14+
<TargetFramework>net8.0</TargetFramework>
1515
</PropertyGroup>
1616
<ItemGroup>
1717
<Compile Include="..\Halibut.Tests\Support\TcpPortHelper.cs" Link="TcpPortHelper.cs" />

source/Halibut.TestUtils.CompatBinary.v4_4_8/Halibut.TestUtils.CompatBinary.v4_4_8.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
</PropertyGroup>
1010

1111
<PropertyGroup Condition="!$([MSBuild]::IsOSUnixLike())">
12-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
12+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
1313
</PropertyGroup>
1414
<PropertyGroup Condition="$([MSBuild]::IsOSUnixLike())">
15-
<TargetFramework>net6.0</TargetFramework>
15+
<TargetFramework>net8.0</TargetFramework>
1616
</PropertyGroup>
1717

1818
<ItemGroup>

source/Halibut.TestUtils.CompatBinary.v5_0_236/Halibut.TestUtils.CompatBinary.v5_0_236.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
</PropertyGroup>
1010

1111
<PropertyGroup Condition="!$([MSBuild]::IsOSUnixLike())">
12-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
12+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
1313
</PropertyGroup>
1414
<PropertyGroup Condition="$([MSBuild]::IsOSUnixLike())">
15-
<TargetFramework>net6.0</TargetFramework>
15+
<TargetFramework>net8.0</TargetFramework>
1616
</PropertyGroup>
1717

1818
<ItemGroup>

source/Halibut.TestUtils.CompatBinary.v6_0_658/Halibut.TestUtils.CompatBinary.v6_0_658.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
</PropertyGroup>
1010

1111
<PropertyGroup Condition="!$([MSBuild]::IsOSUnixLike())">
12-
<TargetFrameworks>net48;net6.0</TargetFrameworks>
12+
<TargetFrameworks>net48;net8.0</TargetFrameworks>
1313
</PropertyGroup>
1414
<PropertyGroup Condition="$([MSBuild]::IsOSUnixLike())">
15-
<TargetFramework>net6.0</TargetFramework>
15+
<TargetFramework>net8.0</TargetFramework>
1616
</PropertyGroup>
1717

1818
<ItemGroup>

0 commit comments

Comments
 (0)