Skip to content

Build Samples Solution: transient yarn resolution failure (@swc/core-darwin-x64@1.16.22 registry propagation race) #678

Open

Description

@cratis-direct-wright

What happened

The Build Samples Solution workflow failed on main at commit 4bf80a546e0b84808e07aae326e14f966856e4ba (merge of #677):

https://github.com/Cratis/Samples/actions/runs/42012017428

Every Frontend — * job failed in the yarn install step with:

➤ YN0082: @swc/core-darwin-x64@npm:1.16.22: No candidates found
➤ YN0000: · Failed with errors in 5s 43ms

Root cause

This repository intentionally carries no committed yarn.lock (**/yarn.lock is gitignored — see conventions.md), so every yarn install re-resolves live against whatever is newest on the npm registry instead of a pinned set of versions.

@swc/core@1.16.22 had been published only moments before the run (same-day nightly tag 1.16.22-nightly-20261105.1 plus the stable 1.16.22). Its optional platform package @swc/core-darwin-x64@1.16.22 had not finished replicating across the registry yet, so Yarn's resolution step couldn't find it — a transient propagation race, not a bad pin or a removed/unpublished version.

Verification

Suggested follow-up (optional hardening)

Since there's no lockfile to pin against by design, this class of registry-propagation race can recur for any transitive dependency with per-platform optional packages. A small retry around the yarn install step in .github/workflows/build.yml (the frontend job) would let a future race resolve itself instead of failing the whole build, following the existing .github/scripts/push-with-retry.sh convention:

#!/usr/bin/env bash
# .github/scripts/yarn-install-with-retry.sh
set -euo pipefail

attempts=${YARN_INSTALL_RETRY_ATTEMPTS:-3}

for ((attempt = 1; attempt <= attempts; attempt++)); do
    if yarn install; then
        echo "yarn install succeeded on attempt ${attempt} of ${attempts}"
        exit 0
    fi

    if [ "${attempt}" -eq "${attempts}" ]; then
        break
    fi

    delay=$((attempt * 30))
    echo "yarn install attempt ${attempt} of ${attempts} failed - retrying in ${delay}s in case this is a registry propagation delay..."
    sleep "${delay}"
done

echo "::error::yarn install failed after ${attempts} attempts"
exit 1

...called from the frontend job instead of run: yarn install.

I'm not opening a PR for this: the GitHub App token available to me is blocked from creating or updating workflow files (refusing to allow a GitHub App to create or update workflow .github/workflows/build.yml without workflows permission), so a maintainer with the right permissions would need to add it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions