builtin: fix Boehm interior pointers and modal GC aborts on Windows (… #17916
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tools CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'cmd/**' | |
| - '!cmd/tools/vpm/**' | |
| - 'vlib/**' | |
| - 'thirdparty/**' | |
| - '!**.md' | |
| - '**/tools_ci.yml' | |
| pull_request: | |
| paths: | |
| - 'cmd/**' | |
| - '!cmd/tools/vpm/**' | |
| - 'vlib/**' | |
| - 'thirdparty/**' | |
| - '!**.md' | |
| - '**/tools_ci.yml' | |
| concurrency: | |
| group: tools-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| shell-contracts: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Check BSD tool job failure propagation | |
| run: python3 cmd/tools/tools_ci_test.py | |
| tools-linux: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 40 | |
| strategy: | |
| matrix: | |
| cc: [tcc, gcc, clang] | |
| fail-fast: false | |
| env: | |
| VFLAGS: -cc ${{ matrix.cc }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Build V | |
| run: make && ./v -showcc -o v cmd/v && ./v symlink && ./v doctor | |
| - name: Code in cmd/ is formatted | |
| run: ./v fmt -verify cmd/ | |
| - name: Check build-tools | |
| run: ./v -silent -N -W -check build-tools | |
| - name: Test tools | |
| run: ./v -silent test-self cmd | |
| - name: Test tools (-cstrict) | |
| if: ${{ matrix.cc != 'tcc' }} | |
| run: ./v -silent -W -cstrict test-self cmd | |
| - name: Test sanitized | |
| if: ${{ matrix.cc != 'tcc' }} | |
| run: | | |
| export VNATIVE_SKIP_LIBC_VV=1 | |
| if [[ ${{ matrix.cc }} == "clang" ]]; then | |
| cmd="./v -silent -cc clang -cflags -fsanitize=undefined test-self -ubsan-compiler cmd" | |
| echo "$cmd" && $cmd | |
| cmd="./v -silent -gc none -cc clang -cflags -fsanitize=memory test-self -msan-compiler cmd" | |
| echo "$cmd" && $cmd | |
| else | |
| cmd="./v -silent -cc gcc -cflags -fsanitize=thread test-self cmd" | |
| echo "$cmd" && $cmd | |
| cmd="./v -silent -cc gcc -cflags -fsanitize=address,leak,undefined,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,bounds-strict,alignment,object-size,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr test-self -asan-compiler cmd/tools" | |
| echo "$cmd" && $cmd | |
| ## cmd="./v -silent -cc gcc -cflags -fsanitize=kernel-address test-self -asan-compiler cmd" | |
| ## echo "$cmd" && $cmd | |
| fi | |
| tools-macos: | |
| runs-on: macos-14 | |
| timeout-minutes: 20 | |
| strategy: | |
| matrix: | |
| cc: [clang] | |
| fail-fast: false | |
| env: | |
| VFLAGS: -cc ${{ matrix.cc }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Build V | |
| run: make && ./v -showcc -o v cmd/v && ./v symlink && ./v doctor | |
| - name: Check build-tools | |
| run: ./v -silent -N -W -check build-tools | |
| - name: Test tools | |
| run: ./v -silent test-self cmd | |
| - name: Test tools (-cstrict) | |
| run: ./v -silent -W -cstrict test-self cmd | |
| tools-windows: | |
| runs-on: windows-2025 | |
| timeout-minutes: 20 | |
| strategy: | |
| matrix: | |
| cc: [tcc, gcc, msvc] | |
| fail-fast: false | |
| env: | |
| VFLAGS: -cc ${{ matrix.cc }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Build V | |
| run: ./makev.bat -${{ matrix.cc }} && ./v -o v2.exe cmd/v && ./v2 -showcc -o v.exe cmd/v && ./v symlink && ./v doctor | |
| - name: Install OpenSSL for MSVC | |
| if: ${{ matrix.cc == 'msvc' }} | |
| run: | | |
| $opensslBin = 'C:\Program Files\OpenSSL\bin' | |
| $libDir = 'C:\Program Files\OpenSSL\lib\VC\x64\MD' | |
| $cryptoLib = Join-Path $libDir 'libcrypto.lib' | |
| if (-not (Test-Path $opensslBin) -or -not (Test-Path $cryptoLib)) { | |
| choco install openssl --version=3.5.4 --allow-downgrade -y --no-progress | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Chocolatey failed to install OpenSSL 3.5.4 (exit $LASTEXITCODE)" | |
| } | |
| } | |
| if (-not (Test-Path $opensslBin) -or -not (Test-Path $cryptoLib)) { | |
| throw "OpenSSL installation is incomplete under C:\Program Files\OpenSSL" | |
| } | |
| Add-Content -Path $env:GITHUB_PATH -Value $opensslBin | |
| Copy-Item -Path $cryptoLib -Destination (Join-Path $libDir 'crypto.lib') -Force | |
| - name: Install SQLite (needed by vsqlite tool) | |
| run: .\.github\workflows\windows-install-sqlite.bat | |
| - name: Check build tools | |
| run: ./v build-tools | |
| - name: Test tools | |
| run: ./v -silent test-self cmd | |
| - name: Test tools (-cstrict) | |
| if: ${{ matrix.cc == 'msvc' }} | |
| run: ./v -silent -W -cstrict test-self cmd | |
| tools-docker-ubuntu-musl: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 35 | |
| container: | |
| image: thevlang/vlang:ubuntu-build | |
| env: | |
| V_CI_MUSL: 1 | |
| V_CI_UBUNTU_MUSL: 1 | |
| VFLAGS: -cc musl-gcc -gc none | |
| volumes: | |
| - ${{github.workspace}}:/opt/vlang | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Build V | |
| run: make && ./v -cg -o v cmd/v && ./v symlink | |
| - name: Ensure git commands can be used with no prompts on modern Git versions | |
| run: git config --global --add safe.directory /__w/v/v | |
| - name: Verify `v test` works | |
| run: | | |
| ./v cmd/tools/test_if_v_test_system_works.v | |
| ./cmd/tools/test_if_v_test_system_works | |
| - name: Build musl-native OpenSSL | |
| run: | | |
| wget -q https://github.com/openssl/openssl/releases/download/openssl-3.5.4/openssl-3.5.4.tar.gz -O /tmp/openssl-3.5.4.tar.gz | |
| echo '967311f84955316969bdb1d8d4b983718ef42338639c621ec4c34fddef355e99 /tmp/openssl-3.5.4.tar.gz' | sha256sum --check --strict | |
| tar -C /tmp -xf /tmp/openssl-3.5.4.tar.gz | |
| cd /tmp/openssl-3.5.4 | |
| CC=musl-gcc ./Configure linux-x86_64 no-shared no-tests no-secure-memory no-afalgeng --prefix=/usr/local --libdir=lib64 --openssldir=/usr/local/ssl | |
| make -j"$(nproc)" | |
| make install_sw | |
| - name: Check build tools | |
| run: ./v -silent -N -W -check build-tools | |
| - name: Test tools | |
| run: ./v -silent test-self cmd | |
| - name: Test tools (-cstrict) | |
| run: ./v -silent -W -cstrict test-self cmd | |
| tools-freebsd: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| matrix: | |
| cc: [tcc, gcc, clang] | |
| fail-fast: false | |
| env: | |
| VFLAGS: -cc ${{ matrix.cc }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Start FreeBSD VM with ${{ matrix.cc }} | |
| uses: cross-platform-actions/action@v1.6.0 | |
| with: | |
| operating_system: freebsd | |
| version: '15.1' | |
| memory: 8G | |
| cpu_count: 2 | |
| shell: sh | |
| sync_files: runner-to-vm | |
| environment_variables: VFLAGS | |
| - name: Tests tools on FreeBSD with ${{ matrix.cc }} | |
| shell: cpa.sh {0} | |
| run: | | |
| # A custom VM shell does not imply GitHub's usual fail-fast options. | |
| set -eu | |
| sudo pkg install -y git sqlite3 gmake boehm-gc-threaded libiconv | |
| if [ "$VFLAGS" = "-cc gcc" ]; then | |
| sudo pkg install -y gcc | |
| fi | |
| # Mandatory: hostname not set in VM => some tests fail | |
| sudo hostname -s freebsd-ci | |
| echo "::group::OS infos" | |
| uname -a | |
| echo "::endgroup::" | |
| # Build V | |
| echo "::group::Build V" | |
| git config --global --add safe.directory . | |
| printf "VFLAGS = %s\n" "$VFLAGS" | |
| # Non-final commands in an && list are exempt from set -e. | |
| gmake | |
| ./v -showcc -o v cmd/v | |
| sudo ./v symlink | |
| echo "::endgroup::" | |
| echo "::group::v doctor" | |
| ./v doctor | |
| echo "::endgroup::" | |
| # Code in cmd/ is formatted | |
| echo "::group::Check code in cmd/ is formatted" | |
| ./v fmt -verify cmd/ | |
| echo "::endgroup::" | |
| # Check build-tools | |
| echo "::group::Check build tools" | |
| ./v -silent -N -W -check build-tools | |
| echo "::endgroup::" | |
| # Test tools | |
| echo "::group::Test tools" | |
| ./v -silent test-self cmd | |
| echo "::endgroup::" | |
| # Test tools (-cstrict) | |
| if [ "$VFLAGS" != "-cc tcc" ]; then | |
| echo "::group::Test tools (-cstrict)" | |
| ./v -silent -W -cstrict test-self cmd | |
| echo "::endgroup::" | |
| fi | |
| tools-openbsd: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| matrix: | |
| cc: [tcc, clang] | |
| fail-fast: false | |
| env: | |
| VFLAGS: -cc ${{ matrix.cc }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Start OpenBSD VM with ${{ matrix.cc }} | |
| uses: cross-platform-actions/action@v1.6.0 | |
| with: | |
| operating_system: openbsd | |
| version: '7.8' | |
| memory: 8G | |
| cpu_count: 2 | |
| sync_files: runner-to-vm | |
| environment_variables: VFLAGS | |
| - name: Tests tools on OpenBSD with ${{ matrix.cc }} | |
| shell: cpa.sh {0} | |
| run: | | |
| # A custom VM shell does not imply GitHub's usual fail-fast options. | |
| set -eu | |
| sudo pkg_add git sqlite3 gmake boehm-gc libiconv openssl | |
| # Mandatory: hostname not set in VM => some tests fail | |
| sudo hostname -s openbsd-ci | |
| echo "::group::OS infos" | |
| uname -a | |
| echo "::endgroup::" | |
| # Build V | |
| echo "::group::Build V" | |
| git config --global --add safe.directory . | |
| printf "VFLAGS = %s\n" "$VFLAGS" | |
| # V3 self-hosting can exceed OpenBSD's default per-process data limit. | |
| ulimit -d 4194304 | |
| # Non-final commands in an && list are exempt from set -e. | |
| gmake | |
| ./v -showcc -o v cmd/v | |
| sudo ./v symlink | |
| echo "::endgroup::" | |
| echo "::group::v doctor" | |
| ./v doctor | |
| echo "::endgroup::" | |
| # Code in cmd/ is formatted | |
| echo "::group::Check code in cmd/ is formatted" | |
| ./v fmt -verify cmd/ | |
| echo "::endgroup::" | |
| # Check build-tools | |
| echo "::group::Check build tools" | |
| ./v -silent -N -W -check build-tools | |
| echo "::endgroup::" | |
| # Test tools | |
| echo "::group::Test tools" | |
| ./v -silent test-self cmd | |
| echo "::endgroup::" | |
| # Test tools (-cstrict) | |
| if [ "$VFLAGS" != "-cc tcc" ]; then | |
| echo "::group::Test tools (-cstrict)" | |
| ./v -silent -W -cstrict test-self cmd | |
| echo "::endgroup::" | |
| fi |