GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: fix zipinfo non-ascii check in test-zlib-zip-interop by ravi-arnan · Pull Request #66978 · nodejs/node

Conversation

@ravi-arnan

@ravi-arnan ravi-arnan commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Fixes: #66975

Problem

In test/parallel/test-zlib-zip-interop.js, zipinfoUnicode is evaluated as /UNICODE_SUPPORT/.test(unzip -v). However, stock Info-ZIP builds (common on Linux distros such as NixOS, Arch Linux, Alpine, and Debian) still sanitize non-ASCII bytes to '?' in fnfilter() unless patched with wide-character/UTF-8 printing support (e.g. USE_NATSPEC or alt-iconv-utf8-print).

On these systems, zipinfo outputs unicode-??.txt (or unicode-??????.txt) instead of unicode-名前.txt, which causes the assertion:

assert.ok(zipinfo.stdout.toString().includes(name), `zipinfo missing ${name}`);

to fail.

Solution

When checking zipinfo output:

  • First check if the entry name matches verbatim (as on patched Info-ZIP builds).
  • If not and the entry name contains non-ASCII characters, verify that zipinfo listed the entry with '?' placeholders.
  • If an entry is missing entirely (or if a plain ASCII entry is missing), fail the assertion.

The actual UTF-8 decoding and round-trip extraction continue to be verified by bsdtar directly afterwards.

Verification

  • Ran Node.js ESLint: node tools/eslint/node_modules/eslint/bin/eslint.js test/parallel/test-zlib-zip-interop.js (clean, 0 warnings/errors).
  • Verified against real zipinfo execution on Linux (NixOS) where stock Info-ZIP prints unicode-??.txt (clean pass).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

  • the guide for first-time contributors
  • the contribution and automation policies
  • the pull request guide
  • the AI use policy
  • the Code of Conduct

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vedchaudhari vedchaudhari mentioned this pull request Oct 24, 2026
test: accept '?' from zipinfo in zip interop test #66979
Closed
@vedchaudhari

vedchaudhari commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Hi @ravi-arnan, thanks for working on this! Two things I noticed:

  • It fails on macOS. Since the UNICODE_SUPPORT check is removed, macOS now checks the Japanese name too. But Apple's zipinfo doesn't turn the whole name into ?s, it keeps some of the bytes: 名前 comes out as e5 3f 3f e5 3f 3f. So the \?+ pattern doesn't match and the test fails: https://github.com/vedchaudhari/node/actions/runs/40075440958
  • Debian, Arch and Alpine actually print the name fine. The description and the new comments say they show ?, but those distros turn the ? filter off (NO_WORKING_ISPRINT). I checked on Ubuntu and it printed unicode-名前.txt. The ? only shows up on builds that keep the filter on, like Gentoo with USE="unicode -natspec".

I opened #66979 with a version that keeps the UNICODE_SUPPORT check, in case that helps. Happy to go with whichever the reviewers prefer!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ravi-arnan
test: fix zipinfo non-ascii check in test-zlib-zip-interop
d64e99d
Keep UNICODE_SUPPORT guard so macOS skips checking non-ASCII names
in zipinfo output, and accept '?' / U+FFFD placeholders on builds
with UNICODE_SUPPORT that filter non-ASCII bytes in fnfilter()
without wide-character printing support (such as NixOS or Gentoo).

Fixes: nodejs#66975
Signed-off-by: Ravi Arnan <[email protected]>
@ravi-arnan
ravi-arnan force-pushed the test-zlib-zipinfo-unicode branch from 288cb78 to d64e99d Compare October 24, 2026 10:50
@ravi-arnan

ravi-arnan commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Hi @vedchaudhari, thanks for the review and for catching the macOS behavior!

