From 7b25ce790da37dd509ad98b692e9d0fb1e491af4 Mon Sep 17 00:00:00 2001 From: capz <345101+capz@users.noreply.github.com> Date: Fri, 20 Nov 2026 15:55:49 +0100 Subject: [PATCH] feat: adopt DolphinDotNet launch-content SDK --- .sdk-revision | 2 +- Directory.Build.props | 2 +- docs/nuget.md | 43 ++++++++++++++++++++--------------------- eng/package-readme.md | 2 +- tests/nuget_consumer.py | 25 ++++++++++++++++++++---- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/.sdk-revision b/.sdk-revision index 61c511a..1bc9a93 100644 --- a/.sdk-revision +++ b/.sdk-revision @@ -1 +1 @@ -134a524d7cea119a634e9f516b100f9619dce1cb +9dcc4b6d111b109860be294820d0b14b21b8eced diff --git a/Directory.Build.props b/Directory.Build.props index 586a239..ba236d4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ false false - 0.1.0-preview.374.1 + 0.1.0-preview.376.1 true net8.0 enable diff --git a/docs/nuget.md b/docs/nuget.md index 1b37132..4fdce11 100644 --- a/docs/nuget.md +++ b/docs/nuget.md @@ -10,31 +10,30 @@ streaming adapters and depends on Core plus a specific published DolphinDotNet.GameCube version. The DolphinDotNet MSBuild SDK/compiler is a separate application requirement; it is not copied into an engine library nupkg. `Directory.Build.props` pins the package dependency version to -`DolphinDotNet.GameCube` **0.1.0-preview.374.1**. The matching compiler/runtime -source is **134a524d7cea119a634e9f516b100f9619dce1cb**, also pinned in +`DolphinDotNet.GameCube` **0.1.0-preview.376.1**. The matching compiler/runtime +source is **9dcc4b6d111b109860be294820d0b14b21b8eced**, also pinned in `.sdk-revision` for source validation. Ordered passes retain their native SDK backend by default; the portable comparison remains available through `HypercubeNativePasses=false`. -The current SDK adds `Dolphin.IO.LaunchContext` for bounded incoming GameCube -launcher arguments, used by AnimalTown's standalone Dolphin Depot app profile. -The external consumer also bundles this API and checks that the SDK includes -its launch capture before managed startup. Existing rendering and full-resolution -AA capabilities remain in the same exact SDK dependency closure. - -This upgrade accompanies [AnimalTown #47](https://github.com/capz/AnimalTown/pull/47). -SDK 318 exposes independent TEV alpha stages, two-reference GX comparisons and -`TevMaterialPresets.DualTextureGlints` for its two scrolling water samples. -Hypercube's scrolling helpers use these materials through the existing SDK API; -no separate effect format, shader wrapper or texture allocation is introduced. -The relocated package consumer builds/AOT-bundles this combination with a single -engine reference and no runtime override or NU1608 suppression. - -Once this engine preview has been verified and published, AnimalTown can pin -that published version in place of engine 28 and remove its temporary explicit -runtime-318 compatibility override. Engine previews are published only by the -existing release workflow after its publication trigger; this PR does not -reserve a future package number or publish an unverified package. +The current SDK adds `Dolphin.IO.LaunchContent` to resolve and mount content from +the incoming GameCube launch device and directory, with explicit fallback +locations and an application identity validator. AnimalTown can use this SDK +API for its standalone Dolphin Depot app profile. The relocated package consumer +builds and AOT-bundles a content resolver with a validator and generation-bound +file access, and checks that the SDK captures launcher arguments before managed +startup. See the [SDK launch-content contract](https://github.com/capz/DolphinDotNet/blob/9dcc4b6d111b109860be294820d0b14b21b8eced/docs/launch-context.md) +for source selection, ownership and emulator limitations. + +Existing native ordered passes, rendering, full-resolution AA and scrolling +water material capabilities remain in the same exact SDK dependency closure. +The relocated consumer builds these APIs with a single engine reference and no +runtime override or NU1608 suppression. + +AnimalTown must pin a verified, published engine preview containing this SDK +dependency before consuming the combination. Engine previews are published only +by the existing release workflow after its publication trigger; this update +does not reserve a future package number or publish an unverified package. ## Build and test without publishing @@ -50,7 +49,7 @@ The consumer relocates the nupkgs, uses an isolated NuGet cache outside the repository, executes Core, then builds the Rendering sample and water-material consumer through PackageReference and the published DolphinDotNet SDK. It verifies transitive dependencies, confirms the SDK packages match the reviewed source revision in `.sdk-revision`, and checks AOT bundling and, with --native, -actual Rendering and water DOL/ELF output. No SDK source checkout is +actual Rendering, launch-content and water DOL/ELF output. No SDK source checkout is needed to consume the packages. ## Publish diff --git a/eng/package-readme.md b/eng/package-readme.md index f310653..e59bf23 100644 --- a/eng/package-readme.md +++ b/eng/package-readme.md @@ -14,7 +14,7 @@ dotnet add package Capz.Hypercube.GameCube --prerelease ``` GameCube depends on Core and DolphinDotNet.GameCube. Use a GameCube application -with `DolphinDotNet.Sdk/0.1.0-preview.318.1` and a matching +with `DolphinDotNet.Sdk/0.1.0-preview.376.1` and a matching `DolphinDotNet.GameCube` package. These engine packages contain managed libraries and PDBs, not the native compiler or a replacement SDK. Build the application with the DolphinDotNet SDK to produce a GameCube DOL. Do not execute graphics adapters diff --git a/tests/nuget_consumer.py b/tests/nuget_consumer.py index c6ab05c..bc19750 100644 --- a/tests/nuget_consumer.py +++ b/tests/nuget_consumer.py @@ -59,15 +59,32 @@ class Program {static void Main(){var q=new OpaqueDrawQueue(2);q.TryAdd(1,2,0xff if not (work/'native-consumer/source/generated_program.c').is_file():raise AssertionError('No consumer AOT bundle') launch=work/'Launch';launch.mkdir() (launch/'Launch.csproj').write_text((app/'GameCube.csproj').read_text()) - (launch/'Program.cs').write_text('''using Dolphin.IO; -internal static class Program {static int Main(){return LaunchContext.ArgumentCount==0?0:LaunchContext.ExecutablePath.Length;}} + (launch/'Program.cs').write_text('''using Dolphin.IO;using Dolphin.Storage; +internal static class Program { + private static bool Validate(LaunchContent content) { + using var stream=content.OpenRead("content.id"); + return stream.Length>0; + } + static int Main() { + var result=LaunchContent.Mount(new LaunchContentOptions { + Fallbacks=new[]{new LaunchContentLocation(MountConfiguration.Disc())}, + Validate=Validate + }); + if(!result.Succeeded)return -(int)result.Failure; + using var content=result.Content!; + return content.IsValid?content.RootPath.Length:1; + } +} ''') run('dotnet','build',str(launch),'-c','Release','-p:DndBuildNative=false','-warnaserror:NU1608') run('dotnet',str(compiler),'--bundle',str(launch/'bin/Release/net8.0/Launch.dll'),str(work/'native-launch')) if '-DDND_CAPTURE_LAUNCH_ARGUMENTS' not in (work/'native-launch/Makefile').read_text(): raise AssertionError('Published SDK did not enable incoming launch-context capture') - if 'dnd_launch_count(' not in (work/'native-launch/source/generated_program.c').read_text(): + launch_source=(work/'native-launch/source/generated_program.c').read_text() + if 'dnd_launch_count(' not in launch_source: raise AssertionError('Published launch-context call missing from AOT consumer') + if 'dnd_storage_open_mounted(' not in launch_source: + raise AssertionError('Published launch-content consumer omitted generation-bound file access') # Exercise the distributed default backend, rather than only compiling # the stubbed contract test or the source-checkout adapter. ordered=work/'Ordered';ordered.mkdir() @@ -91,7 +108,7 @@ class Program {static void Main(){var q=new OpaqueDrawQueue(2);q.TryAdd(1,2,0xff run('dotnet',str(compiler),'--bundle',str(water/'bin/Release/net8.0/Water.dll'),str(work/'native-water')) if not (work/'native-water/source/generated_program.c').is_file():raise AssertionError('No water alpha AOT bundle') if args.native: - for project in (app,water): + for project in (app,launch,water): run('dotnet','build',str(project),'-c','Release','-p:DndBuildBackend=Docker') if not list(project.rglob('*.dol')) or not list(project.rglob('*.elf')):raise AssertionError('No external native executable: '+project.name) print('External NuGet restore, dependency closure and consumer checks passed')