From 97c35057ceca560aed29ee2c5c0a2c1d8135a1d1 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Wed, 19 Aug 2026 22:27:03 -0700 Subject: [PATCH] ci(build-all): install only what the matrix generator needs The scan job is the one job in this workflow that runs outside the build container, so it installs its own Python dependencies. It was installing all 31 entries of requirements.txt to run a script that reaches four of them, and every one of the other 27 was a chance to fail: the job has died on packaging and on lxml, neither of which it imports. Drop the pip cache with it. Restoring it costs about as long as fetching four small wheels, and its key used hashFiles('**./Tools/setup/requirements.txt'), a glob that matches nothing. The hash was empty, so the key collapsed to "Linux-pip-", matched its own restore-key, and never saved again after the first write in April. Verified in a clean python:3.12-slim container: generate_board_targets_json.py exits 0 for both --group and --group --seeders with exactly these four installed. pyyaml and kconfiglib alone are not enough, since loadconfig.ensure_env() shells out to the zenoh generator, which needs empy and pyros-genmsg. Assisted-by: Claude:claude-opus-5 Signed-off-by: Ramon Roche --- .github/workflows/build_all_targets.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_all_targets.yml b/.github/workflows/build_all_targets.yml index 8be856b24a7..bb01db68eab 100644 --- a/.github/workflows/build_all_targets.yml +++ b/.github/workflows/build_all_targets.yml @@ -78,16 +78,13 @@ jobs: - uses: runs-on/action@v2 - uses: actions/checkout@v6 - - name: Cache Python pip - uses: actions/cache@v5 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**./Tools/setup/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - + # This job runs outside the build container, so it installs its own + # dependencies. It needs what the matrix generator actually reaches: + # yaml, kconfiglib via Tools/kconfig/loadconfig.py, and empy plus + # pyros-genmsg for the zenoh generator that loadconfig shells out to + # in ensure_env(). Everything else it runs is stdlib. - name: Install Python Dependencies - run: pip3 install -U packaging -r ./Tools/setup/requirements.txt + run: pip3 install pyyaml kconfiglib 'empy>=3.3,<4' pyros-genmsg # The generator runs as a standalone assignment so a non-zero exit # fails the step; embedded in `echo "x=$(...)"` it would be masked