diff --git a/.github/workflows/bump-v.yml b/.github/workflows/bump-v.yml new file mode 100644 index 0000000..8922981 --- /dev/null +++ b/.github/workflows/bump-v.yml @@ -0,0 +1,97 @@ +# Keep the pinned V revision from going stale. +# +# ci.yml pins V to a specific revision, because V master broke its own bootstrap +# on 2026-10-02 and reddened every job in this repo for ten days without anything +# changing here. A pin trades that exposure for a different one: it goes stale, and +# a stale pin means the tools quietly stop building against current V. +# +# This closes that loop. It builds the tree against the *current* V master, and +# only if both the compile and the test suite are green does it open a PR bumping +# the pin. If V master is broken it stays quiet - which is the desired behaviour, +# since it is reporting an upstream problem and not one of ours. +name: Bump the pinned V + +on: + schedule: + # Weekly, Monday 05:00 UTC. + - cron: '0 5 * * 1' + workflow_dispatch: + inputs: + v_ref: + description: 'V revision to try, defaulting to master' + required: false + default: '' + +permissions: + contents: read + +concurrency: + group: bump-v + cancel-in-progress: false + +jobs: + try-current-v: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout V + uses: actions/checkout@v6 + with: + repository: vlang/v + ref: ${{ github.event.inputs.v_ref || 'master' }} + path: v + - name: Build V + run: cd v && make && sudo ./v symlink && cd - + + - name: Checkout Coreutils + uses: actions/checkout@v6 + with: + path: coreutils + persist-credentials: true + + # A cheap signal first: does every tool still compile? This is the step a + # stale pin breaks, and it runs in a couple of minutes rather than after + # the full build. + - name: Compile every tool against current V + id: compile + run: cd coreutils && v run build.vsh + continue-on-error: true + + - name: Run the test suite against current V + if: steps.compile.outcome == 'success' + run: cd coreutils && make test + continue-on-error: true + + - name: Record the outcome + if: always() + id: result + run: | + echo "v_sha=$(cd v && git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + + # Only a green build and test run moves the pin. A red one means either V + # master is broken again or this tree needs work, and neither is something + # to paper over by moving the pin. + - name: Open a PR bumping the pin + if: steps.compile.outcome == 'success' && steps.test.outcome == 'success' + run: | + cd coreutils + pin=$(grep -oP 'V_REF: \K[0-9a-f]+' .github/workflows/ci.yml) + tried="${{ steps.result.outputs.v_sha }}" + if [ "$pin" = "$tried" ]; then + echo "Pin is already at $tried, nothing to do." + exit 0 + fi + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b bump-v-$(date -u +%Y%m%d) + sed -i "s/V_REF: [0-9a-f]*/V_REF: $tried/" .github/workflows/ci.yml + git add .github/workflows/ci.yml + # Single-line messages: a multi-line one inside this run block loses + # its indentation and the YAML stops parsing. + git commit -m "ci: bump the pinned V to ${tried:0:10}" + git push -q origin HEAD + gh pr create --fill --base main \ + --title "ci: bump the pinned V to ${tried:0:10}" \ + --body "Current V master compiles and tests clean against this tree, so the pin moves from ${pin:0:10} to ${tried:0:10}. Opened by the Bump the pinned V workflow; if this PR's own checks go red the bump is wrong and should be closed." + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80eaccb..16c5207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,27 @@ name: Build and Test on: [push, pull_request] +env: + # The V revision CI builds. Pinned rather than taken from master, because V + # master broke its own bootstrap on 2026-10-02 in 233f259a7a, which added + # C.S_IFMT to vlib/os/os_stat_windows.c.v - a constant the bundled tcc does not + # define on Windows. Every job here was red for ten days as a result, with no + # change on this side. + # + # 532f63b6d2, the parent of that commit, then failed differently: its own + # vc/v.c bootstrap cannot parse vlib/math/bits/bits.v, because the bootstrap + # compiler rejects the if-expression assigned to abs_x at line 621. A pin that + # does not bootstrap is no better than no pin, which is why this is an official + # weekly tag instead. + # + # weekly.2026.41 avoids both: the S_IFMT commit is not an ancestor of it, and its + # bits.v assigns from an if expression rather than starting a condition with one. + # + # To move it forward, change this and check all four jobs; the bump-v workflow + # does that automatically and opens a PR when a newer V is green, so this does + # not silently go stale. + V_REF: weekly.2026.41 + jobs: winos-test: runs-on: windows-latest @@ -14,10 +35,11 @@ jobs: uses: actions/checkout@v6 with: path: coreutils - - name: Checkout Latest V + - name: Checkout V uses: actions/checkout@v6 with: repository: vlang/v + ref: ${{ env.V_REF }} path: v - name: Build V shell: bash @@ -63,10 +85,11 @@ jobs: ubuntu-fast-build: runs-on: ubuntu-latest steps: - - name: Checkout Latest V + - name: Checkout V uses: actions/checkout@v6 with: repository: vlang/v + ref: ${{ env.V_REF }} path: v - name: Build V run: cd v && make && sudo ./v symlink && cd - @@ -88,10 +111,11 @@ jobs: ubuntu-prod-build: runs-on: ubuntu-latest steps: - - name: Checkout Latest V + - name: Checkout V uses: actions/checkout@v6 with: repository: vlang/v + ref: ${{ env.V_REF }} path: v - name: Build V run: cd v && make && sudo ./v symlink && cd - @@ -107,10 +131,11 @@ jobs: ubuntu-gnu-coreutils: runs-on: ubuntu-latest steps: - - name: Checkout Latest V + - name: Checkout V uses: actions/checkout@v6 with: repository: vlang/v + ref: ${{ env.V_REF }} path: v - name: Build V run: cd v && make && sudo ./v symlink && cd -