Skip to content

Commit

Permalink
Fix #15
Browse files Browse the repository at this point in the history
Werror is disabled now as it can always cause issues on untested (potentially
newer) compilers. Enable it for CI.
Also fix the issues mentioned in the issue.
Disable sonar scanning for now, not really used but causing issues.
  • Loading branch information
nyorain committed Aug 24, 2024
1 parent 4c02e34 commit 1c1308c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 32 deletions.
64 changes: 36 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,25 @@ jobs:
libxkbcommon-x11-dev libx11-dev libx11-xcb-dev vulkan-validationlayers valgrind
# TODO: integration tests run in theory but crash inside vulkan
# loader on ci, can't reproduce locally :(
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Djson-config-absolute-path=true
-Dintegration-tests=false
-Dx11-hook=false
-Dx11-hook=false
-Dtracy=true
-Dwerror=true
env:
CC: gcc
# TODO: no idea why this is needed using 'meson test' but not 'ninja test'.
# sounds like a meson bug.
# - run: ninja -C build subprojects/vkmockicd/libVkICD_mock_icd.so
# meson test -C build/ -v
# valgrind --leak-check=full?
- run: meson test -C build
--wrapper 'valgrind --leak-check=full --error-exitcode=1 --suppressions=../docs/valgrind.sup'
- run: meson test -C build
--wrapper 'valgrind --leak-check=full --error-exitcode=1 --suppressions=../docs/valgrind.sup'
--print-errorlogs
# NOTE: the ci cpus seem to need this for tracy. Might result
# in issues (inconsistent timings between cpu cores or something),
# in issues (inconsistent timings between cpu cores or something),
# we don't care about it here
env:
TRACY_NO_INVARIANT_CHECK: 1
Expand All @@ -88,11 +89,12 @@ jobs:
libxkbcommon-dev libwayland-dev libxcb1-dev wayland-protocols libxcb-ewmh-dev
libxcb-icccm4-dev libxcb-shm0-dev libxcb-present-dev libxcb-xinput-dev libxcb-xkb-dev
libxkbcommon-x11-dev libx11-dev libx11-xcb-dev
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dintegration-tests=false
-Dx11-hook=false
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dintegration-tests=false
-Dx11-hook=false
-Dbuildtype=release
-Dwerror=true
env:
CC: gcc
- run: meson test -C build/ -v
Expand All @@ -115,10 +117,11 @@ jobs:
libxkbcommon-dev libwayland-dev libxcb1-dev wayland-protocols libxcb-ewmh-dev
libxcb-icccm4-dev libxcb-shm0-dev libxcb-present-dev libxcb-xinput-dev libxcb-xkb-dev
libxkbcommon-x11-dev libx11-dev libx11-xcb-dev
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dintegration-tests=false
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dintegration-tests=false
-Dx11-hook=false
-Dwerror=true
- run: meson test -C build/ -v

linux-clang-tracy-debugoptimized:
Expand All @@ -139,12 +142,13 @@ jobs:
libxkbcommon-dev libwayland-dev libxcb1-dev wayland-protocols libxcb-ewmh-dev
libxcb-icccm4-dev libxcb-shm0-dev libxcb-present-dev libxcb-xinput-dev libxcb-xkb-dev
libxkbcommon-x11-dev libx11-dev libx11-xcb-dev
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dintegration-tests=false
-Dx11-hook=false
-Dtracy=true
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dintegration-tests=false
-Dx11-hook=false
-Dtracy=true
-Dbuildtype=debugoptimized
-Dwerror=true
- run: meson test -C build/ -v

# See https://dvdhrm.github.io/2021/04/21/meson-msvc-github-actions/
Expand All @@ -162,8 +166,9 @@ jobs:
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- run: meson setup build/ --backend=ninja
- run: meson setup build/ --backend=ninja
-Dunit-tests=true
-Dwerror=true
- run: meson test -C build/ -v

windows:
Expand All @@ -183,6 +188,7 @@ jobs:
- run: meson setup build/
-Dunit-tests=true
-Dintegration-tests=false
-Dwerror=true
- run: meson test -C build/ -v

windows-release:
Expand All @@ -206,21 +212,22 @@ jobs:
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- run: meson setup build/
-Dunit-tests=true
- run: meson setup build/
-Dunit-tests=true
-Dintegration-tests=false
-Dbuildtype=release
-Ddebug=true
-Dwerror=true
- run: meson test -C build/ -v
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: Windows Binaries
path: |
build/VkLayer_live_introspection.dll
build/VkLayer_live_introspection.json
build/VkLayer_live_introspection.lib
build/VkLayer_live_introspection.pdb
build/VkLayer_live_introspection.dll
build/VkLayer_live_introspection.json
build/VkLayer_live_introspection.lib
build/VkLayer_live_introspection.pdb
build/register_layer.bat
Expand All @@ -238,10 +245,11 @@ jobs:
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- run: meson setup build/
-Dunit-tests=true
-Dbuildtype=release
- run: meson setup build/
-Dunit-tests=true
-Dbuildtype=release
-Dtracy=true
-Dwerror=true
- run: meson test -C build/ -v

# TODO:
Expand Down
File renamed without changes.
8 changes: 7 additions & 1 deletion docs/valgrind.sup
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
...
fun:dlclose
}

{
Ignore dlopen bug.
Memcheck:Leak
...
fun:tracy::SetThreadName
...
}
16 changes: 15 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
project('VIL', ['c', 'cpp'],
version: '0.1.0',
default_options: [
'werror=true',
# NOTE: werror is a good idea in theory but there are too many
# compiler versions out there and people building it having
# to fight with build errors (instead of warnings) is not worth it.
# Gets manually activated for CI.
# 'werror=true',
'werror=false',
'swa:werror=false',
'imgio:werror=false',
'nytl:werror=false',
'pml:werror=false',
'dlg:werror=false',
'png:werror=false',
'vkmockicd:werror=false',
'zlib:werror=false',

'warning_level=3',
'cpp_std=c++17',
# NOTE: this will cause issues on old msvc versions, with new
Expand Down
4 changes: 2 additions & 2 deletions src/spvm/opcode_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,13 @@ void spvm_setup_OpAccessChain(spvm_word word_count, spvm_state_t state)

if(src->type == spvm_result_type_variable) {
dst->index_count = word_count - 3;
dst->indices = calloc(sizeof(spvm_word), dst->index_count);
dst->indices = calloc(dst->index_count, sizeof(spvm_word));
} else if(src->type == spvm_result_type_access_chain) {
dst->access_chain_ref = src->access_chain_ref;

spvm_word local_index_count = word_count - 3;
dst->index_count = local_index_count + src->index_count;
dst->indices = calloc(sizeof(spvm_word), dst->index_count);
dst->indices = calloc(dst->index_count, sizeof(spvm_word));
} else {
assert(!"Unimplemented");
}
Expand Down

0 comments on commit 1c1308c

Please sign in to comment.