Asset compiler: load from .sdbuild manifests instead of walking the csproj graph#3219
Conversation
27e419e to
232ec3a
Compare
|
/ci e2e |
|
@xen2 —
Land workflow changes on master first if you need them tested. |
|
@xen2 — |
|
I wonder if your updates allow using this feature https://learn.microsoft.com/en-us/dotnet/core/sdk/file-based-apps for some small examples. I tried most recent stride build a few days ago with our community toolkit but obviously it doesn't work because the project is created somewhere in the temp folder and the asset compiler paths are not aware of such scenario. I can create a separate issue for that but maybe this is really low priorirty. |
|
/ci e2e |
|
@xen2 —
Land workflow changes on master first if you need them tested. |
|
@xen2 — |
4735df1 to
9b90fd7
Compare
I also think it is low priority but it's nice to track it as an issue. |
…y renamed to StrideAssetAssembly
…-in) Manifest mode (--package-manifest / StrideAssetBuildManifestMode) loads the session from the .sdbuild chain instead of walking csproj files: chases referenced manifests, reads sdpkg-carrying NuGet packages from the lock file directly, loads and registers exactly the declared AssetAssemblies, and takes project assets from the manifest. No MSBuild evaluation, no reference-graph loading. Verified functionally equivalent to the legacy walk on a NuGet-consumer game (identical asset URL set; byte diffs are inherent skybox nondeterminism).
…ed host assembly pack-assets writes the host-loadable assembly (lib/<host-tfm>/<name>.dll) into the packed sdpkg's AssetAssemblies; the manifest-mode consumer prefers those over the lock file's runtime assemblies (falling back when a package predates the member). Engine runtime asset packages declare StrideAssetAssembly=true so their packed sdpkgs carry the entry. Validated: pack-assets + the pack target emit the entry for Stride.Engine, and the consumer honors it (engine packages also stay robust via the compiler's own assembly closure).
…w to test-enduser Harness moves from samples/Tests/; fixtures+baselines into Fixtures/ subdir. Rename test-samples-screenshots workflow -> test-enduser (file, display name, repository_dispatch event, chatops suite key samples->enduser). Repoint runtime paths, baselines workflow, chatops map/help, CONTRIBUTING, and docs.
…n in test-enduser
The build path now loads only from the .sdbuild chain. Drops the StrideAssetBuildManifestMode toggle and the shadow validator; legacy csproj graph-load stays for the editor and pack modes.
An IProjectAsset type whose [AssetDescription] extension is missing from StrideProjectAssetExtensions would silently drop its assets from the build; warn at compile time. Skips .cs and generator assets.
The name was a relic of the era when 'in solution = user project, from package = read-only system'. It actually means 'not backed by an editable in-solution SolutionProject' (a restored dependency, or any package in manifest mode), i.e. read-only. Pure rename; no behavior change. Also drops a now-redundant duplicate check.
Package -> PackageFile (matches its sibling ProjectFile, and stops shadowing the Package class). ProjectAssetsFile -> NuGetLockFile (it's the project.assets.json lock file; the old name was one letter off from ProjectAssets, the .sdsl item list, which is unrelated). Regenerated format, no migration.
PR Details
The asset compiler used to rediscover which assemblies and assets to load by re-walking the csproj/ProjectReference graph on every run and guessing from implicit conventions.
Now every project emits a small
.sdbuildmanifest at build time (intoobj/) describing exactly what the compiler needs (package, asset items, assemblies, referenced manifests, lock file) and the compiler reads that instead of evaluating MSBuild.NuGet packages declare their asset types in their packed
sdpkg.Highlights
Stride.Graphics.Tests~14.5s → ~1.6s; a consumer game ~4.1s → ~2.4s). Evaluation moves into the build, where it's incremental.<StrideAssetAssembly>which means "this assembly's types appear in assets", the single authoring surface. On by default for game/code projects; the generation and pack targets both consume it.STRDIAG011warns at compile time when anIProjectAssettype's extension isn't declared, instead of silently dropping its assets. ≤5 ms/compilation.tests/enduser/Stride.Packaging.Tests(Windows + Linux) packs a real plugin and consumes it via a truePackageReference.What this unlocks
AssetAssemblies), proven load-bearing by the packaging test. Previously only worked by accident for engine packages the compiler force-registers.sdpkgis now the declared place a package describes its surface.Types of changes
Checklist