Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

analyze: archive name is the bare file name, so same-named bundles in different folders are skipped as duplicates

未关闭
#149 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp, unity
领域
data, tooling

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

bug

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 SerializedFileParser so archives.name becomes 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 name message for genuine duplicates (two builds with the same relative layout).
  • Document the change in Documentation/analyzer-schema.md (archives.name) and Documentation/command-analyze.md. The archive column in object_view changes value for nested bundles, so bump PRAGMA user_version and 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.

主要语言
C#
星标
821
派生
71
平均合并
4 小时 54 分钟
30 天内合并 PR
10

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Unity-Technologies/UnityDataTools 的其他 Issue

查看 Unity-Technologies/UnityDataTools 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。