From 0e06caa098e35435a18c6db514c3521fd6d60fe3 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 11 Aug 2026 20:23:57 +0000 Subject: [PATCH 1/2] Check out a referenced angr/binaries pull request on macOS and Windows The ci job cle inherits from angr/ci-settings resolves a sibling angr/binaries pull request out of the description before it builds, but Test macos-15 and Test windows-2022, which this workflow defines itself, check out binaries master unconditionally. A cle change that needs a new fixture therefore passes every inherited job and fails those two until the fixture lands. Both jobs now read the reference out of the pull request body the way resolve_refs.py does: angr/binaries# or a pull request URL, first one found, and its head only while that pull request is still open. A push, or a body naming no binaries pull request, takes master. The body reaches the step as an environment variable and only the digits extracted from it reach the ref, so nothing in it is interpreted. Co-Authored-By: Claude Opus 5 --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81e6c491..a96ceb0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,33 @@ jobs: - uses: actions/checkout@v6 with: path: cle + - name: Resolve the angr/binaries ref + id: binaries-ref + shell: bash + env: + GH_TOKEN: ${{ github.token }} + PR_BODY: ${{ github.event.pull_request.body }} + run: | + ref=master + number=$(printf '%s' "$PR_BODY" | + grep -Eo '(angr/binaries#|github\.com/angr/binaries/pull/)[0-9]+' | + head -n 1 | + grep -Eo '[0-9]+$') || true + if [ -n "$number" ]; then + state=$(gh api "repos/angr/binaries/pulls/$number" --jq .state) || state=unavailable + if [ "$state" = open ]; then + ref="refs/pull/$number/head" + else + echo "angr/binaries#$number is $state, so it is not used" + fi + fi + echo "Checking out angr/binaries at $ref" + echo "ref=$ref" >>"$GITHUB_OUTPUT" - uses: actions/checkout@v6 with: repository: angr/binaries path: binaries + ref: ${{ steps.binaries-ref.outputs.ref }} - name: Install the latest version of uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 From b15360222433ca153c9369111fe44f7d2829bc90 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 12 Aug 2026 08:08:17 +0000 Subject: [PATCH 2/2] Resolve a referenced sibling pull request inside uv Test macos-15 and Test windows-2022 sync their own environment with uv, and tool.uv.sources pins archinfo and pyvex to the master branch of their repositories, so a cle change that needs a sibling fix is tested against master and fails in those two jobs while every inherited job passes. Every repository named in tool.uv.sources is now resolved out of the body the same way the angr/binaries reference already was, in the two spellings resolve_refs.py accepts, and only while the referenced pull request is open. The first reference to each is written to a uv configuration file in the runner temporary directory as no-sources-package plus upgrade-package, and UV_CONFIG_FILE points the rest of the job at it. uv sync then resolves that package from refs/pull//head and every other sibling from master, in one lock, so nothing has to be reinstalled over the top and the test run no longer needs --no-sync to keep master from coming back. The configuration lives outside the checkout, so no tracked file changes, and a pull request that names no sibling installs exactly what it installed before. Co-Authored-By: Claude Opus 5 --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a96ceb0e..2d6f22c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,44 @@ jobs: uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 if: runner.os == 'Windows' + - name: Resolve referenced sibling pull requests + working-directory: cle + shell: bash + env: + GH_TOKEN: ${{ github.token }} + PR_BODY: ${{ github.event.pull_request.body }} + run: | + config=$RUNNER_TEMP/uv-sources.toml + packages= + requirements= + seen= + references=$(printf '%s' "$PR_BODY" | + grep -Eo '[A-Za-z0-9._-]+/[A-Za-z0-9._-]+#[0-9]+|github\.com/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+/pull/[0-9]+' | + sed -E -e 's|^github\.com/||' -e 's|/pull/|#|' -e 's|[/#]| |g') || true + while read -r owner repo number; do + [ -n "$number" ] || continue + case " $seen " in *" $owner/$repo "*) continue ;; esac + seen="$seen $owner/$repo" + package=$(sed -n '/^\[tool\.uv\.sources\]/,/^\[/p' pyproject.toml | + grep -F -e "\"https://github.com/$owner/$repo\"" -e "\"https://github.com/$owner/$repo.git\"" | + sed -E 's/^ *([^ =]+).*/\1/' | + head -n 1) || true + [ -n "$package" ] || continue + state=$(gh api "repos/$owner/$repo/pulls/$number" --jq .state) || state=unavailable + if [ "$state" != open ]; then + echo "$owner/$repo#$number is $state, so it is not used" + continue + fi + echo "Installing $package from $owner/$repo#$number" + packages="$packages\"$package\"," + requirements="$requirements\"$package @ git+https://github.com/$owner/$repo@refs/pull/$number/head\"," + done <<<"$references" + if [ -z "$packages" ]; then + echo "No sibling pull request is referenced, so every sibling stays on master" + exit 0 + fi + printf 'no-sources-package = [%s]\nupgrade-package = [%s]\n' "$packages" "$requirements" | tee "$config" + echo "UV_CONFIG_FILE=$config" >>"$GITHUB_ENV" - name: Sync dependencies with uv run: uv sync --directory cle --python python3.12 --group testing - name: Run tests