Skip to content

scanner: accept octal and multi-byte escapes in rune literals (fix #28880) #17637

scanner: accept octal and multi-byte escapes in rune literals (fix #28880)

scanner: accept octal and multi-byte escapes in rune literals (fix #28880) #17637

Workflow file for this run

name: Sanitized CI
## Running these jobs is slow (over ~1 hour, sometimes even 2)
## so we run them only when there is a chance that the generated
## C code could have changed, or for some critical vlib modules,
## like `builtin`, `os`, `sync`, where they have demonstrated
## their usefulness by catching actual very hard to find bugs.
## The cost of this selective running is delayed feedback when
## there are bugs in other V modules.
## The positive is *much faster CI runs* for most V contributors,
## that make PRs that are not concerning V itself, or the critical
## V modules.
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '!**'
- '!**.md'
- '!**.yml'
- 'vlib/builtin/**.v'
- 'vlib/strconv/**.v'
- 'vlib/strings/**.v'
- 'vlib/math/**.v'
- 'vlib/math/big/**.v'
- 'vlib/arrays/**.v'
- 'vlib/crypto/ecdsa/**.v'
- 'vlib/datatypes/**.v'
- 'vlib/os/**.v'
- 'vlib/sync/**.v'
- 'vlib/v/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
- 'vlib/v/builder/**.v'
- 'vlib/v/cflag/**.v'
- 'vlib/v/live/**.v'
- 'vlib/v/util/**.v'
- 'vlib/v/markused/**.v'
- 'vlib/json2/**.v'
- '**/sanitized_ci.yml'
pull_request:
paths:
- '!**'
- 'vlib/builtin/**.v'
- 'vlib/strconv/**.v'
- 'vlib/strings/**.v'
- 'vlib/math/**.v'
- 'vlib/math/big/**.v'
- 'vlib/arrays/**.v'
- 'vlib/crypto/ecdsa/**.v'
- 'vlib/datatypes/**.v'
- 'vlib/os/**.v'
- 'vlib/sync/**.v'
- 'vlib/v/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
- 'vlib/v/builder/**.v'
- 'vlib/v/cflag/**.v'
- 'vlib/v/live/**.v'
- 'vlib/v/util/**.v'
- 'vlib/v/markused/**.v'
- 'vlib/json2/**.v'
- '**/sanitized_ci.yml'
concurrency:
group: sanitized-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
env:
SANITIZER_BASE_PACKAGES: >-
postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
SANITIZER_GRAPHICS_PACKAGES: >-
libfreetype6-dev libxi-dev libxcursor-dev libgl-dev libxrandr-dev
libasound2-dev libegl-dev
SANITIZER_CLANG_PACKAGES: clang
jobs:
sanitize-linux:
runs-on: ubuntu-22.04
timeout-minutes: ${{ matrix.timeout }}
strategy:
fail-fast: false
matrix:
include:
- name: undefined-clang
cc: clang
sanitizer: undefined
gc: default
timeout: 120
vflags: -cc clang -cflags -fno-omit-frame-pointer
ubsan_options: print_stacktrace=1:halt_on_error=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_undefined.suppressions
- name: undefined-gcc
cc: gcc
sanitizer: undefined
gc: default
timeout: 150
vflags: -cc gcc -cflags -fno-omit-frame-pointer
ubsan_options: print_stacktrace=1:halt_on_error=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_undefined.suppressions
- name: address-clang
cc: clang
sanitizer: address
gc: default
timeout: 300
vflags: -cc clang -cflags -fno-omit-frame-pointer
asan_options: detect_leaks=1
lsan_options: max_leaks=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_leak.suppressions
- name: address-gcc
cc: gcc
sanitizer: address
gc: default
timeout: 300
vflags: -cc gcc -cflags -fno-omit-frame-pointer
asan_options: detect_leaks=1
lsan_options: max_leaks=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_leak.suppressions
- name: memory-clang
cc: clang
sanitizer: memory
gc: none
timeout: 300
vflags: -cc clang -gc none -cflags -fno-omit-frame-pointer
- name: memory-clang-compiler
cc: clang
sanitizer: memory
gc: none
timeout: 300
vflags: -cc clang -gc none -cflags -fno-omit-frame-pointer
- name: address-clang-without-gc
cc: clang
sanitizer: address
gc: none
timeout: 300
vflags: -cc clang -gc none -cflags -fno-omit-frame-pointer
lsan_options: detect_leaks=0
name: sanitize-${{ matrix.name }}
env:
SANITIZER_GITHUB_JOB: sanitize-${{ matrix.name }}
VFLAGS: ${{ matrix.vflags }}
VJOBS: 1
UBSAN_OPTIONS: ${{ matrix.ubsan_options }}
ASAN_OPTIONS: ${{ matrix.asan_options }}
LSAN_OPTIONS: ${{ matrix.lsan_options }}
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/cache-apt-packages-action
with:
profile: sanitizers
- uses: ./.github/actions/setup-v
with:
symlink: true
- name: V doctor
if: ${{ matrix.name != 'memory-clang-compiler' }}
run: GITHUB_JOB="$SANITIZER_GITHUB_JOB" ./v doctor
- name: Ensure code is well formatted
if: ${{ matrix.name != 'memory-clang-compiler' }}
run: GITHUB_JOB="$SANITIZER_GITHUB_JOB" ./v -silent test-cleancode
- name: Install dependencies
run: |
export GITHUB_JOB="$SANITIZER_GITHUB_JOB"
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with -cstrict
run: |
export GITHUB_JOB="$SANITIZER_GITHUB_JOB"
if [ "${{ matrix.sanitizer }}" = "memory" ]; then
./v -cc clang -cg -cstrict -o v cmd/v
else
./v -cg -cstrict -o v cmd/v
fi
- name: Self tests (-fsanitize=undefined)
if: ${{ matrix.sanitizer == 'undefined' }}
run: |
export GITHUB_JOB="$SANITIZER_GITHUB_JOB"
./v -cflags -fsanitize=undefined -o v2 cmd/v
./v2 -cflags -fsanitize=undefined -silent test-self vlib
- name: Build examples (V compiled with -fsanitize=undefined)
if: ${{ matrix.sanitizer == 'undefined' }}
run: GITHUB_JOB="$SANITIZER_GITHUB_JOB" ./v2 -silent build-examples
- name: Self tests (-fsanitize=address)
if: ${{ matrix.sanitizer == 'address' && matrix.name != 'memory-clang-compiler' && matrix.name != 'memory-clang' }}
run: |
export GITHUB_JOB="$SANITIZER_GITHUB_JOB"
if [ "${{ matrix.cc }}" = "clang" ] && [ "${{ matrix.name }}" = "address-clang" ]; then
./v -cflags -fsanitize=address,pointer-compare,pointer-subtract -silent test-self vlib
elif [ "${{ matrix.cc }}" = "gcc" ] && [ "${{ matrix.name }}" = "address-gcc" ]; then
./v -cflags -fsanitize=address -silent test-self vlib
else
./v -cflags -fsanitize=address -silent test-self vlib
fi
- name: Test vlib/v/tests/ (V compiled with -fsanitize=address)
if: ${{ matrix.sanitizer == 'address' && (matrix.name == 'address-clang' || matrix.name == 'address-gcc') }}
run: |
export GITHUB_JOB="$SANITIZER_GITHUB_JOB"
if [ "${{ matrix.name }}" = "address-clang" ]; then
./v -cflags -fsanitize=address -o v cmd/v
./v -cc tcc -silent test-self -asan-compiler vlib/v/tests/
else
./v -cflags -fsanitize=address,pointer-compare,pointer-subtract -o v cmd/v
./v -cc tcc -silent test-self -asan-compiler vlib/v/tests/
fi
- name: Build examples (V compiled with -fsanitize=address)
if: ${{ matrix.name == 'address-clang' || matrix.name == 'address-gcc' }}
run: GITHUB_JOB="$SANITIZER_GITHUB_JOB" ./v -silent build-examples
- name: Self tests (-fsanitize=memory)
if: ${{ matrix.name == 'memory-clang' }}
run: GITHUB_JOB="$SANITIZER_GITHUB_JOB" ./v -cflags -fsanitize=memory -silent test-self -msan-compiler vlib
- name: Test vlib/v/tests/ (V compiled with -fsanitize=memory)
if: ${{ matrix.name == 'memory-clang-compiler' }}
run: |
GITHUB_JOB=sanitize-memory-clang ./v -cflags -fsanitize=memory -o v cmd/v
GITHUB_JOB=sanitize-memory-clang ./v -cc tcc -silent test-self -msan-compiler vlib/v/tests/
- name: Build examples (V compiled with -fsanitize=memory)
if: ${{ matrix.name == 'memory-clang-compiler' }}
run: GITHUB_JOB=sanitize-memory-clang ./v -silent build-examples
sanitize-address-msvc:
runs-on: windows-2025
timeout-minutes: 30
env:
VFLAGS: -cc msvc
VJOBS: 1
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7
- name: Build
run: |
echo %VFLAGS%
echo $VFLAGS
.\makev.bat -msvc
.\v.exe self
- name: V doctor
run: .\v.exe doctor
- name: Ensure code is well formatted
run: .\v.exe -silent test-cleancode
# - name: Install dependencies
# run: |
# .\v.exe setup-freetype
# .\.github\workflows\windows-install-sqlite.bat
# - name: Self tests (/fsanitize=address) # TODO:
# run: .\v.exe -cflags "/fsanitize=address" -silent test-self vlib