From 1d916dc60d8fac6e7558ff120d9f316910030d98 Mon Sep 17 00:00:00 2001 From: Guillaume ASSIER Date: Mon, 2 Nov 2026 12:04:38 +0100 Subject: [PATCH] fix(ci): trouver cargo dans ~/.cargo/bin quand le service du runner ne le met pas dans le PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le runner a perdu cargo de son PATH entre le 30 octobre et le 2 novembre (run 368: cargo: command not found). L'étape d'outils ajoute ~/.cargo/bin quand il existe, et sinon s'arrête en disant quoi installer. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/ci.yml | 14 ++++++++++++-- .gitea/workflows/release.yml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f6903d1..eb35270 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -47,8 +47,18 @@ jobs: # nasm, file and desktop-file-validate may be installed by the runner's # administrator in ~/.local/bin, outside the session PATH. When they # are missing there, the pipeline falls back on what the system provides. - if [ -d "$HOME/.local/bin" ]; then - echo "PATH=$HOME/.local/bin:$PATH" >> "$GITHUB_ENV" + # rustup's ~/.cargo/bin likewise: the runner service does not always + # read the profile that adds it. + path="$PATH" + for dir in "$HOME/.local/bin" "${CARGO_HOME:-$HOME/.cargo}/bin"; do + if [ -d "$dir" ]; then + path="$dir:$path" + fi + done + echo "PATH=$path" >> "$GITHUB_ENV" + if ! PATH="$path" command -v cargo >/dev/null; then + echo "cargo not found (HOME=$HOME, PATH=$path): install rustup for the runner's user" >&2 + exit 1 fi - name: Versions diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 01a28bf..484cb49 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -46,8 +46,18 @@ jobs: # nasm, file and desktop-file-validate may be installed by the runner's # administrator in ~/.local/bin, outside the session PATH. When they # are missing there, the pipeline falls back on what the system provides. - if [ -d "$HOME/.local/bin" ]; then - echo "PATH=$HOME/.local/bin:$PATH" >> "$GITHUB_ENV" + # rustup's ~/.cargo/bin likewise: the runner service does not always + # read the profile that adds it. + path="$PATH" + for dir in "$HOME/.local/bin" "${CARGO_HOME:-$HOME/.cargo}/bin"; do + if [ -d "$dir" ]; then + path="$dir:$path" + fi + done + echo "PATH=$path" >> "$GITHUB_ENV" + if ! PATH="$path" command -v cargo >/dev/null; then + echo "cargo not found (HOME=$HOME, PATH=$path): install rustup for the runner's user" >&2 + exit 1 fi - name: Version and tag