Open mkustermann opened 2 months ago
Summary: Currently, dart build
copies data assets based on their original filenames, leading to conflicts when multiple assets with the same filename but different IDs are included. This issue proposes that dart build
should instead use the unique asset ID to name the copied assets, ensuring no conflicts.
@mkustermann Did you mean NativeCodeAsset
s? DataAsset
s support hasn't landed yet.
@mkustermann Did you mean NativeCodeAssets? DataAssets support hasn't landed yet.
dart-lang/sdk@main
has DEPS
which pulls in dart-lang/native@b01a3f3ef5e3a219fefb182d4cfc41d2895f32ca, which exports DataAsset
in package:native_assets_cli/native_assets_cli.dart
(see here)
Also the SDK has code in dart run/build
for data assets, see e.g. here which also has this copy logic in it.
A package could emit two assets under two different ids but with the same from-source location. This works in
dart run
because the data assets aren't copied, but withdart build
it fails because it copies based on the original file name, which can have a clash, as opposed to a unique name based on asset-id.We should have a guarantee that all assets have unique
assetId
but not necessarily unique filename.