Skip to content

test .zip archives - #513

Merged
rjbs merged 5 commits into
andk:masterfrom
rjbs:archive-zip-tests
Oct 28, 2026
Merged

rjbs merged 5 commits into
andk:masterfrom
rjbs:archive-zip-tests

Conversation

@rjbs

@rjbs rjbs commented May 12, 2024

Copy link
Copy Markdown
Collaborator

This is blocked by a new Module-Faker, which is kinda waiting on miyagawa/Archive-Any-Create#3

Also, this is really just one commit on top of #510

Also, this exposes that ->untar sets PERL_MAJOR_VERSION but zip archives never have it set. Other discrepancies may show up, too.

@rjbs
rjbs marked this pull request as draft May 12, 2024 01:27
@rjbs
rjbs force-pushed the archive-zip-tests branch 3 times, most recently from cdf6154 to c48387a Compare October 24, 2026 16:17
@rjbs
rjbs marked this pull request as ready for review October 24, 2026 16:19
rjbs and others added 5 commits October 28, 2026 10:05
Upload the simplest possible dist as both a tarball and a zip file, and
check that each is indexed the same way.

This needed Module::Faker 0.027, which chmods the files it puts in a zip
archive to 0644; before that, Archive::Any::Create made them world
writable and PAUSE rejected the upload.
p6_index_dist lists the archive with tar to find bin/ entries.  For a
zip archive that fails, and the failure aborts indexing the whole dist.
Pick the listing command by file extension; "unzip -Z1" prints one entry
name per line, the same shape as "tar tf".

Co-Authored-By: Claude <noreply@anthropic.com>
untar sets PERL_MAJOR_VERSION while listing the tarball, but the zip
branch of examine_dist never set it, so perl_major_version was undef for
every zip upload.  That meant "uninitialized value" warnings on each
comparison and, for an actual Perl 6 dist in a zip, indexing it as a
Perl 5 dist with no META file.

After unzipping, look for a top-level-directory META6.json, the same test
untar applies to the listing.

Co-Authored-By: Claude <noreply@anthropic.com>
corpus/mld/perl6-zip holds the same Inline-1.1 dist as corpus/mld/perl6,
repacked as a zip file, and the Perl 6 indexing test now runs over both.

Co-Authored-By: Claude <noreply@anthropic.com>
Each insert pushed (errstr, ret) onto @Args but logged the first as
"ret" and the second as "err", so a successful insert was logged as
ret "" and err 1.  Push them in the order the log reads them.

Co-Authored-By: Claude <noreply@anthropic.com>
@rjbs
rjbs force-pushed the archive-zip-tests branch from c48387a to dfe3964 Compare October 28, 2026 14:05
@rjbs
rjbs merged commit 51fbd1f into andk:master Oct 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant