Share content-keyed builds of ployz, ployzd and the SDK across worktrees#1808

merged2
main
verify-fast/a2-artifact-key
openedOct 13, 2026byNNick
View on GitHubGitHub import enabledPR last imported 21d ago

scripts/artifacts.py keys each artifact by the sources its build reads: the crate's workspace dependency closure, the workspace Cargo files and a recipe tag, with dirty and untracked files counted. Builds land in ~/.cache/ployz/artifacts, pruned after 30 days or past 20 GB.

verify-cluster and build-cloud-sdk.sh both fetch by key before building, so a fresh worktree of an already-built tree skips cargo. Measured on this host: SDK 113.7 s miss, 2.7 s hit (the node tests); ployz plus ployzd 230.8 s miss, 2.8 s hit with identical binaries.

core/rust-toolchain.toml pins the compiler to 1.97.1 and is one of the workspace files every key reads, so a toolchain bump moves every key. test_the_toolchain_moves_every_key checks that; removing the file from WORKSPACE fails it. test_every_rust_pin_names_the_toolchain_files_compiler checks the root Dockerfile, setup-rust, ci.yml, release-contracts.yml and core/Cargo.toml name the same version; setting the Dockerfile to 1.98.0 fails it.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Checks

15 successful · 1 skipped
All checks passed
43150fc
Synced from GitHub

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f660c480-1f53-4ab3-8301-abd805c8771e
📥 Commits

Reviewing files that changed from the base of the PR and between c6024d591f19743cfcbc1931cd3634c14e4d58cf and 8691d62c8a34f6a58a26015b460b54338e06bd63.

📒 Files selected for processing: 6
  • .github/workflows/ci.yml
  • core/rust-toolchain.toml
  • core/scripts/artifacts.py
  • core/scripts/build-cloud-sdk.sh
  • core/scripts/test_artifacts.py
  • core/scripts/verify-cluster
ascii
1 _________________________________________
2< Never ask an AI its Energy Star rating. >
3 -----------------------------------------
4 \
5 \ \
6 \ /\
7 ( )
8 .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Cchatgpt-codex-connectorBotreviewed · 1 inline threadOct 13, 2026
Synced from GitHub

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0322b1316

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

core/scripts/artifacts.pyline 22Outdated · a0322b1Open thread
……@@ -0,0 +1,255 @@
19+import sys
20+import tempfile
21+import time
22+import tomllib

P1 Badge Fall back when Python lacks tomllib

On systems where python3 is present but older than 3.11 (notably many macOS/Xcode and Ubuntu 22.04 installations), importing this module fails with ModuleNotFoundError because tomllib is unavailable. build-cloud-sdk.sh only checks that python3 exists and runs the key command under set -e, so it aborts instead of taking the documented uncached-build fallback; verify-cluster now fails at startup for the same reason. Either retain compatibility with those Python versions (for example via a fallback parser) or check the interpreter capability before enabling the cache.

Useful? React with 👍 / 👎.

Synced from GitHub

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-10-13T23:50:38.993224Z43150fcNew commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Added 2 commits

  • Share content-keyed builds of ployz, ployzd and the SDK across worktrees1850ca8
  • Key builds by the Rust toolchain43150fc
Cchatgpt-codex-connectorBotreviewed · 2 inline threadsOct 13, 2026
Synced from GitHub

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43150fcb9e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

core/scripts/artifacts.pylines 150–151Open thread
……@@ -0,0 +1,255 @@
148+ return
149+ # The binaries are stripped, so DWARF is wasted work: a third of an edit rebuild.
150+ commands(["cargo", "build", "--locked", *(arg for name in missing for arg in ["-p", name]), *cargo_args],
151+ cwd=CORE, timeout=1800, env={**os.environ, "CARGO_PROFILE_DEV_DEBUG": "0"})
Cchatgpt-codex-connectorBoton lines 150–151Oct 13, 2026

P1 Badge Keep packages referenced by feature flags selected

When only one cache entry misses—normally after editing just ployz or ployzd—this reduces the -p list but forwards the original PLOYZ_VERIFY_CARGO_ARGS. The documented warm/volume-move invocation uses --features ployz/verify-faults,ployzd/verify-faults; with only -p ployzd, Cargo rejects ployz/verify-faults because that package is not selected, and the converse fails too, so these experiments cannot rebuild after a partial cache hit. This matches cargo build --help, where -p is the “Package to build” and --features supplies the features to activate; retain all packages referenced by qualified feature flags or filter the flags with the misses.

Useful? React with 👍 / 👎.

core/scripts/artifacts.pylines 127–129Open thread
……@@ -0,0 +1,255 @@
126+ shared = {path: blob for path, blob in files.items() if not path.startswith("crates/")}
127+ recipe = [spec.recipe, kind, f"{platform.system()}-{platform.machine()}", extra, digest(shared),
128+ *(f"{name} {by_crate[name]}" for name in sorted(by_crate))]
129+ return Key(kind, hashlib.sha256("\n".join(recipe).encode()).hexdigest()[:32], by_crate)
Cchatgpt-codex-connectorBoton lines 127–129Oct 13, 2026

P2 Badge Include effective compiler settings in artifact keys

The key includes source state, platform, and explicit Cargo arguments, but the build inherits every environment variable through os.environ. After a default build is cached, rerunning with settings such as RUSTFLAGS, CARGO_PROFILE_DEV_OPT_LEVEL, CARGO_PROFILE_RELEASE_LTO, or a RUSTUP_TOOLCHAIN override returns the old artifact without invoking Cargo, even though those settings can change the binary; before this cache layer, Cargo's own fingerprints handled them. Hash the effective compiler/profile inputs or sanitize unsupported build variables before cache lookup.

Useful? React with 👍 / 👎.