Merge branch 'vlang:master' into fix/gen_struct_equality_fn

This commit is contained in:
xieke 2025-09-07 21:34:40 +08:00 committed by GitHub
commit d565d52008
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 34 additions and 27 deletions

View file

@ -34,7 +34,7 @@ jobs:
os: [ubuntu-latest, macos-14] os: [ubuntu-latest, macos-14]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -no-parallel VFLAGS: -no-parallel
B_LFLAGS: -lm -lpthread B_LFLAGS: -lm -lpthread

View file

@ -29,7 +29,7 @@ concurrency:
jobs: jobs:
build-doom: build-doom:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 20 timeout-minutes: 30
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -23,7 +23,7 @@ concurrency:
jobs: jobs:
cross-macos: cross-macos:
runs-on: macos-13 runs-on: macos-13
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -cc clang VFLAGS: -cc clang
steps: steps:
@ -53,7 +53,7 @@ jobs:
cross-linux: cross-linux:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -cc tcc -no-retry-compilation VFLAGS: -cc tcc -no-retry-compilation
steps: steps:
@ -102,7 +102,7 @@ jobs:
cross-windows: cross-windows:
runs-on: windows-2025 runs-on: windows-2025
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build - name: Build

View file

@ -23,7 +23,7 @@ concurrency:
jobs: jobs:
check-markdown: check-markdown:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V
@ -59,7 +59,7 @@ jobs:
report-missing-dots-in-doc-comments: report-missing-dots-in-doc-comments:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -30,7 +30,7 @@ concurrency:
jobs: jobs:
build-vc: build-vc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -23,7 +23,7 @@ concurrency:
jobs: jobs:
gg-regressions: gg-regressions:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -cc tcc VFLAGS: -cc tcc
DISPLAY: :99 DISPLAY: :99

View file

