zjncs opened a new pull request, #5604:
URL: https://github.com/apache/rocketmq-dashboard/pull/5604

   Closes #5603
   
   ## Problem
   
   The Windows-release zip is built by a python fallback exactly where `zip` is 
absent — Windows dev machines — but it is broken twice there:
   
   1. `python3` on stock Windows is the **Microsoft Store execution-alias 
stub**: on PATH, `command -v` succeeds, but running it exits silently with code 
49. The packaging gate dies with a bare `exit status 49` and no diagnostic (the 
repo's own test fails at the gate: `packaging gate returned the wrong result 
success=true err=exit status 49`).
   2. Even with a working interpreter, `os.path.relpath` yields backslash paths 
on Windows and `zipfile` stores them verbatim — violating the zip spec 
(forward-slash entry names) and breaking every consumer that looks up 
`legal/licenses/...`.
   
   CI never sees either (ubuntu has `zip`, so the fallback never runs), while 
the repo explicitly supports Windows packaging.
   
   ## Fix
   
   - Probe candidates with a real `"$candidate" -c "import zipfile"` (not just 
`command -v`), trying `python3` then `python`; fail with a clear message if 
none works
   - Normalize entry names: `os.path.relpath(path, '.').replace(os.sep, '/')`
   
   ## Verification
   
   - `go test -count=1 ./scripts/ -run 
'TestBinaryLicensePackagingTest/windows'`: **FAIL on the base (gate exit 49) → 
PASS with this change**; the full `./scripts/` suite passes with both subtests 
green
   - Manual `bash scripts/package-release.sh <win-binary> windows amd64 fixture 
...`: exit 49 with no archive before, exit 0 + archive + sha256 after
   - Zip inspection: 30 entries, **zero backslashes**, 
`legal/licenses/github.com/spf13/[email protected]/LICENSE.txt` present with forward 
slashes
   - Mutation check: reverting only this script change makes the windows 
subtest fail at the gate again; restoring it passes
   
   ## Stacking note
   
   Branch contains one commit on top of **#5602** (the CRLF attribution-split 
fix, a separate defect in the same test's other subtest) so the windows subtest 
can go fully green — with only this PR's commit, the subtest would progress 
from the gate error to the content assertion. Review the second commit alone if 
preferred; both files are otherwise untouched by any open PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to