Repository navigation
Fix failing integration test - #11
Conversation
…its configure checks under the C23 default of ubuntu-26.04's GCC. so build C code as gnu17. upgrade actions to node.js 24
azuchi
left a comment
There was a problem hiding this comment.
Thanks for the fix. I checked that -std=gnu17 actually reaches all three bundled libraries: gmp-mpfr-sys 1.4.8's build.rs runs GMP's configure with the inherited environment, and MPFR/MPC pick up the same flags via __GMP_CFLAGS in gmp.h. The CFLAGS is step-scoped env:, so it doesn't leak into other steps. No correctness bugs found; the inline comments are about root cause and maintainability.
One more item that isn't on a changed line: the Record runner environment step records the Rust toolchain explicitly because tapyrus-setup is built on the unpinned runner (see the comment around line 143). Now that we know the build also depends on the host C compiler's default standard, it would be worth adding gcc --version to the same block so the environment fingerprint shows the compiler version the next time a configure check breaks.
| @@ -189,6 +189,10 @@ jobs: | |||
| -t tapyrus-seeder:integration-test workdir/tapyrus-seeder | |||
|
|
|||
| - name: Build tapyrus-setup binary | |||
There was a problem hiding this comment.
Root cause rather than symptom: two steps above, the workflow already builds tapyrus-signer:integration-test, and that image's Dockerfile copies target/release/tapyrus-setup into /usr/local/bin/ (built with the pinned rust:1.82-bookworm toolchain). This step then rebuilds the same binary a second time on the host with whatever GCC/rustc ubuntu-latest happens to ship, which is exactly the path that broke here.
Replacing the host build with something like
run: |
id=$(docker create tapyrus-signer:integration-test)
mkdir -p workdir/tapyrus-signer/target/release
docker cp "$id:/usr/local/bin/tapyrus-setup" workdir/tapyrus-signer/target/release/
docker rm "$id"would drop the multi-minute cold build of GMP/MPFR/MPC entirely and remove the dependency on the runner toolchain, so the next GCC/rustc default change can't break this step again. generate_dev_secrets.py / sign_genesis.py already look at that default path (or accept a [tapyrus-setup-bin] argument). A bookworm (glibc 2.36) binary runs fine on the newer glibc of ubuntu-26.04.
| -t tapyrus-seeder:integration-test workdir/tapyrus-seeder | ||
|
|
||
| - name: Build tapyrus-setup binary | ||
| # The GMP bundled by gmp-mpfr-sys fails its configure checks under the |
There was a problem hiding this comment.
This only fixes CI. The same cd workdir/tapyrus-signer && cargo build --release is documented as the local procedure in scripts/generate_dev_secrets.py, simulate_federation_change.py, simulate_maxblocksize_change.py and doc/scripts.md, so anyone on a GCC 15+ machine (Ubuntu 26.04, Fedora 42, ...) hits the same GMP configure failure. The header comment of this file points to doc/work-done.md for known issues, and the equivalent macOS lesson (brew install gmp) is recorded there, so this one should be added too, with the CFLAGS workaround.
|
|
||
| - name: Build tapyrus-setup binary | ||
| # The GMP bundled by gmp-mpfr-sys fails its configure checks under the | ||
| # C23 default of ubuntu-26.04's GCC, so build C code as gnu17. |
There was a problem hiding this comment.
Nit: runs-on: ubuntu-latest is a floating tag, so tying the comment to "ubuntu-26.04" will go stale as soon as the image moves on, and a reader may conclude the workaround is 26.04-specific and can be removed. The actual condition is "GCC 15+ defaults to gnu23". Suggest stating that, plus when the workaround can go away (e.g. once gmp-mpfr-sys bundles a C23-clean GMP).
| # The GMP bundled by gmp-mpfr-sys fails its configure checks under the | ||
| # C23 default of ubuntu-26.04's GCC, so build C code as gnu17. | ||
| env: | ||
| CFLAGS: -O2 -std=gnu17 |
There was a problem hiding this comment.
Two things worth a note in the comment:
-O2is not optional: onceCFLAGSis set, GMP's configure uses it verbatim instead of choosing its own optimisation/tuning flags, so dropping-O2and keeping only-std=gnu17silently produces an unoptimised GMP (noticeably slower key generation).- This
CFLAGSapplies to everycc-crate C dependency in the build (e.g. secp256k1-sys), not just gmp-mpfr-sys, and the trailing-O2overrides the-O3thatccadds for release builds.
If the host build is kept, please document what each flag is for; otherwise the docker cp approach above avoids the question altogether.
| steps: | ||
| - name: Checkout this repo | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v5 |
There was a problem hiding this comment.
Nit: if the goal is the Node.js 24 runtime, checkout v5 / setup-python v6 / upload-artifact v6 are intermediate majors; v7 of all three (checkout v7.0.1, setup-python v7.1.0, upload-artifact v7.0.2) is already out, so we'll be doing this bump again soon. Either go to v7 now or leave a note on why v5/v6 were chosen.
Scheduled workflows are disabled after 60 days without repository activity, and this repository changes rarely. Add workflow_call so tapyrus-core can run the test as one of its jobs. Name this repository in the checkout step, because a called workflow would otherwise check out its caller. Skip the job in every other repository, including forks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
azuchi
left a comment
There was a problem hiding this comment.
Looked at the new workflow_call commit together with the caller in chaintope/tapyrus-core#502 (schedule-only job, uses: ...@main). The concurrency keys don't collide: the caller's group is Weekly Heavy Test-refs/heads/master and this workflow's is Weekly Heavy Test-schedule-refs/heads/master, so no self-cancel or deadlock. Since the caller fires on schedule, the full-scale scenario and the 6h timeout apply as intended.
The earlier inline comments (tapyrus-setup double build, local docs, CFLAGS comment wording, action versions, gcc in the fingerprint) are still open.
|
|
||
| # Lets chaintope/tapyrus-core run this as one of its jobs. Inputs are left | ||
| # blank, so the env: block's defaults apply. | ||
| workflow_call: |
There was a problem hiding this comment.
With tapyrus-core now calling this every Sunday at 12:17 UTC, this repo's own schedule (Sunday 03:00 UTC) is redundant. It is currently disabled for inactivity, but if anyone re-enables it we get two full 6h runs every Sunday against the same master refs. Suggest dropping the schedule: trigger here (and updating the header comment / README's trigger description), or at least noting that the workflow should stay disabled in this repo.
| jobs: | ||
| integration-test: | ||
| # Forks skip this job, and tapyrus-core is the only repo allowed to call it. | ||
| if: github.repository == 'chaintope/tapyrus-integration-tests' || github.repository == 'chaintope/tapyrus-core' |
There was a problem hiding this comment.
This also skips runs in contributors' forks. The push: branches: '**' trigger above is commented as a workaround for the first-time-contributor approval gate, i.e. running the smoke test on a fork. Is that workaround still needed? If yes, this condition defeats it; if not, the TEMPORARY comment and '**' can go in this PR.
| uses: actions/checkout@v5 | ||
| with: | ||
| # When called from another repo, checkout defaults to the caller. | ||
| repository: chaintope/tapyrus-integration-tests |
There was a problem hiding this comment.
Without ref:, a cross-repo call checks out this repo's default branch, not the ref in the caller's uses: ...@<ref>. That matches today because the caller uses @main, but if it is ever pinned to a tag or SHA, the workflow file and the scripts/compose files would come from different commits. Worth a note in this comment (or in the caller) that the caller must stay on @main.
…fr-sys build as suggested, fix comments and docs
azuchi
left a comment
There was a problem hiding this comment.
Thanks, this addresses everything from the previous rounds: the own schedule is gone, the fork/push workaround is cleaned up, the @main requirement is documented, actions are on v7, and tapyrus-setup now comes out of the signer image (whose final stage does copy it to /usr/local/bin/). The GCC 15 lesson in doc/work-done.md is clear. The smoke run on this head passed.
A few small follow-ups below; only the first one can actually break a run.
Nit outside the diff: the concurrency comment ("a push-triggered smoke run can't cancel a scheduled full run") is stale now that schedule is gone. The scheduled full run happens in tapyrus-core's context, where github.workflow is the caller's name, so it never shares a group with this repo's push runs anyway.
| run: cd workdir/tapyrus-signer && cargo build --release | ||
| - name: Copy tapyrus-setup binary out of the signer image | ||
| # Runs the build the signers ship, and keeps this runner's compiler out of the job. | ||
| run: | |
There was a problem hiding this comment.
Now that the binary comes from the image, docker_build_platform also decides the architecture of tapyrus-setup. With a non-native value (README mentions local verification used linux/arm64), the copied binary is foreign-arch and dynamically linked, so generate_dev_secrets.py / sign_genesis.py fail on the x86 runner with an exec format error even if image builds work via QEMU. Previously the host build was always native. Either note on the input that it must match the runner's architecture, or run the ceremony through the image instead of copying the binary out.
| - **Example**: `./scripts/generate_dev_secrets.py signer-set-a 3 2` | ||
| - `tapyrus-setup-bin` defaults to `workdir/tapyrus-signer/target/release/tapyrus-setup` | ||
| (build it first with `cd workdir/tapyrus-signer && cargo build --release`). | ||
| (build it first with `cd workdir/tapyrus-signer && cargo build --release`; with GCC 15 |
There was a problem hiding this comment.
Nit: the same build hint is still printed without the GCC 15 note by scripts/generate_dev_secrets.py (docstring and the missing-binary message), simulate_federation_change.py and simulate_maxblocksize_change.py. Since the binary-not-found message is where people actually hit this, it may be worth pointing those at doc/work-done.md too, or mentioning the docker cp route as an alternative to building.
…up build hint A non-native platform would make the tapyrus-setup copied from the signer image unusable on the runner, and an empty value already builds for the runner's architecture, so remove the input. Reword the concurrency comment now that this repo has no schedule; event_name stays in the key so a push can't cancel a manual full run on main. Keep one build hint, with a pointer to the GCC 15 and macOS notes, and use it from the simulate scripts.
|
Removed docker_build_platform. We run on one Linux runner and always build for its architecture, so an empty value was already right, and any other value would break tapyrus-setup. other comments are also updated |
|
Thanks. The shared build hint in the scripts looks good: one However, the latest commit (47b7b0d) only touches the three scripts. The
Looks like those files didn't make it into the commit. Could you push them? |
The GMP bundled by gmp-mpfr-sys fails its configure checks under the C23 default of ubuntu-26.04's GCC. So build C code as gnu17.
upgrade actions to node.js 24