analyze: archive name is the bare file name, so same-named bundles in different folders are skipped as duplicates
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
The issue is in the analyze command and SerializedFileParser.Parse. Start by examining the code that calculates the archive name, likely in the parser where Path.GetRelativePath is called. The root directory needs to be passed through. Check the schema documentation and update the archives.name field. Write a test that creates two bundles with the same name in different subfolders and verifies both are recorded. Run existing tests to ensure no regression.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
analyze records archives.name as the bare file name of the bundle, not its path relative to the scanned directory. SerializedFileParser.Parse passes the file's own directory as the root, so Path.GetRelativePath(root, file) always collapses to the file name. The schema requires archive names to be unique, so two bundles with the same file name in different folders are treated as a duplicate build and the second one is skipped:
Skipping dlc\limitedtimeoffers\offer2\all: Duplicate archive name 'all'. Each analyzed archive must have a unique name; only a single build can be analyzed at a time.
This blocks analyzing real BuildPipeline.BuildAssetBundles output where bundle names are paths. Bundle names like dlc/<item>/all are legal and common (the AssetBundle name is a path, and the build writes the folder structure to disk). In a 54,000 bundle customer build almost every item folder contains an all bundle, so analyze over any folder with more than one item fails nearly every bundle:
Finalizing database. Successfully processed files: 279, Failed files: 16309, ...
The same thing happens with -p "*.en-us" over a tree of AssetBundle variants: all 3,353 matching files are called localizedui.en-us and only the first is analyzed.
The current work-around is to copy the bundles into a flat folder with the relative path encoded in the file name (dlc__limitedtimeoffers__offer2__all), which is slow and awkward for multi-GB builds.
Why this is fixable
References between bundles never use the archive name. A PPtr resolves through the SerializedFile's external reference table, which names the target by its internal CAB-<hash> path. analyze already keys references on the SerializedFile name, so the archive name is only a label for the user. Recording the path relative to the scanned root (for example dlc/limitedtimeoffers/offer2/all) keeps names unique whenever the build itself is unique, and matches the name Unity gives the bundle in the AssetBundleManifest, which makes joining against manifest data easier.
Proposed change
- Pass the scanned root through to
SerializedFileParsersoarchives.namebecomes the path relative to that root, with/separators. A file passed directly on the command line keeps its file name, as today. - Keep the
Duplicate archive namemessage for genuine duplicates (two builds with the same relative layout). - Document the change in
Documentation/analyzer-schema.md(archives.name) andDocumentation/command-analyze.md. Thearchivecolumn inobject_viewchanges value for nested bundles, so bumpPRAGMA user_versionand add a row to the schema version table. - Add a test with two bundles of the same file name in different sub-folders of one scanned directory, asserting both archives are recorded with distinct path-based names and that references between them still resolve.
Related: #51 introduced the duplicate-name handling.
- Ngôn ngữ chính
- C#
- Star
- 821
- Fork
- 71
- Merge trung bình
- 4 giờ 54 phút
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Unity-Technologies/UnityDataTools
-
Binary test data is not fully covered by .gitattributes and can be mangled by EOL conversion Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Unity-Technologies/UnityDataTools#116 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Tất cả issue của Unity-Technologies/UnityDataTools
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
nightscout/nocturne#1425 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cake-build/cake#5024 ·
-
Gå gjennom ESLint-suppressions Đang mởFrontend status/draft TechnicalDebt
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 75/100
Altinn/altinn-auth#4143 ·