diff --git a/docs/ci.md b/docs/ci.md index 910b93f..85cf259 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -112,12 +112,17 @@ check a change to the tests the way CI runs them, with every failing test of every crate listed in one go (`--no-fail-fast`): ```sh +# A bare clone of the private VoelinProtocol repository (see below the block). +: "${PROTOCOL_GIT:?path of a bare clone of VoelinProtocol}" # Root owns what the container writes: keep it in a directory of its own. mkdir -p .scratch -docker run --rm -v "$PWD":/src -w /src -e HOME=/root \ +docker run --rm --init -v "$PWD":/src -w /src -e HOME=/root \ + -v "$PROTOCOL_GIT":/protocol.git:ro -e CARGO_NET_GIT_FETCH_WITH_CLI=true \ -e CARGO_HOME=/src/.scratch/cargo -e RUSTUP_HOME=/src/.scratch/rustup \ -e CARGO_TARGET_DIR=/src/.scratch/target \ docker.gitea.com/runner-images:ubuntu-24.04 bash -c ' + git -C / config --global url."file:///protocol.git".insteadOf \ + ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git apt-get update && apt-get install -y --no-install-recommends \ build-essential ca-certificates cmake curl git jq pkg-config python3 \ libasound2-dev libfontconfig1-dev libxkbcommon-dev libvpx-dev \ @@ -129,12 +134,21 @@ docker run --rm -v "$PWD":/src -w /src -e HOME=/root \ cargo test --workspace --locked --no-fail-fast"' ``` +`--init` is required: `bash -c` runs its last command, `xvfb-run`, as the +container's process 1, and that never gets to start `cargo` (the command +hangs). The runner starts its steps with `docker exec` in a container whose +process 1 is something else, so CI itself is not affected. + The private VoelinProtocol dependency needs the deploy key -([below](#voelinprotocol-access)); without it, point git at a local bare -clone of that repository with -`git config --global url."file:///path/to/VoelinProtocol.git".insteadOf -ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git` and -`CARGO_NET_GIT_FETCH_WITH_CLI=true`, which leaves `Cargo.lock` as it is. +([below](#voelinprotocol-access)). The block reads it from a local bare clone +instead: `PROTOCOL_GIT` is mounted at `/protocol.git` and git is told to use +it in place of the SSH URL (with `CARGO_NET_GIT_FETCH_WITH_CLI=true`, as in CI, +so that cargo runs the `git` command), which leaves `Cargo.lock` as it is. +The `git config` is run with `-C /` because a git worktree's `.git` file points +outside the mount, and `git config` in `/src` then fails with `fatal: gitfile +does not point to a valid repository`. To use the deploy key instead, set it up +as described below and leave out the `PROTOCOL_GIT` lines and the `git config` +command. What the image lacks, and what the tests do about it. A test that is about the missing piece prints `skipped: ` (or is `#[ignore]`d with the