Skip to content

Publish a nightly only when every platform built - #340

Merged
jfrolich merged 2 commits into
ocaml-to-rust-rewritefrom
nightly-require-every-platform
Nov 16, 2026
Merged

jfrolich merged 2 commits into
ocaml-to-rust-rewritefrom
nightly-require-every-platform

Conversation

@jfrolich

Copy link
Copy Markdown
Owner

The nightly of 00c12b2 shipped without a macOS package. GitHub never gave its darwin-arm64 build a runner ("The job was not acquired by Runner of type hosted even after multiple attempts"). The publish job ran anyway: it is if: ${{ !cancelled() }}, so it also runs when a build fails or is cancelled. That left @rescript/darwin-arm64 out of the compiler package's optional dependencies. A project that installs that nightly loses macOS from its lockfile. npm versions are immutable, so no rerun can add it back.

Change

  • nightly.yml: publish now needs every build to succeed. If a platform is missing, the commit is left unpublished, and "Re-run failed jobs" builds that platform and then publishes, since npm has nothing of that version yet.
  • scripts/nightlyPackages.js: fails when a platform's binaries are missing. --allow-missing-platforms keeps the old behaviour, for a dry run on one machine.

A rerun after a newer commit has been published still refuses to move the dist-tag back, as before.

Testing

On a throwaway checkout with binaries only for linux-x64, linux-arm64 and win32-x64, node scripts/nightlyPackages.js --scope @tellahq --dry-run exits 1 with No binaries in bin/ for darwin-arm64: a nightly needs every platform (--allow-missing-platforms publishes without them). With --allow-missing-platforms it gets past that check as before. This PR touches the pipeline, so its own nightly run builds all four platforms and does an npm publish --dry-run.

Started by Jaap Frolich in this Assistant session

open-session-submodule Bot and others added 2 commits November 16, 2026 16:38
Why:
    The nightly of 00c12b2 has no macOS package: GitHub gave its
    darwin-arm64 build no runner ("not acquired by Runner of type hosted
    even after multiple attempts"), and the publish job ran anyway, as it
    did for any build that failed or was cancelled, leaving the platform
    out of the compiler package. Installing that nightly drops macOS from
    a project's lockfile, and since npm versions cannot change, no rerun
    could add it back.

The publish job now needs every build to succeed, so a missing platform
leaves the commit unpublished, and "Re-run failed jobs" builds it and
publishes it then. `scripts/nightlyPackages.js` also fails when a
platform's binaries are missing; `--allow-missing-platforms` keeps the
old behaviour for a dry run on one machine.

Workflow modified (.github/workflows/nightly.yml, a platform build cancelled):
Before (text):
    publish: runs (if: !cancelled()) -> @tellahq/rescript@<version> without darwin-arm64, tagged nightly
After (text):
    publish: skipped -> nothing published; re-run failed jobs -> darwin-arm64 builds, then publish

Command modified (node scripts/nightlyPackages.js --scope @tellahq, darwin-arm64 binaries missing):
Before (text):
    publishes linux-arm64, linux-x64, win32-x64; "Not built, so not published: darwin-arm64"
After (text):
    No binaries in bin/ for darwin-arm64: a nightly needs every platform (--allow-missing-platforms publishes without them).   (exit 1)

Co-authored-by: Jaap Frolich <jfrolich@gmail.com>
Session: https://os.submodule.nl/session/os-01a1e3ed-7092-7ff6-a2b2-b5eb642ab42e
Signed-off-by: Jaap Frolich <jfrolich@gmail.com>
Co-authored-by: Jaap Frolich <jfrolich@gmail.com>
Session: https://os.submodule.nl/session/os-01a1e3ed-7092-7ff6-a2b2-b5eb642ab42e
Signed-off-by: Jaap Frolich <jfrolich@gmail.com>
@jfrolich
jfrolich merged commit 29887e2 into ocaml-to-rust-rewrite Nov 16, 2026
27 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.

1 participant