Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Binaries in the archive root are not extracted

Open Beginner friendly
#59 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
cli

Research direction

The bug is in extract() in src/Archive/PharAwareArchive.php, which reopens $this->archive (the PharData iterator) instead of the archive path, so only the first entry is searched. Start by reading that method, then remove #[Skip] from extractFindsBinaryInArchiveRoot in tests/Unit/Archive/PharAwareArchiveTest.php and run vendor/bin/testo --filter=extractFindsBinaryInArchiveRoot. Done when that test passes and a flat archive or a binary outside the first top-level entry extracts. Check with maintainers first, since issue #49 may replace this code.

Written by the indexing model from the issue text.

Description

bug

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

  1. Remove #[Skip] from PharAwareArchiveTest::extractFindsBinaryInArchiveRoot.
  2. Run vendor/bin/testo --filter=extractFindsBinaryInArchiveRoot.

Additional context

Archive handling may be replaced by DLoad in #49, in which case this code goes away.

Dominant language
PHP
Stars
30
Forks
15
Avg merge
45m
Merged PRs (30d)
11

Getting set up

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.

More from roadrunner-php/cli

All issues in roadrunner-php/cli

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.