-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(24.10): add .NET9 slices (#436)
- Loading branch information
1 parent
5c0b5bd
commit eb825bf
Showing
14 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package: aspnetcore-runtime-9.0 | ||
|
||
essential: | ||
- aspnetcore-runtime-9.0_copyright | ||
|
||
slices: | ||
libs: | ||
essential: | ||
- dotnet-runtime-9.0_libs | ||
contents: | ||
/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/**.dll: | ||
/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/**.json: | ||
/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0*/.version: | ||
|
||
notice: | ||
contents: | ||
/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/9.0.0/THIRD-PARTY-NOTICES.txt: | ||
/usr/share/doc/aspnetcore-runtime-9.0/NOTICE.txt.gz: | ||
|
||
copyright: | ||
contents: | ||
/usr/share/doc/aspnetcore-runtime-9.0/copyright: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package: dotnet-host-9.0 | ||
|
||
essential: | ||
- dotnet-host-9.0_copyright | ||
|
||
slices: | ||
bins: | ||
essential: | ||
- libc6_libs | ||
- libgcc-s1_libs | ||
- libstdc++6_libs | ||
contents: | ||
# This copy is done to avoid Chisel's current handling of conflicts, as | ||
# it flags a conflict between this slice and .NET8's, even if the two | ||
# are not being installed at the same time. | ||
# Override the installed slice using the following commands: | ||
# ``` | ||
# mv ${rootfs}/usr/lib/dotnet/dotnet9 ${rootfs}/usr/lib/dotnet/dotnet | ||
# ln -s ../lib/dotnet/dotnet ${rootfs}/usr/bin/dotnet | ||
# ``` | ||
# TODO: once Chisel can cope with duplicate contents within the same | ||
# release, this copy can be suppressed | ||
/usr/lib/dotnet/dotnet9: {copy: /usr/lib/dotnet/dotnet} | ||
|
||
copyright: | ||
contents: | ||
/usr/share/doc/dotnet-host-9.0/copyright: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package: dotnet-hostfxr-9.0 | ||
|
||
essential: | ||
- dotnet-hostfxr-9.0_copyright | ||
|
||
slices: | ||
libs: | ||
essential: | ||
- dotnet-host-9.0_bins | ||
- libc6_libs | ||
- libgcc-s1_libs | ||
- libstdc++6_libs | ||
contents: | ||
/usr/lib/dotnet/host/fxr/9.0*/libhostfxr.so: | ||
|
||
copyright: | ||
contents: | ||
/usr/share/doc/dotnet-hostfxr-9.0/copyright: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package: dotnet-runtime-9.0 | ||
|
||
essential: | ||
- dotnet-runtime-9.0_copyright | ||
|
||
slices: | ||
libs: | ||
essential: | ||
- dotnet-hostfxr-9.0_libs | ||
- libbrotli1_libs | ||
- libc6_libs | ||
- libgcc-s1_libs | ||
- libicu74_libs | ||
- liblttng-ust1t64_libs | ||
- libssl3t64_libs | ||
- libstdc++6_libs | ||
- libunwind8_libs | ||
- zlib1g_libs | ||
contents: | ||
/usr/lib/dotnet/shared/Microsoft.NETCore.App/9.0*/**: | ||
|
||
copyright: | ||
contents: | ||
/usr/share/doc/dotnet-runtime-9.0/copyright: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
summary: Integration tests for ASP.NET 9 Runtime | ||
|
||
execute: | | ||
# install slices | ||
rootfs="$(install-slices aspnetcore-runtime-9.0_libs base-files_base)" | ||
mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet | ||
ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet | ||
# preparing the test data | ||
apt update && apt install -y dotnet-sdk-9.0 | ||
cp -r web_helloworld "${rootfs}"/web_helloworld | ||
dotnet publish "${rootfs}"/web_helloworld/Hello.csproj --no-self-contained | ||
mkdir -p "${rootfs}"/proc | ||
mount --bind /proc "${rootfs}"/proc | ||
mkdir -p "${rootfs}"/dev | ||
head -c 500 /dev/urandom > "${rootfs}"/dev/random | ||
head -c 500 /dev/urandom > "${rootfs}"/dev/urandom | ||
# test the helloworld web app | ||
chroot "${rootfs}" dotnet /web_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" & | ||
app_pid=$! | ||
# Wait for the web app to start | ||
while ! fuser 5108/tcp > /dev/null 2>&1; do | ||
if ! test -d /proc/$app_pid; then | ||
echo "dotnet exited quickly" | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done | ||
# Send a request to the web app and verify the result | ||
ret=0 | ||
curl http://localhost:5108/ | grep "Hello World!" || ret=1 | ||
# Cleanup | ||
kill $app_pid | ||
exit $ret |
9 changes: 9 additions & 0 deletions
9
tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Hello.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
</Project> |
6 changes: 6 additions & 0 deletions
6
tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var builder = WebApplication.CreateBuilder(args); | ||
var app = builder.Build(); | ||
|
||
app.MapGet("/", () => "Hello World!"); | ||
|
||
app.Run(); |
28 changes: 28 additions & 0 deletions
28
...s/spread/integration/aspnetcore-runtime-9.0/web_helloworld/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:65090", | ||
"sslPort": 44311 | ||
} | ||
}, | ||
"profiles": { | ||
"Hello": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"applicationUrl": "https://localhost:7158;http://localhost:5108", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.Development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/spread/integration/aspnetcore-runtime-9.0/web_helloworld/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
summary: Integration tests for .NET 9 Host | ||
|
||
execute: | | ||
# install slices | ||
rootfs="$(install-slices dotnet-host-9.0_bins dotnet-hostfxr-9.0_libs base-files_base)" | ||
mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet | ||
ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet | ||
# smoking test the .NET host | ||
chroot "${rootfs}" /usr/bin/dotnet --info |
10 changes: 10 additions & 0 deletions
10
tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Hello.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
1 change: 1 addition & 0 deletions
1
tests/spread/integration/dotnet-runtime-9.0/app_helloworld/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Console.WriteLine("Hello, World!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
summary: Integration tests for .NET 9 Runtime | ||
|
||
execute: | | ||
# install slices | ||
rootfs="$(install-slices dotnet-runtime-9.0_libs base-files_base)" | ||
mv "${rootfs}"/usr/lib/dotnet/dotnet9 "${rootfs}"/usr/lib/dotnet/dotnet | ||
ln -s ../lib/dotnet/dotnet "${rootfs}"/usr/bin/dotnet | ||
# preparing the test data | ||
apt update && apt install -y dotnet-sdk-9.0 | ||
cp -r app_helloworld "${rootfs}"/app_helloworld | ||
dotnet publish "${rootfs}"/app_helloworld/Hello.csproj --no-self-contained | ||
mkdir -p "${rootfs}"/proc | ||
mount --bind /proc "${rootfs}"/proc | ||
# test the helloworld app | ||
chroot "${rootfs}" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll |