fix(resolver): ship empty primer when generator script unavailable#425
fix(resolver): ship empty primer when generator script unavailable#425
Conversation
cargo publish --verify builds inside target/package/aube-resolver-N/, where scripts/generate-primer.mjs at the workspace root is no longer reachable. When neither the bundled data file nor the generator script is available, fall back to an empty primer instead of panicking. Runtime already tolerates an empty PRIMER_INDEX and falls through to network packument fetches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes a Confidence Score: 5/5Safe to merge — change is minimal, well-scoped, and the fallback path is correctly wired to the runtime's existing tolerance for an empty primer. Single-file change with a straightforward fallback. The potentially tricky omission of AUBE_PRIMER_GENERATED_AT is already handled by option_env! in primer.rs. Both output files (primer-packages.bin, primer_index.rs) are still written before the early return. No logic errors found. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(resolver): ship empty primer when ge..." | Re-trigger Greptile |
Benchmark changesVersions:
Public ratios: warm installs vs Bun 3x -> 5x; warm installs vs pnpm 9x -> 12x.
f3dcca9 vs aecb50f | aube/bun/pnpm | 3 scenarios | 3 runs | 500mbit/50ms | generated by Codex. |
## Summary The v1.6.0 release shipped to GitHub but only with darwin-arm64 and the two windows tarballs — all four Linux targets failed to upload, and the downstream npm/COPR/PPA publish jobs all failed too. Fixes the three independent root causes: - **`crates/aube-resolver/build.rs`** panics via `.expect()` when `node` is absent. The cross-rs Docker container that builds Linux release binaries and the Fedora COPR mock chroot that builds the SRPM both have `scripts/generate-primer.mjs` visible (mounted / bundled in the source tarball) but no `node` binary, so the existing "no script → empty primer" fallback (#425) doesn't trigger. Fall back on `ErrorKind::NotFound` from `Command::status()` so the same empty-primer path covers all three "no node" environments. Verified locally with `env -i` + a node-less PATH: emits `cargo:warning=node not found in PATH; shipping empty primer` and builds clean. - **`publish-npm`** fails with `Unsupported GitHub Actions runner environment: "self-hosted". Only "github-hosted" runners are supported when publishing with provenance.` Move the job from the namespace runner to `ubuntu-latest`. Trusted Publishing requires a github-hosted OIDC identity; the publish job is otherwise light enough that the namespace runner saves nothing. - **`ppa-publish`** fails at `dput` with `Connection failed, aborting. Check your network` — namespace runners block outbound FTP (port 21) to `ppa.launchpad.net`. Move to `ubuntu-latest` which allows it. After merge, re-run the failed jobs against `v1.6.0` to backfill the missing Linux assets and complete the npm/COPR/PPA publishes. ## Test plan - [x] `cargo build -p aube-resolver` from a node-less PATH falls back to the empty primer with the new `cargo:warning=` - [x] `cargo build -p aube-resolver` with node present still generates the primer and builds normally - [x] `cargo clippy -p aube-resolver --all-targets -- -D warnings` clean - [x] `cargo fmt --check` clean - [ ] Re-run release-plz upload-assets for `v1.6.0` after merge → confirm Linux tarballs land on the GH release - [ ] Re-run `publish-npm` for `v1.6.0` → confirm `@endevco/aube*` lands on npmjs.com with provenance - [ ] Re-run `copr-publish` for `v1.6.0` → confirm Fedora 42/43/44/rawhide builds succeed - [ ] Re-run `ppa-publish` for `v1.6.0` → confirm dput uploads the source package 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk because it changes release/publishing CI runners and alters `aube-resolver` build-time primer generation behavior (now falling back to an empty primer when `node` is unavailable), which could affect release packaging and runtime performance if mis-triggered. > > **Overview** > Unblocks release publishing by switching the `publish-npm` and `ppa-publish` GitHub Actions jobs from the self-hosted namespace runner to `ubuntu-latest` to satisfy npm Trusted Publishing provenance requirements and allow outbound FTP for Launchpad `dput` uploads. > > Makes `crates/aube-resolver/build.rs` resilient to environments where the primer generator script exists but `node` is not installed: `generate()` now returns a boolean and treats `ErrorKind::NotFound` as a non-fatal condition (emitting a `cargo:warning=`) so builds fall back to shipping an empty primer instead of panicking. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fa90723. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
aube-resolver@1.5.2becausecargo publish --verifyruns the build script fromtarget/package/aube-resolver-1.5.2/, where the workspace-levelscripts/generate-primer.mjsis unreachable.PRIMER_INDEXand falls through to network packument fetches.Repro
Locally
cargo package -p aube-resolver(the verify pass) failed the same way before this fix and now succeeds.Test plan
cargo build -p aube-resolvercargo clippy -p aube-resolver --all-targets -- -D warningscargo test -p aube-resolver --lib primercargo package -p aube-resolver(verify step compiles cleanly)After merge, re-run release-plz to finish the partially-published v1.5.2 (aube-util/manifest/settings/lockfile/store/linker/registry already shipped; resolver/scripts/workspace/aube still pending).
🤖 Generated with Claude Code
Note
Low Risk
Low risk build-script change that only affects the fallback path when primer data is missing; main risk is unintentionally shipping without bundled primer data, which should degrade performance but not correctness.
Overview
Makes
aube-resolver’sbuild.rsresilient when packaging/publishing: if the primer data file is missing and the workspacescripts/generate-primer.mjscan’t be found, it now writes an empty primer blob/index and exits instead of attempting generation.If
AUBE_PRIMER_PATHis explicitly set to a non-file, it still panics; otherwise generation proceeds as before when the script is available.Reviewed by Cursor Bugbot for commit f3dcca9. Bugbot is set up for automated code reviews on this repo. Configure here.