From a3a1822ffbf7804cb9ffa7bbc495095115c1f7db Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 15 Sep 2026 19:34:12 +0200 Subject: [PATCH 1/3] Keep Windows demo builds reproducible --- .github/workflows/demo-release.yml | 14 ++++++++++++-- scripts/run_demo_windows.ps1 | 11 +++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/demo-release.yml b/.github/workflows/demo-release.yml index 1cd662f..3ce5286 100644 --- a/.github/workflows/demo-release.yml +++ b/.github/workflows/demo-release.yml @@ -46,10 +46,15 @@ jobs: repository: vlang/v ref: 1f128c94619fb6e4863c5f81883e1b860405c8fa path: toolchain/v + - uses: actions/checkout@v7 + with: + repository: vlang/vc + ref: 4a1ba4d772f19c2752c9850d3b5421c71f54a4d6 + path: toolchain/v/vc - name: Build official V compiler working-directory: toolchain/v run: | - make + make local=1 echo "$GITHUB_WORKSPACE/toolchain/v" >> "$GITHUB_PATH" - name: Install native dependencies run: sudo apt-get update && sudo apt-get install -y build-essential cmake libglfw3-dev libvulkan-dev libvulkan-volk-dev patchelf pkg-config xvfb zip @@ -141,6 +146,11 @@ jobs: repository: vlang/v ref: 1f128c94619fb6e4863c5f81883e1b860405c8fa path: toolchain/v + - uses: actions/checkout@v7 + with: + repository: vlang/vc + ref: 4a1ba4d772f19c2752c9850d3b5421c71f54a4d6 + path: toolchain/v/vc - uses: actions/checkout@v7 with: repository: zeux/volk @@ -149,7 +159,7 @@ jobs: - name: Build official V compiler shell: cmd working-directory: toolchain/v - run: makev.bat + run: makev.bat -msvc --local - name: Add V compiler to PATH shell: pwsh run: | diff --git a/scripts/run_demo_windows.ps1 b/scripts/run_demo_windows.ps1 index 9a99cd6..ac958ce 100644 --- a/scripts/run_demo_windows.ps1 +++ b/scripts/run_demo_windows.ps1 @@ -6,6 +6,7 @@ param( ) $ErrorActionPreference = "Stop" +$UseExistingDemo = $PSBoundParameters.ContainsKey("DemoDirectory") $RepositoryDirectory = Split-Path -Parent (Split-Path -Parent $PSCommandPath) $RepositoryParent = Split-Path -Parent $RepositoryDirectory if (-not $DemoDirectory) { @@ -43,10 +44,12 @@ if (-not (Test-Path (Join-Path $DemoDirectory ".git"))) { & git clone https://github.com/antono2/v_imgui_examples.git $DemoDirectory if ($LASTEXITCODE -ne 0) { throw "Could not clone v_imgui_examples." } } -& git -C $DemoDirectory fetch --quiet origin $DemoRevision -if ($LASTEXITCODE -ne 0) { throw "Could not fetch the tested demo revision." } -& git -C $DemoDirectory checkout --quiet --detach $DemoRevision -if ($LASTEXITCODE -ne 0) { throw "Could not check out the tested demo revision." } +if (-not $UseExistingDemo) { + & git -C $DemoDirectory fetch --quiet origin $DemoRevision + if ($LASTEXITCODE -ne 0) { throw "Could not fetch the tested demo revision." } + & git -C $DemoDirectory checkout --quiet --detach $DemoRevision + if ($LASTEXITCODE -ne 0) { throw "Could not check out the tested demo revision." } +} $GlfwHeader = Get-ChildItem $NativeBuildDirectory -Recurse -Filter "glfw3.h" | Where-Object { $_.FullName -match "glfw-src.*include.GLFW" } | Select-Object -First 1 From a77e3fe5c8491bb687dfe6a9108cd0d4a57a6a56 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 15 Sep 2026 19:40:56 +0200 Subject: [PATCH 2/3] Pin the Linux TCC runtime --- .github/workflows/demo-release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/demo-release.yml b/.github/workflows/demo-release.yml index 3ce5286..6421d7d 100644 --- a/.github/workflows/demo-release.yml +++ b/.github/workflows/demo-release.yml @@ -51,6 +51,11 @@ jobs: repository: vlang/vc ref: 4a1ba4d772f19c2752c9850d3b5421c71f54a4d6 path: toolchain/v/vc + - uses: actions/checkout@v7 + with: + repository: vlang/tccbin + ref: d6e7ac1b1bcc98aed734a6ecbfa8509f24606c74 + path: toolchain/v/thirdparty/tcc - name: Build official V compiler working-directory: toolchain/v run: | From 9bbda1e1e45cf791a4cbdce685e5897bfd80306d Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 15 Sep 2026 23:32:17 +0200 Subject: [PATCH 3/3] Fix Windows demo launcher module paths --- scripts/run_demo_windows.ps1 | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/run_demo_windows.ps1 b/scripts/run_demo_windows.ps1 index ac958ce..8d4f112 100644 --- a/scripts/run_demo_windows.ps1 +++ b/scripts/run_demo_windows.ps1 @@ -17,12 +17,23 @@ $RuntimeDirectory = Join-Path $RepositoryDirectory "build\windows-demo" & (Join-Path $RepositoryDirectory "scripts\check_windows.ps1") -BundledGlfw +# A Visual Studio developer shell can put V's .bin\v.bat wrapper ahead of the +# compiler. Batch files reinterpret the pipe separators in V's -path argument, +# so call the compiler executable behind that wrapper when it is available. +$VCommand = (Get-Command v -CommandType Application -ErrorAction Stop).Source +if ([IO.Path]::GetExtension($VCommand) -in @(".bat", ".cmd")) { + $CompilerCandidate = Join-Path (Split-Path -Parent (Split-Path -Parent $VCommand)) "v.exe" + if (Test-Path -LiteralPath $CompilerCandidate) { + $VCommand = $CompilerCandidate + } +} + if (Test-Path (Join-Path $RepositoryDirectory ".git")) { & git -C $RepositoryDirectory submodule update --init --recursive if ($LASTEXITCODE -ne 0) { throw "Could not initialise ImGui submodules." } } -& v run (Join-Path $RepositoryDirectory "build_vimgui.vsh") --linkage shared --glfw bundled --glfw-version 3.4 +& $VCommand run (Join-Path $RepositoryDirectory "build_vimgui.vsh") --linkage shared --glfw bundled --glfw-version 3.4 if ($LASTEXITCODE -ne 0) { throw "Could not build the native ImGui library." } if ($NativeOnly) { @@ -35,7 +46,7 @@ foreach ($Module in @("vulkan", "glfw")) { if (Test-Path (Join-Path $LocalModule "v.mod")) { Write-Host "Using checked-out antono2.$Module module." } else { - & v install "antono2.$Module" + & $VCommand install "antono2.$Module" if ($LASTEXITCODE -ne 0) { throw "Could not install the $Module V module." } } } @@ -78,8 +89,15 @@ $env:GLFW_INCLUDE = Split-Path -Parent (Split-Path -Parent $GlfwHeader.FullName) $env:GLFW_LIB = $LinkDirectory $Executable = Join-Path $RuntimeDirectory "v_imgui_demo.exe" -$ModulePath = "$RepositoryParent|@vlib|@vmodules" -& v -no-memory-limit -path $ModulePath -cc msvc -o $Executable $DemoDirectory +$UsesOnlyCheckedOutModules = @("imgui", "vulkan", "glfw") | ForEach-Object { + Test-Path (Join-Path $RepositoryParent "$_\v.mod") +} | Where-Object { -not $_ } | Measure-Object | Select-Object -ExpandProperty Count +$ModulePath = if ($UsesOnlyCheckedOutModules -eq 0) { + "$RepositoryParent|$RepositoryDirectory\modules|@vlib" +} else { + "$RepositoryParent|@vlib|@vmodules" +} +& $VCommand -no-memory-limit -path $ModulePath -cc msvc -o $Executable $DemoDirectory if ($LASTEXITCODE -ne 0) { throw "The demo did not compile. Update to the official vlang/v master branch and review the compiler output above." }