From 4e073342b0e5a82595f3d39aa75b35e7fe78146b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 10:32:00 +0000 Subject: [PATCH] Build coverage-docker's binary once per leg Each coverage-docker leg compiled the whole dependency graph twice: a `cargo build --bin socket-patch` under `cargo llvm-cov show-env` into target/, then `cargo llvm-cov --no-report` into target/llvm-cov-target/. The first build (~2.7 min per leg, 10 legs per run) was also wasted: `cargo llvm-cov report` outside show-env reads only target/llvm-cov-target/*.profraw and objects under that directory, so neither the target/debug binary nor the in-container profraws written to target/ reached the lcov. Mount the socket-patch that the test step's own build produces for the integration tests and write the container's profraws into target/llvm-cov-target, so the in-container code paths merge into the per-ecosystem lcov. Fixes #1199. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01NwbTSymWm3Yuq2kZW9Eagi --- .github/workflows/ci.yml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd4db6eac..e3dac38cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -710,24 +710,18 @@ jobs: tags: socket-patch-test-${{ matrix.ecosystem }}:latest load: true - - name: Build instrumented socket-patch binary - # Source `cargo llvm-cov show-env` into the current shell so this - # `cargo build` picks up RUSTC_WRAPPER=cargo-llvm-cov and the - # same RUSTFLAGS that the subsequent `cargo llvm-cov` test step - # will use. The bin we build ends up byte-compatible with the - # test binaries — same source hashes → unified coverage map at - # report time. Env stays scoped to this step (intentional; - # cargo llvm-cov manages its own env in the test step). - run: | - eval "$(cargo llvm-cov show-env --export-prefix 2>/dev/null)" - cargo build --bin socket-patch - - name: Configure docker-e2e coverage hooks + # Mount the instrumented socket-patch that the test step's own + # `cargo llvm-cov` builds for the integration tests (cargo builds + # a package's bins before running its integration tests), and + # write the in-container profraws next to the test processes' + # ones. `cargo llvm-cov report` reads only + # target/llvm-cov-target/*.profraw and objects built there, so a + # separately built binary or profraws elsewhere in target/ never + # reach the lcov. run: | - echo "SOCKET_PATCH_COV_BIN=$PWD/target/debug/socket-patch" >> "$GITHUB_ENV" - # Profraw files from the in-container binary land here. - # cargo-llvm-cov scans target/ for *.profraw at report time. - echo "SOCKET_PATCH_COV_PROFRAW_DIR=$PWD/target" >> "$GITHUB_ENV" + echo "SOCKET_PATCH_COV_BIN=$PWD/target/llvm-cov-target/debug/socket-patch" >> "$GITHUB_ENV" + echo "SOCKET_PATCH_COV_PROFRAW_DIR=$PWD/target/llvm-cov-target" >> "$GITHUB_ENV" - name: Run ${{ matrix.ecosystem }} Docker e2e test with coverage run: |