stride3d / stride3d/stride

Assets selected for custom bundle which aren't included in the build throw exception

Open
#1,794 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

  1. Create a an asset
  2. Create a new custom Bundle in sdpkg
    Bundles: 
     - Name: TextBundle
       Selectors:
        - !TagSelector
          Tags:
           - packagetag
    
  3. Add the tag to your asset file
    Tags:
        - packagetag
    
  4. Compile the platform project to run Asset compiler
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.