I reproduced and verified this directly on a physical macOS machine (Darwin 21.6.0, built-in Info-ZIP 6.0). As you noted:

  • Apple's Info-ZIP build does not report UNICODE_SUPPORT in unzip -v.
  • Its fnfilter() keeps 0xe5 (since isprint(0xe5) is true under the default 8-bit table) but replaces continuation bytes with ?, giving \xe5??\xe5?? (e5 3f 3f e5 3f 3f), which decodes as \uFFFD??\uFFFD?? in UTF-8.

I have updated this PR to:

  1. Restore the zipinfoUnicode check so platforms lacking UNICODE_SUPPORT (such as stock macOS) continue to skip the zipinfo non-ASCII assertion, preserving baseline behavior.
  2. For systems with UNICODE_SUPPORT where fnfilter() still sanitizes non-ASCII bytes without wide-character printing (e.g. NixOS or Gentoo without natspec), normalize runs of ? and \uFFFD to match the non-ASCII placeholder.

Linter and test assertions are verified clean.

vedchaudhari reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.60%. Comparing base (1eb734d) to head (d64e99d).
⚠️ Report is 369 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66978      +/-   ##
==========================================
+ Coverage   90.58%   90.60%   +0.01%     
==========================================
  Files         797      797              
  Lines      278298   278298              
  Branches    53523    53518       -5     
==========================================
+ Hits       252095   252140      +45     
+ Misses      16570    16519      -51     
- Partials     9633     9639       +6     

see 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vedchaudhari
vedchaudhari reviewed Nov 16, 2026
View reviewed changes

@vedchaudhari vedchaudhari left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on macOS with the system zipinfo, passes. LGTM, thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell
jasnell requested a review from pipobscure November 16, 2026 15:03
jasnell
jasnell approved these changes Nov 16, 2026
View reviewed changes
LiviaMedeiros
LiviaMedeiros approved these changes Nov 16, 2026
View reviewed changes
@LiviaMedeiros LiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 16, 2026 •
edited by jasnell
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79185/ 💚

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pipobscure
pipobscure approved these changes Nov 16, 2026
View reviewed changes

@pipobscure pipobscure left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we just force the entire world to use UTF8 😢 😜

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vedchaudhari reacted with laugh emoji
All reactions
  • 😄 1 reaction
@jasnell jasnell added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 18, 2026
@nodejs-github-bot
nodejs-github-bot merged commit dd425b7 into nodejs:main Nov 18, 2026
66 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Landed in dd425b7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 18, 2026
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@ravi-arnan @aduh95
test: fix zipinfo non-ascii check in test-zlib-zip-interop
8ec2579
Keep UNICODE_SUPPORT guard so macOS skips checking non-ASCII names
in zipinfo output, and accept '?' / U+FFFD placeholders on builds
with UNICODE_SUPPORT that filter non-ASCII bytes in fnfilter()
without wide-character printing support (such as NixOS or Gentoo).

Fixes: #66975
Signed-off-by: Ravi Arnan <[email protected]>
PR-URL: #66978
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Philipp Dunkel <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@ravi-arnan @gabylb
test: fix zipinfo non-ascii check in test-zlib-zip-interop
5e5eb20
Keep UNICODE_SUPPORT guard so macOS skips checking non-ASCII names
in zipinfo output, and accept '?' / U+FFFD placeholders on builds
with UNICODE_SUPPORT that filter non-ASCII bytes in fnfilter()
without wide-character printing support (such as NixOS or Gentoo).

Fixes: nodejs#66975
Signed-off-by: Ravi Arnan <[email protected]>
PR-URL: nodejs#66978
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Philipp Dunkel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@pipobscure pipobscure pipobscure approved these changes
@LiviaMedeiros LiviaMedeiros LiviaMedeiros approved these changes
+1 more reviewer
@vedchaudhari vedchaudhari vedchaudhari left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

test/parallel/test-zlib-zip-interop.js fails if system's zipinfo is built without natspec

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@ravi-arnan @vedchaudhari @nodejs-github-bot @jasnell @pipobscure @LiviaMedeiros
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.