zjncs opened a new issue, #5603:
URL: https://github.com/apache/rocketmq-dashboard/issues/5603

   ## Description
   
   `rmqctl/scripts/package-release.sh` builds the Windows release zip with a 
python fallback when `zip` is unavailable — i.e. exactly on Windows dev 
machines, where Git Bash ships without `zip`:
   
   ```bash
   if command -v zip >/dev/null 2>&1; then
       zip -r -q "$archive" .
   else
       python3 - "$archive" <<'PY'
   ...
               z.write(path, os.path.relpath(path, '.'))
   PY
   fi
   ```
   
   Two defects make this fallback fail on the platform it exists for:
   
   1. **`python3` on stock Windows is the Microsoft Store execution-alias 
stub** (`WindowsApps/python3`): it exists on PATH and `command -v` succeeds, 
but running it exits **silently with code 49** and does nothing. The script 
dies with a bare `exit status 49` and no diagnostic — the repo's own packaging 
test fails at the gate on Windows:
   
   ```
   --- FAIL: TestBinaryLicensePackagingTest/windows
       license-binary_test.go:61: packaging gate returned the wrong result 
success=true err=exit status 49
   ```
   
   (A real `python` is typically installed alongside the stub, so trying it 
second fixes stock setups.)
   
   2. **The heredoc writes backslash zip entry names on Windows**: 
`os.path.relpath` yields `legal\licenses\...`, and `zipfile` stores it verbatim 
— violating the zip spec (entry names must use forward slashes) and breaking 
every consumer that looks up `legal/licenses/...` (the packaging test's own 
lookups would miss every file even with a working interpreter).
   
   CI never sees either: the ubuntu runner has `zip` installed, so the fallback 
never runs there — while the repo explicitly supports Windows packaging 
(`build-windows.ps1`, windows in `build-all`, and the test exercising the 
windows target).
   
   ## Expected behavior
   
   - Probe python candidates with an actual `import zipfile` (not just `command 
-v`) before using them, trying `python3` then `python`, and fail with a clear 
message if none works
   - Write zip entry names with forward slashes on every platform
   
   ## Environment
   
   - branch: master (0228dad5)
   - file: `rmqctl/scripts/package-release.sh` (the Windows zip branch)


-- 
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