@ -31,7 +31,7 @@ concurrency:
jobs: jobs:
build-module-docs: build-module-docs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -26,7 +26,7 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, macos-14, windows-latest] os: [ubuntu-latest, macos-14, windows-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5

View file

@ -67,7 +67,7 @@ jobs:
code-formatting: code-formatting:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -cc gcc VFLAGS: -cc gcc
steps: steps:
@ -107,7 +107,7 @@ jobs:
misc-tooling: misc-tooling:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -cc tcc -no-retry-compilation VFLAGS: -cc tcc -no-retry-compilation
steps: steps:

View file

@ -24,7 +24,7 @@ concurrency:
jobs: jobs:
space-paths-linux: space-paths-linux:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: with:

View file

@ -26,7 +26,7 @@ concurrency:
jobs: jobs:
v-compiles-sdl-examples: v-compiles-sdl-examples:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
env: env:
VFLAGS: -cc tcc VFLAGS: -cc tcc
steps: steps:

View file

@ -19,7 +19,7 @@ concurrency:
jobs: jobs:
toml-module-pass-external-test-suites: toml-module-pass-external-test-suites:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -65,7 +65,7 @@ jobs:
tools-macos: tools-macos:
runs-on: macos-14 runs-on: macos-14
timeout-minutes: 10 timeout-minutes: 15
strategy: strategy:
matrix: matrix:
cc: [clang] cc: [clang]

View file

@ -237,7 +237,7 @@ jobs:
os: [ubuntu-24.04, macos-14] os: [ubuntu-24.04, macos-14]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -24,7 +24,7 @@ concurrency:
jobs: jobs:
vab-compiles-v-examples: vab-compiles-v-examples:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
env: env:
VAB_FLAGS: --api 30 --build-tools 29.0.0 -v 3 VAB_FLAGS: --api 30 --build-tools 29.0.0 -v 3
steps: steps:

View file

@ -24,7 +24,7 @@ concurrency:
jobs: jobs:
vinix-build: vinix-build:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Build V - name: Build V

View file

@ -37,7 +37,7 @@ jobs:
- os: macos-14 - os: macos-14
zip: v_macos_arm64.zip zip: v_macos_arm64.zip
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 10 timeout-minutes: 15
env: env:
VDIR: /tmp/v_from_release_zip VDIR: /tmp/v_from_release_zip
steps: steps:

View file

@ -49,7 +49,7 @@ jobs:
matrix: matrix:
os: [ubuntu-22.04, windows-2022] os: [ubuntu-22.04, windows-2022]
fail-fast: false fail-fast: false
timeout-minutes: 10 timeout-minutes: 15
env: env:
VTEST_ONLY: wasm VTEST_ONLY: wasm
steps: steps:

View file

@ -22,7 +22,7 @@ fn main() {
fp.skip_executable() fp.skip_executable()
fp.limit_free_args_to_at_least(1)! fp.limit_free_args_to_at_least(1)!
context.show_help = fp.bool('help', `h`, false, 'Show this help screen.') context.show_help = fp.bool('help', `h`, false, 'Show this help screen.')
context.timeout = fp.float('timeout', `t`, 600.0, 'Timeout in seconds (for all retries). Default: 600.0 seconds (10 minutes).') * time.second context.timeout = fp.float('timeout', `t`, 900.0, 'Timeout in seconds (for all retries). Default: 900.0 seconds (15 minutes).') * time.second
context.delay = fp.float('delay', `d`, 1.0, 'Delay between each retry in seconds. Default: 1.0 second.') * time.second context.delay = fp.float('delay', `d`, 1.0, 'Delay between each retry in seconds. Default: 1.0 second.') * time.second
context.retries = fp.int('retries', `r`, 10, 'Maximum number of retries. Default: 10.') context.retries = fp.int('retries', `r`, 10, 'Maximum number of retries. Default: 10.')
if context.show_help { if context.show_help {

View file

@ -38,6 +38,9 @@ extern "C" {
#define FONTSTASH_MALLOC malloc #define FONTSTASH_MALLOC malloc
#define FONTSTASH_REALLOC realloc #define FONTSTASH_REALLOC realloc
#define FONTSTASH_FREE free #define FONTSTASH_FREE free
// __v_ start
#define FONTSTASH_MALLOC_ATOMIC malloc
// __v_ end
#endif #endif
enum FONSflags { enum FONSflags {
@ -563,7 +566,7 @@ static FONSatlas* fons__allocAtlas(int w, int h, int nnodes)
atlas->height = h; atlas->height = h;
// Allocate space for skyline nodes // Allocate space for skyline nodes
atlas->nodes = (FONSatlasNode*)FONTSTASH_MALLOC(sizeof(FONSatlasNode) * nnodes); atlas->nodes = (FONSatlasNode*)FONTSTASH_MALLOC_ATOMIC(sizeof(FONSatlasNode) * nnodes);
if (atlas->nodes == NULL) goto error; if (atlas->nodes == NULL) goto error;
memset(atlas->nodes, 0, sizeof(FONSatlasNode) * nnodes); memset(atlas->nodes, 0, sizeof(FONSatlasNode) * nnodes);
atlas->nnodes = 0; atlas->nnodes = 0;
@ -780,7 +783,7 @@ FONScontext* fonsCreateInternal(FONSparams* params)
// Create texture for the cache. // Create texture for the cache.
stash->itw = 1.0f/stash->params.width; stash->itw = 1.0f/stash->params.width;
stash->ith = 1.0f/stash->params.height; stash->ith = 1.0f/stash->params.height;
stash->texData = (unsigned char*)FONTSTASH_MALLOC(stash->params.width * stash->params.height); stash->texData = (unsigned char*)FONTSTASH_MALLOC_ATOMIC(stash->params.width * stash->params.height);
if (stash->texData == NULL) goto error; if (stash->texData == NULL) goto error;
memset(stash->texData, 0, stash->params.width * stash->params.height); memset(stash->texData, 0, stash->params.width * stash->params.height);
@ -901,7 +904,7 @@ static int fons__allocFont(FONScontext* stash)
if (font == NULL) goto error; if (font == NULL) goto error;
memset(font, 0, sizeof(FONSfont)); memset(font, 0, sizeof(FONSfont));
font->glyphs = (FONSglyph*)FONTSTASH_MALLOC(sizeof(FONSglyph) * FONS_INIT_GLYPHS); font->glyphs = (FONSglyph*)FONTSTASH_MALLOC_ATOMIC(sizeof(FONSglyph) * FONS_INIT_GLYPHS);
if (font->glyphs == NULL) goto error; if (font->glyphs == NULL) goto error;
font->cglyphs = FONS_INIT_GLYPHS; font->cglyphs = FONS_INIT_GLYPHS;
font->nglyphs = 0; font->nglyphs = 0;
@ -1657,7 +1660,7 @@ FONS_DEF int fonsExpandAtlas(FONScontext* stash, int width, int height)
return 0; return 0;
} }
// Copy old texture data over. // Copy old texture data over.
data = (unsigned char*)FONTSTASH_MALLOC(width * height); data = (unsigned char*)FONTSTASH_MALLOC_ATOMIC(width * height);
if (data == NULL) if (data == NULL)
return 0; return 0;
for (i = 0; i < stash->params.height; i++) { for (i = 0; i < stash->params.height; i++) {

View file

@ -8,6 +8,7 @@ $if gcboehm ? {
#define FONTSTASH_MALLOC GC_MALLOC #define FONTSTASH_MALLOC GC_MALLOC
#define FONTSTASH_REALLOC GC_REALLOC #define FONTSTASH_REALLOC GC_REALLOC
#define FONTSTASH_FREE GC_FREE #define FONTSTASH_FREE GC_FREE
#define FONTSTASH_MALLOC_ATOMIC GC_MALLOC_ATOMIC
} }
#include "fontstash.h" #include "fontstash.h"
#flag darwin -I/usr/local/Cellar/freetype/2.10.2/include/freetype2 #flag darwin -I/usr/local/Cellar/freetype/2.10.2/include/freetype2

View file

@ -302,6 +302,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
// have much better performance when NDEBUG is defined // have much better performance when NDEBUG is defined
// See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf // See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
ccoptions.args << '-DNDEBUG' ccoptions.args << '-DNDEBUG'
ccoptions.args << '-DNO_DEBUGGING' // for BDWGC
} }
if v.pref.sanitize { if v.pref.sanitize {
ccoptions.args << '-fsanitize=leak' ccoptions.args << '-fsanitize=leak'

View file

@ -291,6 +291,7 @@ pub fn (mut v Builder) cc_msvc() {
} else { } else {
a << '/MD' a << '/MD'
a << '/DNDEBUG' a << '/DNDEBUG'
a << '/DNO_DEBUGGING'
if !v.ccoptions.debug_mode { if !v.ccoptions.debug_mode {
v.pref.cleanup_files << out_name_pdb v.pref.cleanup_files << out_name_pdb
v.pref.cleanup_files << app_dir_out_name + '.pdb' v.pref.cleanup_files << app_dir_out_name + '.pdb'
@ -458,6 +459,7 @@ fn (mut v Builder) build_thirdparty_obj_file_with_msvc(_mod string, path string,
oargs << '/O2' oargs << '/O2'
oargs << '/MD' oargs << '/MD'
oargs << '/DNDEBUG' oargs << '/DNDEBUG'
oargs << '/DNO_DEBUGGING'
} }
} else { } else {
oargs << '/MDd' oargs << '/MDd'