Skip to content

Fix Windows binary builds and decouple npm publish from all-binaries-succeed requirement#144

Merged
jasdeepkhalsa merged 2 commits intomasterfrom
copilot/fix-binary-failures-and-npm-step
Mar 7, 2026
Merged

Fix Windows binary builds and decouple npm publish from all-binaries-succeed requirement#144
jasdeepkhalsa merged 2 commits intomasterfrom
copilot/fix-binary-failures-and-npm-step

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

Windows builds (win32-x64, win32-arm64) consistently failed in the Release workflow, and the publish job was blocked from running whenever any binary failed.

Windows fix

Root cause: SPC v2.8.2 on Windows runs 7za -so archive.tar.xz | tar -C source\php-src --strip-components 1 during spc build, but never creates source\php-src beforehand — tar exits with "The system cannot find the path specified." The doctor --auto-fix step present on Unix was also absent from the Windows path.

Fix: Mirror Unix behaviour — run doctor --auto-fix first, then pre-create the source\ directory before download/build:

.\spc.exe doctor --auto-fix
New-Item -ItemType Directory -Force -Path source | Out-Null
.\spc.exe download "php-src,micro,..." --with-php="8.3"
.\spc.exe build "..." --build-micro

Note: darwin-x64 was listed as failed but was actually cancelled mid-run by a manual workflow cancellation — not a genuine build failure.

Resilient publish job

Root cause: needs: build-binary requires every matrix job to succeed; one Windows failure skipped the publish entirely — blocking the PHAR, Docker, and all successful Linux/macOS binaries from being released.

Changes:

  • needs: build-binaryneeds: [build-phar, build-binary] with if: ${{ !cancelled() && needs.build-phar.result == 'success' }} — publish runs whenever the PHAR is ready, regardless of individual binary failures
  • Binary copy step uses a copy_binary() helper that emits ::warning:: and continues on missing files instead of aborting
  • npm publish loop skips platform packages with no binary present (checks both dbdiff and dbdiff.exe)
  • GitHub Release files: uses globs (binaries/dbdiff-*/dbdiff, binaries/dbdiff-*/dbdiff.exe) so only produced binaries are attached; missing ones are silently omitted (already warned in the copy step)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • static-php.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Windows binary builds:
- Add `spc.exe doctor --auto-fix` before download/build (mirrors Unix)
- Pre-create `source/` directory to fix SPC v2.8.2 Windows bug where
  `7za | tar -C source\php-src` fails with 'system cannot find path'

Publish job (npm + GitHub Release):
- Change `needs: build-binary` → `needs: [build-phar, build-binary]`
  with `if: !cancelled() && build-phar succeeded` so publish runs even
  when individual platform binary builds fail
- Replace hard-fail `cp` with `copy_binary()` helper that warns and
  continues when a binary artifact is missing
- Skip npm publish for packages without a binary (checks both dbdiff
  and dbdiff.exe to handle Unix and Windows packages correctly)
- Use glob patterns in GitHub Release `files:` so only existing
  binaries are attached (missing ones silently omitted, already
  warned about in the copy step)

Co-authored-by: jas-os <262199218+jas-os@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 7, 2026

Copilot AI changed the title [WIP] Fix binary failures in DBDiff release and adjust npm step Fix Windows binary builds and decouple npm publish from all-binaries-succeed requirement Mar 7, 2026
@jas-os jas-os marked this pull request as ready for review March 7, 2026 10:54
@DBDiff DBDiff deleted a comment from jas-os Mar 7, 2026
@DBDiff DBDiff deleted a comment from Copilot AI Mar 7, 2026
@jasdeepkhalsa jasdeepkhalsa merged commit c9938c2 into master Mar 7, 2026
36 checks 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.

3 participants