Binaries in the archive root are not extracted
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
问题出在 src/Archive/PharAwareArchive.php 中的 extract(),它重新打开的是 $this->archive(PharData 迭代器),而不是归档路径,因此只会搜索第一个条目。请先阅读该方法,然后从 tests/Unit/Archive/PharAwareArchiveTest.php 中的 extractFindsBinaryInArchiveRoot 上移除 #[Skip],并运行 vendor/bin/testo --filter=extractFindsBinaryInArchiveRoot。当该测试通过,并且扁平归档或位于第一个顶层条目之外的二进制文件能够解压时,即完成。请先与维护者确认,因为 issue #49 可能会替换这段代码。
由索引模型根据 Issue 内容生成。
描述
Description
PharAwareArchive::extract() cannot extract a binary from the archive root. For a zip that contains LICENSE and rr at the top level, extraction fails with:
RecursiveDirectoryIterator::__construct(phar:///tmp/.../rr.zip/rr): Failed to open directory: operation failed
extract() reopens the archive with $this->open($this->archive). $this->archive is the PharData iterator itself, so its getPathname() returns the current entry, i.e. the first file in the archive, not the archive. Only that first entry is searched:
- if it is a directory, the files inside it are found;
- if it is a file, the reopen fails.
Current RoadRunner archives put everything in one top-level directory (roadrunner-<version>-<os>-<arch>/rr), which is the only reason extraction works today. A flat archive, or a binary outside the first top-level entry, cannot be installed.
Steps to reproduce
- Remove
#[Skip]fromPharAwareArchiveTest::extractFindsBinaryInArchiveRoot. - Run
vendor/bin/testo --filter=extractFindsBinaryInArchiveRoot.
Additional context
Archive handling may be replaced by DLoad in #49, in which case this code goes away.
- 主要语言
- PHP
- 星标
- 30
- 派生
- 15
- 平均合并
- 45 分钟
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
roadrunner-php/cli 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
roadrunner-php/cli#69 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
roadrunner-php/cli#68 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
roadrunner-php/cli#67 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
roadrunner-php/cli#62 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
roadrunner-php/cli#61 ·
维护者通常 1 天内回复
查看 roadrunner-php/cli 的全部 Issue
相似的 Issue
-
sync-en
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
Перевод устарел
难度 1/5 1 小时以内 新手友好度 85/100
-
bug
难度 2/5 半天 新手友好度 76/100
m3ue/m3u-editor#1604 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
femiwiki/docker-mediawiki#1497 ·
维护者通常 1 天内回复