Skip to content

🐛 Bypass MSYS2 bash in Windows pnatar wrapper to fix @-file expansion#2864

Merged
ChanTsune merged 2 commits into
mainfrom
ci/remove-msys2-bash-from-pnatar-wrapper
Mar 29, 2026
Merged

🐛 Bypass MSYS2 bash in Windows pnatar wrapper to fix @-file expansion#2864
ChanTsune merged 2 commits into
mainfrom
ci/remove-msys2-bash-from-pnatar-wrapper

Conversation

@ChanTsune

@ChanTsune ChanTsune commented Mar 29, 2026

Copy link
Copy Markdown
Owner

The MSYS2 runtime expands unquoted @-prefixed arguments as response files during process startup (dcrt0.cc::build_argv). This caused @archive arguments like @noclamp.tar to be replaced with the binary file contents before pna.exe could process them, breaking archive-to-archive copy on Windows.

Invoke pna.exe directly from the .cmd wrapper instead of going through MSYS2 bash, eliminating the @-file expansion entirely.

Summary by CodeRabbit

  • Chores
    • Simplified Windows wrapper generation by removing an intermediate wrapper script and producing a direct wrapper that invokes the built binary with the required compatibility flags.
    • Updated workflow trigger filters to stop referencing the removed wrapper script, reducing unnecessary build step complexity and improving reliability.

The MSYS2 runtime expands unquoted @-prefixed arguments as response
files during process startup (dcrt0.cc::build_argv). This caused
@archive arguments like @noclamp.tar to be replaced with the binary
file contents before pna.exe could process them, breaking
archive-to-archive copy on Windows.

Invoke pna.exe directly from the .cmd wrapper instead of going through
MSYS2 bash, eliminating the @-file expansion entirely.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4e4e147-4826-42b9-b399-f78008e485d1

📥 Commits

Reviewing files that changed from the base of the PR and between 17cc455 and 60cc967.

📒 Files selected for processing (2)
  • .github/scripts/pnatar-wrapper.sh
  • .github/workflows/bsdtar-compat.yml
💤 Files with no reviewable changes (1)
  • .github/scripts/pnatar-wrapper.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/bsdtar-compat.yml

📝 Walkthrough

Walkthrough

The bsdtar-compat GitHub Actions workflow was changed to stop using the repository bash wrapper and instead directly write a Windows pnatar.cmd that invokes the built pna binary with fixed flags; the standalone .github/scripts/pnatar-wrapper.sh script was removed. Non-Windows wrapper behavior is unchanged.

Changes

Cohort / File(s) Summary
Workflow: Windows wrapper generation
.github/workflows/bsdtar-compat.yml
Removed call to the repo bash wrapper and updated the Windows-only "Create pnatar wrapper" step to write pnatar.cmd directly to invoke the built pna binary with --log-level error compat bsdtar --unstable %%*.
Deleted wrapper script
.github/scripts/pnatar-wrapper.sh
Deleted the bash wrapper that expanded globs, set MSYS/MSYS2 env vars to prevent path mangling, and invoked pna.exe; its functionality is replaced by the pnatar.cmd generation in the workflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through scripts and CI trees,
Swapped bash for CMD with graceful ease.
No MSYS tweaks to make me twirl,
A simpler hop for Windows world 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing MSYS2 bash invocation with direct binary invocation in the Windows pnatar wrapper to fix @-file expansion issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/remove-msys2-bash-from-pnatar-wrapper

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/bsdtar-compat.yml:
- Line 330: The generated Windows wrapper currently writes a line that calls
PNA_WIN (which points to the wrapper itself) causing self-recursion; change the
printf so the wrapper invokes the actual pna executable instead of PNA_WIN —
e.g. use the real Windows executable variable (referenced as PNA_EXE or compute
from PNATAR_BIN by replacing the .cmd name with .exe) in the printf call that
writes to PNATAR_BIN so the wrapper runs pna.exe with the same arguments and
flags rather than re-invoking the .cmd.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ac631f0-6502-4842-ac18-9df386ffdab9

📥 Commits

Reviewing files that changed from the base of the PR and between 6a50603 and 17cc455.

📒 Files selected for processing (1)
  • .github/workflows/bsdtar-compat.yml

Comment thread .github/workflows/bsdtar-compat.yml
@github-actions github-actions Bot added the CI Pull requests that update CI config label Mar 29, 2026
The previous commit bypassed MSYS2 bash, making the wrapper script
unreferenced. Remove the script and its path trigger entries from
the workflow.
@ChanTsune
ChanTsune merged commit 43b88e7 into main Mar 29, 2026
20 checks passed
@ChanTsune
ChanTsune deleted the ci/remove-msys2-bash-from-pnatar-wrapper branch March 29, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Pull requests that update CI config

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant