Assets selected for custom bundle which aren't included in the build throw exception
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 4.1.0.1898 and earlier
Platform(s): Any - asset compiler
Describe the bug
When a user tries to create a custom bundle and they don't include an asset in the compilation (either via root asset or as a dependency) an exception is thrown.
To Reproduce
Steps to reproduce the behavior:
- Create a an asset
- Create a new custom Bundle in
sdpkgBundles: - Name: TextBundle Selectors: - !TagSelector Tags: - packagetag - Add the tag to your asset file
Tags: - packagetag - Compile the platform project to run Asset compiler
- Observe error
Expected behavior
Either the exception should hint that the issue is that the asset was not included, or issue a warning about a missing asset and carry on without it.
Log and callstacks
[AssetCompiler] Generate bundles: Scan assets and their dependencies...
[AssetCompiler] Unhandled exception. Exception: InvalidOperationException: Could not find asset Prefab for bundle TextBundle
at Stride.Core.Assets.CompilerApp.BundlePacker.CollectReferences(DatabaseFileProvider databaseFileProvider, Bundle bundle, HashSet`1 assets, String assetUrl) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\BundlePacker.cs:line 341
at Stride.Core.Assets.CompilerApp.BundlePacker.Build(Logger logger, PackageSession packageSession, Package rootPackage, String indexName, String outputDirectory, ISet`1 disableCompressionIds, Boolean useIncrementalBundles, List`1 bundleFiles) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\BundlePacker.cs:line 85
at Stride.Core.Assets.CompilerApp.PackageBuilder.BuildMaster() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilder.cs:line 168
at Stride.Core.Assets.CompilerApp.PackageBuilder.Build() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilder.cs:line 57
at Stride.Core.Assets.CompilerApp.PackageBuilderApp.Run(String[] args) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilderApp.cs:line 286
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The failure is reported in Stride.Core.Assets.CompilerApp/BundlePacker.cs, in CollectReferences at line 341, reached from Build. Reproduce the custom TextBundle case and inspect the missing-asset path; done means the compiler no longer throws an unhandled exception and instead provides the expected diagnostic or continues with a warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100