From 5800d7b4837c9bf7c091f23d0d5163f543041fbb Mon Sep 17 00:00:00 2001 From: metif12 Date: Mon, 12 Oct 2026 21:07:56 +0330 Subject: [PATCH 1/2] ci: pin the V revision, and keep the pin from going stale Every job here checks out vlang/v master and builds it. 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. The result was that all four jobs went red and stayed red for ten days, with no change on this side: mknod, un-ignore-windows-ports, stdbuf and stty all failed identically, each one during the V bootstrap before any code of ours compiled. There is an open V branch named os-stat-include fixing exactly that file, and it has not landed. So this is an isolation measure rather than a freshness one: it stops an upstream regression being read as a failure of this repo. 532f63b6d2 is the parent of that commit and builds. A pin alone trades one problem for another, because it goes stale, and a stale pin means these tools quietly stop building against current V. bump-v.yml closes that: it builds the tree against current V master, and only if both the compile and the test suite pass does it open a PR moving the pin. While V master is broken it stays quiet, which is right - it is reporting an upstream problem, not one of ours. Split out from the multicall branch, where it had travelled alongside unrelated work and would have been easy for a reviewer of that PR to miss. --- .github/workflows/bump-v.yml | 97 ++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 24 +++++++-- 2 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/bump-v.yml diff --git a/.github/workflows/bump-v.yml b/.github/workflows/bump-v.yml new file mode 100644 index 00000000..8922981d --- /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 80eaccbd..021254fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,18 @@ 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 is the parent of that commit and builds. To move it forward, bump + # 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: 532f63b6d2369708e62dd9e8b77e987dedac5152 + jobs: winos-test: runs-on: windows-latest @@ -14,10 +26,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 +76,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 +102,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 +122,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 - From 95d6cb79189356d8e2882485ebe681bd8448402f Mon Sep 17 00:00:00 2001 From: metif12 Date: Tue, 13 Oct 2026 10:11:00 +0330 Subject: [PATCH 2/2] ci: pin V to a weekly tag, after the first pin failed to bootstrap Every job here checks out vlang/v master and builds it. 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. All four jobs went red and stayed red for ten days with no change on this side: mknod, un-ignore-windows-ports, stdbuf and stty all failed identically, each during the V bootstrap before any code of ours compiled. The first version of this pinned 532f63b6d2, the parent of that commit. It failed too, for a second reason found by a run rather than by reading: 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. So the pin is an official weekly tag instead, weekly.2026.41, which avoids both: the S_IFMT commit is not an ancestor of it, verified with merge-base --is-ancestor, and its bits.v assigns from an if expression rather than starting a condition with one. The reasons are recorded at the V_REF line so the next person does not have to rediscover either of them. bump-v.yml keeps it from going stale: it builds against current V master and only opens a PR moving the pin when both the compile and the test suite are green. While V master is broken it stays quiet, which is right, because it is reporting an upstream problem rather than one of ours. Split out from the multicall branch, where it had travelled alongside unrelated work. --- .github/workflows/ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 021254fc..16c52078 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,19 @@ env: # define on Windows. Every job here was red for ten days as a result, with no # change on this side. # - # 532f63b6d2 is the parent of that commit and builds. To move it forward, bump - # 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: 532f63b6d2369708e62dd9e8b77e987dedac5152 + # 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: