From 0b93af32b6c9d222a34282df29da229712f4acba Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 00:40:34 +0100 Subject: [PATCH 01/37] [ci] Add Windows check --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e01009554..b641cc38b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,6 +77,28 @@ jobs: - run: pytest -x -s working-directory: objdir + CI-windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v6 + with: + python-version: '3.12' + - name: Install dependencies + run: | + choco install llvm winflexbison3 unifdef + pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + - name: Configure + run: | + mkdir objdir + cmake -S . -B objdir -DCMAKE_PREFIX_PATH="C:\Program Files\LLVM" -DFLEX_EXECUTABLE=win_flex + - name: Build + run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS + - name: Test + working-directory: objdir + run: pytest + CI-python: runs-on: ubuntu-latest container: From 485be38b1f6d933d00e1d39e370c9e3cdabfd212 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 00:45:22 +0100 Subject: [PATCH 02/37] dbg --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b641cc38b..80adca5ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,10 +89,12 @@ jobs: run: | choco install llvm winflexbison3 unifdef pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + - name: List LLVM files + run: | + ls "C:/Program Files/LLVM/lib/cmake/llvm" - name: Configure run: | - mkdir objdir - cmake -S . -B objdir -DCMAKE_PREFIX_PATH="C:\Program Files\LLVM" -DFLEX_EXECUTABLE=win_flex + cmake -S . -B objdir -DLLVM_DIR="C:/Program Files/LLVM/lib/cmake/llvm" -DClang_DIR="C:/Program Files/LLVM/lib/cmake/clang" -DFLEX_EXECUTABLE=win_flex - name: Build run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS - name: Test From ed11f2524f192f851e876a0f74d0828471f1520d Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 00:48:03 +0100 Subject: [PATCH 03/37] dbg --- .github/workflows/build.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80adca5ff..54adfe863 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,13 +88,34 @@ jobs: - name: Install dependencies run: | choco install llvm winflexbison3 unifdef + echo "C:\Program Files\LLVM\bin" >> $env:GITHUB_PATH pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - - name: List LLVM files + - name: Find LLVM run: | - ls "C:/Program Files/LLVM/lib/cmake/llvm" + $llvmConfig = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "LLVMConfig.cmake" -Recurse | Select-Object -First 1 + if ($llvmConfig) { + $llvm_dir = $llvmConfig.DirectoryName.Replace('\', '/') + echo "LLVM_DIR=$llvm_dir" >> $env:GITHUB_ENV + echo "Found LLVM_DIR: $llvm_dir" + } else { + echo "LLVMConfig.cmake not found!" + exit 1 + } + $clangConfig = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "ClangConfig.cmake" -Recurse | Select-Object -First 1 + if ($clangConfig) { + $clang_dir = $clangConfig.DirectoryName.Replace('\', '/') + echo "Clang_DIR=$clang_dir" >> $env:GITHUB_ENV + echo "Found Clang_DIR: $clang_dir" + } else { + echo "ClangConfig.cmake not found!" + # Fallback to LLVM_DIR with clang replacement if not found directly + $clang_dir = $llvm_dir.Replace('llvm', 'clang') + echo "Clang_DIR=$clang_dir" >> $env:GITHUB_ENV + echo "Fallback Clang_DIR: $clang_dir" + } - name: Configure run: | - cmake -S . -B objdir -DLLVM_DIR="C:/Program Files/LLVM/lib/cmake/llvm" -DClang_DIR="C:/Program Files/LLVM/lib/cmake/clang" -DFLEX_EXECUTABLE=win_flex + cmake -S . -B objdir -DLLVM_DIR="$env:LLVM_DIR" -DClang_DIR="$env:Clang_DIR" -DFLEX_EXECUTABLE=win_flex - name: Build run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS - name: Test From 17e8f568c15671b05747ab67804fbcfd579f04fa Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 00:50:55 +0100 Subject: [PATCH 04/37] dbg --- .github/workflows/build.yml | 41 +++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54adfe863..cd9be0c4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,26 +92,31 @@ jobs: pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - name: Find LLVM run: | - $llvmConfig = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "LLVMConfig.cmake" -Recurse | Select-Object -First 1 - if ($llvmConfig) { - $llvm_dir = $llvmConfig.DirectoryName.Replace('\', '/') - echo "LLVM_DIR=$llvm_dir" >> $env:GITHUB_ENV - echo "Found LLVM_DIR: $llvm_dir" - } else { - echo "LLVMConfig.cmake not found!" - exit 1 + $llvm_bin = "C:\Program Files\LLVM\bin" + if (Test-Path "$llvm_bin\llvm-config.exe") { + $cmakedir = (& "$llvm_bin\llvm-config.exe" --cmakedir).Replace('\', '/') + echo "LLVM_DIR=$cmakedir" >> $env:GITHUB_ENV + echo "Clang_DIR=$($cmakedir.Replace('llvm', 'clang'))" >> $env:GITHUB_ENV + echo "Found via llvm-config: $cmakedir" } - $clangConfig = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "ClangConfig.cmake" -Recurse | Select-Object -First 1 - if ($clangConfig) { - $clang_dir = $clangConfig.DirectoryName.Replace('\', '/') - echo "Clang_DIR=$clang_dir" >> $env:GITHUB_ENV - echo "Found Clang_DIR: $clang_dir" + + # Comprehensive search if llvm-config failed or to verify + $configFiles = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "LLVMConfig.cmake" -Recurse -ErrorAction SilentlyContinue + if ($configFiles) { + $llvm_dir = $configFiles[0].DirectoryName.Replace('\', '/') + echo "LLVM_DIR=$llvm_dir" >> $env:GITHUB_ENV + echo "Found via search: $llvm_dir" + + $clangFiles = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "ClangConfig.cmake" -Recurse -ErrorAction SilentlyContinue + if ($clangFiles) { + $clang_dir = $clangFiles[0].DirectoryName.Replace('\', '/') + echo "Clang_DIR=$clang_dir" >> $env:GITHUB_ENV + echo "Found Clang via search: $clang_dir" + } } else { - echo "ClangConfig.cmake not found!" - # Fallback to LLVM_DIR with clang replacement if not found directly - $clang_dir = $llvm_dir.Replace('llvm', 'clang') - echo "Clang_DIR=$clang_dir" >> $env:GITHUB_ENV - echo "Fallback Clang_DIR: $clang_dir" + echo "LLVMConfig.cmake NOT FOUND in C:\Program Files\LLVM" + echo "Listing all .cmake files for debugging:" + Get-ChildItem -Path "C:\Program Files\LLVM" -Recurse -Filter "*.cmake" | Select-Object FullName } - name: Configure run: | From fe9f21f68fa9ff3055f45600019bf1d7f709de87 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 00:56:20 +0100 Subject: [PATCH 05/37] dbg --- .github/workflows/build.yml | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd9be0c4b..ed70edad9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,37 +87,16 @@ jobs: python-version: '3.12' - name: Install dependencies run: | - choco install llvm winflexbison3 unifdef - echo "C:\Program Files\LLVM\bin" >> $env:GITHUB_PATH + choco install winflexbison3 unifdef pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - - name: Find LLVM + - name: Download LLVM run: | - $llvm_bin = "C:\Program Files\LLVM\bin" - if (Test-Path "$llvm_bin\llvm-config.exe") { - $cmakedir = (& "$llvm_bin\llvm-config.exe" --cmakedir).Replace('\', '/') - echo "LLVM_DIR=$cmakedir" >> $env:GITHUB_ENV - echo "Clang_DIR=$($cmakedir.Replace('llvm', 'clang'))" >> $env:GITHUB_ENV - echo "Found via llvm-config: $cmakedir" - } - - # Comprehensive search if llvm-config failed or to verify - $configFiles = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "LLVMConfig.cmake" -Recurse -ErrorAction SilentlyContinue - if ($configFiles) { - $llvm_dir = $configFiles[0].DirectoryName.Replace('\', '/') - echo "LLVM_DIR=$llvm_dir" >> $env:GITHUB_ENV - echo "Found via search: $llvm_dir" - - $clangFiles = Get-ChildItem -Path "C:\Program Files\LLVM" -Filter "ClangConfig.cmake" -Recurse -ErrorAction SilentlyContinue - if ($clangFiles) { - $clang_dir = $clangFiles[0].DirectoryName.Replace('\', '/') - echo "Clang_DIR=$clang_dir" >> $env:GITHUB_ENV - echo "Found Clang via search: $clang_dir" - } - } else { - echo "LLVMConfig.cmake NOT FOUND in C:\Program Files\LLVM" - echo "Listing all .cmake files for debugging:" - Get-ChildItem -Path "C:\Program Files\LLVM" -Recurse -Filter "*.cmake" | Select-Object FullName - } + Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/llvm-18.1.8-windows-x86_64.7z" -OutFile "llvm.7z" + 7z x llvm.7z -oLLVM + $llvm_root = (Get-Item "LLVM").FullName.Replace('\', '/') + echo "LLVM_DIR=$llvm_root/lib/cmake/llvm" >> $env:GITHUB_ENV + echo "Clang_DIR=$llvm_root/lib/cmake/clang" >> $env:GITHUB_ENV + echo "$llvm_root/bin" >> $env:GITHUB_PATH - name: Configure run: | cmake -S . -B objdir -DLLVM_DIR="$env:LLVM_DIR" -DClang_DIR="$env:Clang_DIR" -DFLEX_EXECUTABLE=win_flex From 4f74975ad42b2c1c65c2ae54ecf24f986189be72 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 00:59:07 +0100 Subject: [PATCH 06/37] dbg --- .github/workflows/build.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed70edad9..3d1af6fb5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,17 +89,13 @@ jobs: run: | choco install winflexbison3 unifdef pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - - name: Download LLVM - run: | - Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/llvm-18.1.8-windows-x86_64.7z" -OutFile "llvm.7z" - 7z x llvm.7z -oLLVM - $llvm_root = (Get-Item "LLVM").FullName.Replace('\', '/') - echo "LLVM_DIR=$llvm_root/lib/cmake/llvm" >> $env:GITHUB_ENV - echo "Clang_DIR=$llvm_root/lib/cmake/clang" >> $env:GITHUB_ENV - echo "$llvm_root/bin" >> $env:GITHUB_PATH + - name: Install LLVM + uses: KyleMayes/install-llvm-action@v2 + with: + version: "18.1.8" - name: Configure run: | - cmake -S . -B objdir -DLLVM_DIR="$env:LLVM_DIR" -DClang_DIR="$env:Clang_DIR" -DFLEX_EXECUTABLE=win_flex + cmake -S . -B objdir -DFLEX_EXECUTABLE=win_flex - name: Build run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS - name: Test From ce186eb75146bd17256b138d8609f388138825ca Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 01:02:43 +0100 Subject: [PATCH 07/37] dbg --- .github/workflows/build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d1af6fb5..8f3639a86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,21 +82,23 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v6 + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v3 with: + auto-update-conda: true python-version: '3.12' + activate-environment: cvise-env - name: Install dependencies + shell: powershell run: | - choco install winflexbison3 unifdef + conda install -y -c conda-forge llvmdev clangdev winflexbison unifdef pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - - name: Install LLVM - uses: KyleMayes/install-llvm-action@v2 - with: - version: "18.1.8" - name: Configure + shell: powershell run: | - cmake -S . -B objdir -DFLEX_EXECUTABLE=win_flex + cmake -S . -B objdir -DCMAKE_PREFIX_PATH="$env:CONDA_PREFIX" -DFLEX_EXECUTABLE=win_flex - name: Build + shell: powershell run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS - name: Test working-directory: objdir From 35e8f5243ac5f3359565ea7dfb75f15b8f2f904b Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 01:21:31 +0100 Subject: [PATCH 08/37] dbg --- .github/workflows/build.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f3639a86..9d4cfac70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,20 +89,29 @@ jobs: python-version: '3.12' activate-environment: cvise-env - name: Install dependencies - shell: powershell + shell: bash -l {0} run: | - conda install -y -c conda-forge llvmdev clangdev winflexbison unifdef + conda install -y -c conda-forge llvmdev clangdev winflexbison + choco install unifdef pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + - name: Debug Conda Prefix + shell: bash -l {0} + run: | + find $CONDA_PREFIX -name "LLVMConfig.cmake" - name: Configure - shell: powershell + shell: bash -l {0} run: | - cmake -S . -B objdir -DCMAKE_PREFIX_PATH="$env:CONDA_PREFIX" -DFLEX_EXECUTABLE=win_flex + # Convert Windows path to CMake-friendly path + CONDA_PREFIX_UNIX=$(cygpath -m "$CONDA_PREFIX") + cmake -S . -B objdir -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" -DFLEX_EXECUTABLE=win_flex - name: Build - shell: powershell - run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS + shell: bash -l {0} + run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS - name: Test - working-directory: objdir - run: pytest + shell: bash -l {0} + run: | + cd objdir + pytest CI-python: runs-on: ubuntu-latest From c595ad2956322f4be89d3ed58e0eceef5742bbb5 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 01:27:47 +0100 Subject: [PATCH 09/37] dbg --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d4cfac70..d9ec87f88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,8 +92,7 @@ jobs: shell: bash -l {0} run: | conda install -y -c conda-forge llvmdev clangdev winflexbison - choco install unifdef - pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + pip install unifdef chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - name: Debug Conda Prefix shell: bash -l {0} run: | @@ -103,7 +102,11 @@ jobs: run: | # Convert Windows path to CMake-friendly path CONDA_PREFIX_UNIX=$(cygpath -m "$CONDA_PREFIX") - cmake -S . -B objdir -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" -DFLEX_EXECUTABLE=win_flex + cmake -S . -B objdir \ + -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" \ + -DLLVM_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/llvm" \ + -DClang_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/clang" \ + -DFLEX_EXECUTABLE=win_flex - name: Build shell: bash -l {0} run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS From b9799be47a9ce4b7d5da14389347d66c19ba528e Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 01:31:37 +0100 Subject: [PATCH 10/37] dbg --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9ec87f88..73b6ce811 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,11 +92,12 @@ jobs: shell: bash -l {0} run: | conda install -y -c conda-forge llvmdev clangdev winflexbison - pip install unifdef chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - name: Debug Conda Prefix shell: bash -l {0} run: | - find $CONDA_PREFIX -name "LLVMConfig.cmake" + echo "CONDA_PREFIX: $CONDA_PREFIX" + find "$CONDA_PREFIX" -name "LLVMConfig.cmake" || echo "LLVMConfig.cmake not found" - name: Configure shell: bash -l {0} run: | From 1581778a715516e055224a278d6f40a5eed8a81c Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 01:39:12 +0100 Subject: [PATCH 11/37] dbg --- .github/workflows/build.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73b6ce811..4a2e2c057 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,13 +91,8 @@ jobs: - name: Install dependencies shell: bash -l {0} run: | - conda install -y -c conda-forge llvmdev clangdev winflexbison - pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - - name: Debug Conda Prefix - shell: bash -l {0} - run: | - echo "CONDA_PREFIX: $CONDA_PREFIX" - find "$CONDA_PREFIX" -name "LLVMConfig.cmake" || echo "LLVMConfig.cmake not found" + conda install -y -c conda-forge llvmdev clangdev winflexbison \ + chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - name: Configure shell: bash -l {0} run: | @@ -107,7 +102,8 @@ jobs: -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" \ -DLLVM_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/llvm" \ -DClang_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/clang" \ - -DFLEX_EXECUTABLE=win_flex + -DFLEX_EXECUTABLE="$CONDA_PREFIX_UNIX/Library/bin/win_flex.exe" \ + -DPython3_EXECUTABLE="$CONDA_PREFIX_UNIX/python.exe" - name: Build shell: bash -l {0} run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS From 4ca12b59d903cee0d1f53e9646ae608f49fedb42 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 02:14:31 +0100 Subject: [PATCH 12/37] dbg --- CMakeLists.txt | 32 +++++++++++++++++++++++++++ clang_delta/CMakeLists.txt | 3 ++- clang_include_graph/CMakeLists.txt | 1 + cmake_config.h.in | 35 ++++++++++++++++++++++++++++++ delta/topformflat.l | 3 +++ 5 files changed, 73 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e768c8f0..58d2de7a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,6 +207,38 @@ endif() ############################################################################### +# On Windows, LLVM might depend on DIA SDK. If it's not found correctly, we fix it. +if(MSVC) + set(DIA_SDK_ROOT "$ENV{VSINSTALLDIR}DIA SDK") + if(NOT EXISTS "${DIA_SDK_ROOT}") + foreach(vs_path "C:/Program Files/Microsoft Visual Studio/2022/Enterprise" + "C:/Program Files/Microsoft Visual Studio/2022/Community" + "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise" + "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community") + if(EXISTS "${vs_path}/DIA SDK") + set(DIA_SDK_ROOT "${vs_path}/DIA SDK") + break() + endif() + endforeach() + endif() + if(EXISTS "${DIA_SDK_ROOT}") + message(STATUS "Found DIA SDK at ${DIA_SDK_ROOT}") + set(DIA_SDK_FOUND TRUE) + endif() +endif() + +function(cvise_fix_dia_sdk target) + if(MSVC AND DIA_SDK_FOUND) + get_target_property(LIBS ${target} LINK_LIBRARIES) + if(LIBS) + string(REPLACE "\\DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${LIBS}") + set_target_properties(${target} PROPERTIES LINK_LIBRARIES "${FIXED_LIBS}") + endif() + endif() +endfunction() + +############################################################################### + # Enable tests enable_testing() add_test(NAME all COMMAND ${Python3_EXECUTABLE} -m pytest) diff --git a/clang_delta/CMakeLists.txt b/clang_delta/CMakeLists.txt index c097241ef..79f780841 100644 --- a/clang_delta/CMakeLists.txt +++ b/clang_delta/CMakeLists.txt @@ -668,6 +668,7 @@ add_executable(clang_delta # ENE: See comment above about why LLVM_LIBS is not included in this call. target_link_libraries(clang_delta ${CLANG_LIBS}) +cvise_fix_dia_sdk(clang_delta) # For cases in which the LLVM libraries are shared libraries, remember where # the shared libraries are. @@ -679,7 +680,7 @@ set_target_properties(clang_delta # On Windows, we also need to link with "Version.dll" system library. # See . -if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") +if(MSVC) target_link_libraries(clang_delta Version) endif() diff --git a/clang_include_graph/CMakeLists.txt b/clang_include_graph/CMakeLists.txt index 92d6134c0..e4e86bde4 100644 --- a/clang_include_graph/CMakeLists.txt +++ b/clang_include_graph/CMakeLists.txt @@ -29,6 +29,7 @@ else() ) endif() target_link_libraries(clang_include_graph ${CLANG_LIBS}) +cvise_fix_dia_sdk(clang_include_graph) install(TARGETS clang_include_graph DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/${cvise_PACKAGE}/" diff --git a/cmake_config.h.in b/cmake_config.h.in index 3edf898a6..755c56923 100755 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -55,3 +55,38 @@ /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #cmakedefine YYTEXT_POINTER 1 + +#ifdef _WIN32 +#include +#include +#include +#include +#define isatty _isatty +#define fileno _fileno +#define read _read +#include +typedef SSIZE_T ssize_t; + +static inline ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) { + if (lineptr == NULL || n == NULL || stream == NULL) return -1; + if (*lineptr == NULL) { + *n = 128; + *lineptr = (char *)malloc(*n); + if (*lineptr == NULL) return -1; + } + int c; + size_t i = 0; + while ((c = getc(stream)) != EOF) { + if (i + 1 >= *n) { + *n *= 2; + char *next = (char *)realloc(*lineptr, *n); + if (next == NULL) return -1; + *lineptr = next; + } + (*lineptr)[i++] = (char)c; + if (c == delim) break; + } + (*lineptr)[i] = '\0'; + return (i == 0 && c == EOF) ? -1 : (ssize_t)i; +} +#endif diff --git a/delta/topformflat.l b/delta/topformflat.l index 2c9962b5f..5a40a0c49 100644 --- a/delta/topformflat.l +++ b/delta/topformflat.l @@ -6,6 +6,9 @@ * very heuristic... */ %{ +#if HAVE_CONFIG_H +# include +#endif #include #include #include // atoi From 5c8d28647338b10562e10c8414b958d43f2c38d3 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 12:52:30 +0100 Subject: [PATCH 13/37] dbg --- CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58d2de7a9..ca5b1d1fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,9 +221,14 @@ if(MSVC) endif() endforeach() endif() + if(EXISTS "${DIA_SDK_ROOT}") message(STATUS "Found DIA SDK at ${DIA_SDK_ROOT}") set(DIA_SDK_FOUND TRUE) + # Ensure CMake-style paths + file(TO_CMAKE_PATH "${DIA_SDK_ROOT}" DIA_SDK_ROOT) + else() + message(WARNING "DIA SDK not found at ${DIA_SDK_ROOT} or in standard locations.") endif() endif() @@ -231,8 +236,15 @@ function(cvise_fix_dia_sdk target) if(MSVC AND DIA_SDK_FOUND) get_target_property(LIBS ${target} LINK_LIBRARIES) if(LIBS) + message(STATUS "Inspecting LINK_LIBRARIES for ${target}: ${LIBS}") + # Replace both backslash and forward slash variants string(REPLACE "\\DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${LIBS}") - set_target_properties(${target} PROPERTIES LINK_LIBRARIES "${FIXED_LIBS}") + string(REPLACE "/DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${FIXED_LIBS}") + + if(NOT "${LIBS}" STREQUAL "${FIXED_LIBS}") + message(STATUS "Fixed DIA SDK path for ${target}. New libs: ${FIXED_LIBS}") + set_target_properties(${target} PROPERTIES LINK_LIBRARIES "${FIXED_LIBS}") + endif() endif() endif() endfunction() From 66f6db400d926950fbb59ec19b91c6fef1957292 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 13:02:19 +0100 Subject: [PATCH 14/37] dbg --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca5b1d1fc..5095ac939 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,10 +234,13 @@ endif() function(cvise_fix_dia_sdk target) if(MSVC AND DIA_SDK_FOUND) + # Check if we need to link against diaguids.lib explicitly + # Some LLVM builds on Windows might have this dependency implicitly broken + target_link_libraries(${target} "${DIA_SDK_ROOT}/lib/amd64/diaguids.lib") + get_target_property(LIBS ${target} LINK_LIBRARIES) if(LIBS) message(STATUS "Inspecting LINK_LIBRARIES for ${target}: ${LIBS}") - # Replace both backslash and forward slash variants string(REPLACE "\\DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${LIBS}") string(REPLACE "/DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${FIXED_LIBS}") From e4d694fbe64a5c412614d34fe44643703ad19b08 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 13:45:31 +0100 Subject: [PATCH 15/37] dbg --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5095ac939..98e8c3d3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,6 +227,13 @@ if(MSVC) set(DIA_SDK_FOUND TRUE) # Ensure CMake-style paths file(TO_CMAKE_PATH "${DIA_SDK_ROOT}" DIA_SDK_ROOT) + + find_file(DIAGUIDS_LIB diaguids.lib PATHS "${DIA_SDK_ROOT}/lib/amd64" NO_DEFAULT_PATH) + if(DIAGUIDS_LIB) + message(STATUS "Found diaguids.lib at ${DIAGUIDS_LIB}") + else() + message(WARNING "Could not find diaguids.lib in ${DIA_SDK_ROOT}/lib/amd64") + endif() else() message(WARNING "DIA SDK not found at ${DIA_SDK_ROOT} or in standard locations.") endif() @@ -235,8 +242,9 @@ endif() function(cvise_fix_dia_sdk target) if(MSVC AND DIA_SDK_FOUND) # Check if we need to link against diaguids.lib explicitly - # Some LLVM builds on Windows might have this dependency implicitly broken - target_link_libraries(${target} "${DIA_SDK_ROOT}/lib/amd64/diaguids.lib") + if(DIAGUIDS_LIB) + target_link_libraries(${target} "${DIAGUIDS_LIB}") + endif() get_target_property(LIBS ${target} LINK_LIBRARIES) if(LIBS) From a649d5e333ddfa134540108f478bb1fe069bac96 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 15:25:05 +0100 Subject: [PATCH 16/37] dbg --- CMakeLists.txt | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98e8c3d3a..88336c186 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,6 +231,8 @@ if(MSVC) find_file(DIAGUIDS_LIB diaguids.lib PATHS "${DIA_SDK_ROOT}/lib/amd64" NO_DEFAULT_PATH) if(DIAGUIDS_LIB) message(STATUS "Found diaguids.lib at ${DIAGUIDS_LIB}") + # Convert to native path to avoid MSBuild issues with forward slashes/spaces + file(TO_NATIVE_PATH "${DIAGUIDS_LIB}" DIAGUIDS_LIB_NATIVE) else() message(WARNING "Could not find diaguids.lib in ${DIA_SDK_ROOT}/lib/amd64") endif() @@ -242,21 +244,27 @@ endif() function(cvise_fix_dia_sdk target) if(MSVC AND DIA_SDK_FOUND) # Check if we need to link against diaguids.lib explicitly - if(DIAGUIDS_LIB) - target_link_libraries(${target} "${DIAGUIDS_LIB}") + if(DIAGUIDS_LIB_NATIVE) + target_link_libraries(${target} "${DIAGUIDS_LIB_NATIVE}") endif() - get_target_property(LIBS ${target} LINK_LIBRARIES) - if(LIBS) - message(STATUS "Inspecting LINK_LIBRARIES for ${target}: ${LIBS}") - string(REPLACE "\\DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${LIBS}") - string(REPLACE "/DIA SDK" "${DIA_SDK_ROOT}" FIXED_LIBS "${FIXED_LIBS}") - - if(NOT "${LIBS}" STREQUAL "${FIXED_LIBS}") - message(STATUS "Fixed DIA SDK path for ${target}. New libs: ${FIXED_LIBS}") - set_target_properties(${target} PROPERTIES LINK_LIBRARIES "${FIXED_LIBS}") + # Also inspect imported targets in CLANG_LIBS to fix transitive dependencies + # This is where "\DIA SDK" likely comes from + foreach(lib ${CLANG_LIBS}) + if(TARGET ${lib}) + get_target_property(IFACE_LIBS ${lib} INTERFACE_LINK_LIBRARIES) + if(IFACE_LIBS) + string(FIND "${IFACE_LIBS}" "DIA SDK" HAS_DIA) + if(HAS_DIA GREATER -1) + message(STATUS "Found DIA SDK in dependency ${lib}: ${IFACE_LIBS}") + string(REPLACE "\\DIA SDK" "${DIA_SDK_ROOT}" FIXED_IFACE "${IFACE_LIBS}") + string(REPLACE "/DIA SDK" "${DIA_SDK_ROOT}" FIXED_IFACE "${FIXED_IFACE}") + set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${FIXED_IFACE}") + message(STATUS "Fixed DIA SDK in dependency ${lib}") + endif() + endif() endif() - endif() + endforeach() endif() endfunction() From 6c95bd659e83a4bd3b0f6fe98bfde0c2359bf909 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 15:35:11 +0100 Subject: [PATCH 17/37] dbg --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a2e2c057..211a78b20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: - name: Configure shell: bash -l {0} run: | - # Convert Windows path to CMake-friendly path + # Use Conda prefix for Windows CONDA_PREFIX_UNIX=$(cygpath -m "$CONDA_PREFIX") cmake -S . -B objdir \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 88336c186..f8975ce6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,15 +242,26 @@ if(MSVC) endif() function(cvise_fix_dia_sdk target) + message(STATUS "Running cvise_fix_dia_sdk for ${target}") if(MSVC AND DIA_SDK_FOUND) # Check if we need to link against diaguids.lib explicitly if(DIAGUIDS_LIB_NATIVE) + message(STATUS "Linking target ${target} against ${DIAGUIDS_LIB_NATIVE}") target_link_libraries(${target} "${DIAGUIDS_LIB_NATIVE}") endif() # Also inspect imported targets in CLANG_LIBS to fix transitive dependencies - # This is where "\DIA SDK" likely comes from - foreach(lib ${CLANG_LIBS}) + # This is where "\DIA SDK" likely comes from. + # We must check LLVMSupport explicitly as it's the most common source of this dependency. + set(TARGETS_TO_CHECK ${CLANG_LIBS}) + if(TARGET LLVMSupport) + list(APPEND TARGETS_TO_CHECK LLVMSupport) + endif() + if(TARGET LLVMDebugInfoPDB) + list(APPEND TARGETS_TO_CHECK LLVMDebugInfoPDB) + endif() + + foreach(lib ${TARGETS_TO_CHECK}) if(TARGET ${lib}) get_target_property(IFACE_LIBS ${lib} INTERFACE_LINK_LIBRARIES) if(IFACE_LIBS) From b5153135b5cfe4cebba55e027bcaffd03b07c0a6 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 17:19:47 +0100 Subject: [PATCH 18/37] dbg --- CMakeLists.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8975ce6f..7fb1fbfaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,13 +265,21 @@ function(cvise_fix_dia_sdk target) if(TARGET ${lib}) get_target_property(IFACE_LIBS ${lib} INTERFACE_LINK_LIBRARIES) if(IFACE_LIBS) - string(FIND "${IFACE_LIBS}" "DIA SDK" HAS_DIA) - if(HAS_DIA GREATER -1) - message(STATUS "Found DIA SDK in dependency ${lib}: ${IFACE_LIBS}") - string(REPLACE "\\DIA SDK" "${DIA_SDK_ROOT}" FIXED_IFACE "${IFACE_LIBS}") - string(REPLACE "/DIA SDK" "${DIA_SDK_ROOT}" FIXED_IFACE "${FIXED_IFACE}") - set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${FIXED_IFACE}") - message(STATUS "Fixed DIA SDK in dependency ${lib}") + set(NEW_LIBS "") + set(CHANGED FALSE) + foreach(dep ${IFACE_LIBS}) + string(FIND "${dep}" "DIA SDK" HAS_DIA) + if(HAS_DIA GREATER -1) + message(STATUS "Found bad DIA SDK dependency in ${lib}: ${dep} -> Removing it.") + set(CHANGED TRUE) + continue() + endif() + list(APPEND NEW_LIBS "${dep}") + endforeach() + + if(CHANGED) + set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${NEW_LIBS}") + message(STATUS "Cleaned DIA SDK from ${lib}. New libs: ${NEW_LIBS}") endif() endif() endif() From 65035f8b6dd26a71766a1b08d870358525568664 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 17:44:42 +0100 Subject: [PATCH 19/37] dbg --- .github/workflows/build.yml | 30 +++-------- CMakeLists.txt | 82 ------------------------------ clang_delta/CMakeLists.txt | 1 - clang_include_graph/CMakeLists.txt | 1 - 4 files changed, 8 insertions(+), 106 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 211a78b20..a9a3d0049 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,36 +82,22 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v3 + - uses: actions/setup-python@v6 with: - auto-update-conda: true python-version: '3.12' - activate-environment: cvise-env - name: Install dependencies - shell: bash -l {0} run: | - conda install -y -c conda-forge llvmdev clangdev winflexbison \ - chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + choco install unifdef + pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard + vcpkg install llvm:x64-windows clang:x64-windows winflexbison:x64-windows - name: Configure - shell: bash -l {0} run: | - # Use Conda prefix for Windows - CONDA_PREFIX_UNIX=$(cygpath -m "$CONDA_PREFIX") - cmake -S . -B objdir \ - -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" \ - -DLLVM_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/llvm" \ - -DClang_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/clang" \ - -DFLEX_EXECUTABLE="$CONDA_PREFIX_UNIX/Library/bin/win_flex.exe" \ - -DPython3_EXECUTABLE="$CONDA_PREFIX_UNIX/python.exe" + cmake -S . -B objdir -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows - name: Build - shell: bash -l {0} - run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS + run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS - name: Test - shell: bash -l {0} - run: | - cd objdir - pytest + working-directory: objdir + run: pytest CI-python: runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fb1fbfaa..8e768c8f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,88 +207,6 @@ endif() ############################################################################### -# On Windows, LLVM might depend on DIA SDK. If it's not found correctly, we fix it. -if(MSVC) - set(DIA_SDK_ROOT "$ENV{VSINSTALLDIR}DIA SDK") - if(NOT EXISTS "${DIA_SDK_ROOT}") - foreach(vs_path "C:/Program Files/Microsoft Visual Studio/2022/Enterprise" - "C:/Program Files/Microsoft Visual Studio/2022/Community" - "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise" - "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community") - if(EXISTS "${vs_path}/DIA SDK") - set(DIA_SDK_ROOT "${vs_path}/DIA SDK") - break() - endif() - endforeach() - endif() - - if(EXISTS "${DIA_SDK_ROOT}") - message(STATUS "Found DIA SDK at ${DIA_SDK_ROOT}") - set(DIA_SDK_FOUND TRUE) - # Ensure CMake-style paths - file(TO_CMAKE_PATH "${DIA_SDK_ROOT}" DIA_SDK_ROOT) - - find_file(DIAGUIDS_LIB diaguids.lib PATHS "${DIA_SDK_ROOT}/lib/amd64" NO_DEFAULT_PATH) - if(DIAGUIDS_LIB) - message(STATUS "Found diaguids.lib at ${DIAGUIDS_LIB}") - # Convert to native path to avoid MSBuild issues with forward slashes/spaces - file(TO_NATIVE_PATH "${DIAGUIDS_LIB}" DIAGUIDS_LIB_NATIVE) - else() - message(WARNING "Could not find diaguids.lib in ${DIA_SDK_ROOT}/lib/amd64") - endif() - else() - message(WARNING "DIA SDK not found at ${DIA_SDK_ROOT} or in standard locations.") - endif() -endif() - -function(cvise_fix_dia_sdk target) - message(STATUS "Running cvise_fix_dia_sdk for ${target}") - if(MSVC AND DIA_SDK_FOUND) - # Check if we need to link against diaguids.lib explicitly - if(DIAGUIDS_LIB_NATIVE) - message(STATUS "Linking target ${target} against ${DIAGUIDS_LIB_NATIVE}") - target_link_libraries(${target} "${DIAGUIDS_LIB_NATIVE}") - endif() - - # Also inspect imported targets in CLANG_LIBS to fix transitive dependencies - # This is where "\DIA SDK" likely comes from. - # We must check LLVMSupport explicitly as it's the most common source of this dependency. - set(TARGETS_TO_CHECK ${CLANG_LIBS}) - if(TARGET LLVMSupport) - list(APPEND TARGETS_TO_CHECK LLVMSupport) - endif() - if(TARGET LLVMDebugInfoPDB) - list(APPEND TARGETS_TO_CHECK LLVMDebugInfoPDB) - endif() - - foreach(lib ${TARGETS_TO_CHECK}) - if(TARGET ${lib}) - get_target_property(IFACE_LIBS ${lib} INTERFACE_LINK_LIBRARIES) - if(IFACE_LIBS) - set(NEW_LIBS "") - set(CHANGED FALSE) - foreach(dep ${IFACE_LIBS}) - string(FIND "${dep}" "DIA SDK" HAS_DIA) - if(HAS_DIA GREATER -1) - message(STATUS "Found bad DIA SDK dependency in ${lib}: ${dep} -> Removing it.") - set(CHANGED TRUE) - continue() - endif() - list(APPEND NEW_LIBS "${dep}") - endforeach() - - if(CHANGED) - set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${NEW_LIBS}") - message(STATUS "Cleaned DIA SDK from ${lib}. New libs: ${NEW_LIBS}") - endif() - endif() - endif() - endforeach() - endif() -endfunction() - -############################################################################### - # Enable tests enable_testing() add_test(NAME all COMMAND ${Python3_EXECUTABLE} -m pytest) diff --git a/clang_delta/CMakeLists.txt b/clang_delta/CMakeLists.txt index 79f780841..352d39f11 100644 --- a/clang_delta/CMakeLists.txt +++ b/clang_delta/CMakeLists.txt @@ -668,7 +668,6 @@ add_executable(clang_delta # ENE: See comment above about why LLVM_LIBS is not included in this call. target_link_libraries(clang_delta ${CLANG_LIBS}) -cvise_fix_dia_sdk(clang_delta) # For cases in which the LLVM libraries are shared libraries, remember where # the shared libraries are. diff --git a/clang_include_graph/CMakeLists.txt b/clang_include_graph/CMakeLists.txt index e4e86bde4..92d6134c0 100644 --- a/clang_include_graph/CMakeLists.txt +++ b/clang_include_graph/CMakeLists.txt @@ -29,7 +29,6 @@ else() ) endif() target_link_libraries(clang_include_graph ${CLANG_LIBS}) -cvise_fix_dia_sdk(clang_include_graph) install(TARGETS clang_include_graph DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/${cvise_PACKAGE}/" From 07675bcc959b0f1d35c812f539819df77321c4f6 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 17:47:07 +0100 Subject: [PATCH 20/37] dbg --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9a3d0049..a52f78adc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,7 +89,7 @@ jobs: run: | choco install unifdef pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - vcpkg install llvm:x64-windows clang:x64-windows winflexbison:x64-windows + vcpkg install llvm:x64-windows winflexbison:x64-windows - name: Configure run: | cmake -S . -B objdir -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows From e31d6b331e1837517a389ecf1ce669a2a256440a Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 17:51:24 +0100 Subject: [PATCH 21/37] dbg --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a52f78adc..0aba340b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,11 +85,16 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3.12' + - name: Search for packages + run: | + vcpkg search flex + vcpkg search llvm + choco search unifdef --limit-output - name: Install dependencies run: | - choco install unifdef + choco install winflexbison3 pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - vcpkg install llvm:x64-windows winflexbison:x64-windows + vcpkg install llvm:x64-windows win-flex-bison:x64-windows - name: Configure run: | cmake -S . -B objdir -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows From 27e81e2544acd80b15fcdc81254c8680fb78b726 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 17:53:34 +0100 Subject: [PATCH 22/37] dbg --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0aba340b9..c15bd3ebe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,14 +87,13 @@ jobs: python-version: '3.12' - name: Search for packages run: | - vcpkg search flex - vcpkg search llvm + vcpkg search clang choco search unifdef --limit-output - name: Install dependencies run: | choco install winflexbison3 pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - vcpkg install llvm:x64-windows win-flex-bison:x64-windows + vcpkg install llvm[tools]:x64-windows - name: Configure run: | cmake -S . -B objdir -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows From a5f752aeb495767b9906d1392b5950f14682648e Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 19:27:20 +0100 Subject: [PATCH 23/37] dbg --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c15bd3ebe..8ddab2118 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,26 +82,45 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v6 + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v3 with: + auto-update-conda: true python-version: '3.12' - - name: Search for packages + activate-environment: cvise-env + - name: Create DIA SDK junction + shell: cmd run: | - vcpkg search clang - choco search unifdef --limit-output + if exist "C:\DIA SDK" rmdir "C:\DIA SDK" + for /d %%i in ("C:\Program Files\Microsoft Visual Studio\2022\Enterprise", "C:\Program Files\Microsoft Visual Studio\2022\Community", "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise", "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community") do ( + if exist "%%~i\DIA SDK" ( + mklink /J "C:\DIA SDK" "%%~i\DIA SDK" + break + ) + ) - name: Install dependencies + shell: bash -l {0} run: | - choco install winflexbison3 - pip install chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - vcpkg install llvm[tools]:x64-windows + conda install -y -c conda-forge llvmdev clangdev winflexbison \ + chardet jsonschema msgspec pebble psutil pytest pytest-mock pytest-subprocess zstandard - name: Configure + shell: bash -l {0} run: | - cmake -S . -B objdir -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows + CONDA_PREFIX_UNIX=$(cygpath -m "$CONDA_PREFIX") + cmake -S . -B objdir \ + -DCMAKE_PREFIX_PATH="$CONDA_PREFIX_UNIX/Library" \ + -DLLVM_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/llvm" \ + -DClang_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/clang" \ + -DFLEX_EXECUTABLE="$CONDA_PREFIX_UNIX/Library/bin/win_flex.exe" \ + -DPython3_EXECUTABLE="$CONDA_PREFIX_UNIX/python.exe" - name: Build - run: cmake --build objdir --config Release --parallel $env:NUMBER_OF_PROCESSORS + shell: bash -l {0} + run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS - name: Test - working-directory: objdir - run: pytest + shell: bash -l {0} + run: | + cd objdir + pytest CI-python: runs-on: ubuntu-latest From b5d840339c44232c16d3067db93aec7fc0481442 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 19:53:59 +0100 Subject: [PATCH 24/37] dbg --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ddab2118..e697add91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,10 +91,15 @@ jobs: - name: Create DIA SDK junction shell: cmd run: | - if exist "C:\DIA SDK" rmdir "C:\DIA SDK" + set "CURR_DRIVE=%CD:~0,2%" for /d %%i in ("C:\Program Files\Microsoft Visual Studio\2022\Enterprise", "C:\Program Files\Microsoft Visual Studio\2022\Community", "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise", "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community") do ( if exist "%%~i\DIA SDK" ( + if exist "C:\DIA SDK" rmdir "C:\DIA SDK" mklink /J "C:\DIA SDK" "%%~i\DIA SDK" + if /i NOT "!CURR_DRIVE!"=="C:" ( + if exist "!CURR_DRIVE!\DIA SDK" rmdir "!CURR_DRIVE!\DIA SDK" + mklink /J "!CURR_DRIVE!\DIA SDK" "%%~i\DIA SDK" + ) break ) ) From 79f1b85c434634427c7327b2df91ca6480c5dfe6 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 19:59:09 +0100 Subject: [PATCH 25/37] dbg --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e697add91..ef7d3cc72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,7 @@ jobs: - name: Create DIA SDK junction shell: cmd run: | + setlocal enabledelayedexpansion set "CURR_DRIVE=%CD:~0,2%" for /d %%i in ("C:\Program Files\Microsoft Visual Studio\2022\Enterprise", "C:\Program Files\Microsoft Visual Studio\2022\Community", "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise", "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community") do ( if exist "%%~i\DIA SDK" ( @@ -100,9 +101,10 @@ jobs: if exist "!CURR_DRIVE!\DIA SDK" rmdir "!CURR_DRIVE!\DIA SDK" mklink /J "!CURR_DRIVE!\DIA SDK" "%%~i\DIA SDK" ) - break + goto :done ) ) + :done - name: Install dependencies shell: bash -l {0} run: | From 773e467d8818ee65e318af28691ececd63022ecb Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 20:18:00 +0100 Subject: [PATCH 26/37] dbg --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef7d3cc72..e96b593b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,8 @@ jobs: -DLLVM_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/llvm" \ -DClang_DIR="$CONDA_PREFIX_UNIX/Library/lib/cmake/clang" \ -DFLEX_EXECUTABLE="$CONDA_PREFIX_UNIX/Library/bin/win_flex.exe" \ - -DPython3_EXECUTABLE="$CONDA_PREFIX_UNIX/python.exe" + -DPython3_EXECUTABLE="$CONDA_PREFIX_UNIX/python.exe" \ + -DCLANG_FORMAT_PATH="$CONDA_PREFIX_UNIX/Library/bin/clang-format.exe" - name: Build shell: bash -l {0} run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS From 9b5b29e0412dbcb10509205ca3ede026727db7d1 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 20:23:49 +0100 Subject: [PATCH 27/37] dbg --- tree-sitter-cpp/CMakeLists.txt | 14 ++++++++------ tree-sitter/CMakeLists.txt | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tree-sitter-cpp/CMakeLists.txt b/tree-sitter-cpp/CMakeLists.txt index 7b655fe8f..045bf4b34 100644 --- a/tree-sitter-cpp/CMakeLists.txt +++ b/tree-sitter-cpp/CMakeLists.txt @@ -17,12 +17,14 @@ endif() find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") -add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json" - COMMAND "${TREE_SITTER_CLI}" generate src/grammar.json - --abi=${TREE_SITTER_ABI_VERSION} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Generating parser.c") +if(TREE_SITTER_CLI) + add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json" + COMMAND "${TREE_SITTER_CLI}" generate src/grammar.json + --abi=${TREE_SITTER_ABI_VERSION} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating parser.c") +endif() add_library(tree-sitter-cpp src/parser.c) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) diff --git a/tree-sitter/CMakeLists.txt b/tree-sitter/CMakeLists.txt index f6c5bf58d..466b7aa80 100644 --- a/tree-sitter/CMakeLists.txt +++ b/tree-sitter/CMakeLists.txt @@ -9,4 +9,6 @@ target_include_directories(tree-sitter PRIVATE lib/src PUBLIC lib/include ) -target_compile_options(tree-sitter PRIVATE -std=gnu99) +if(NOT MSVC) + target_compile_options(tree-sitter PRIVATE -std=gnu99) +endif() From 654e94eff75c3a444bed94971c623c66ac127291 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Sun, 15 Feb 2026 20:51:35 +0100 Subject: [PATCH 28/37] dbg --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e768c8f0..c81fa7b21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,14 +221,14 @@ add_subdirectory(clang_include_graph) add_subdirectory(clex) add_subdirectory(cvise) add_subdirectory(delta) -add_subdirectory(treesitter_delta) +# add_subdirectory(treesitter_delta) # Always link statically against Tree-sitter. -set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}") -set(BUILD_SHARED_LIBS OFF) -add_subdirectory(tree-sitter EXCLUDE_FROM_ALL) -add_subdirectory(tree-sitter-cpp EXCLUDE_FROM_ALL) -set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}") +# set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}") +# set(BUILD_SHARED_LIBS OFF) +# add_subdirectory(tree-sitter EXCLUDE_FROM_ALL) +# add_subdirectory(tree-sitter-cpp EXCLUDE_FROM_ALL) +# set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}") # Copy top-level cvise script configure_file( From b247d13a24c2f0e15fde1fb3aa27d3e3f7a06555 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 00:10:22 +0100 Subject: [PATCH 29/37] dbg --- clang_delta/tests/test_clang_delta.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clang_delta/tests/test_clang_delta.py b/clang_delta/tests/test_clang_delta.py index 89bf696a2..4c3bedf3e 100644 --- a/clang_delta/tests/test_clang_delta.py +++ b/clang_delta/tests/test_clang_delta.py @@ -20,6 +20,8 @@ def get_clang_version(): current = os.path.dirname(__file__) binary = os.path.join(current, '../clang_delta') + if os.name == 'nt': + binary += '.exe' output = subprocess.check_output(f'{binary} --version', shell=True, text=True) for line in output.splitlines(): m = re.match(r'clang version (?P[0-9]+)\.', line) @@ -30,7 +32,10 @@ def get_clang_version(): def get_clang_delta_path() -> Path: - return Path(__file__).parent.parent / 'clang_delta' + p = Path(__file__).parent.parent / 'clang_delta' + if os.name == 'nt': + return p.with_suffix('.exe') + return p def get_testcase_path(testcase: str) -> Path: @@ -79,6 +84,8 @@ def check_clang_delta_hints( def check_query_instances(cls, testcase, arguments, expected): current = os.path.dirname(__file__) binary = os.path.join(current, '../clang_delta') + if os.name == 'nt': + binary += '.exe' cmd = f'{binary} {os.path.join(current, testcase)} {arguments}' output = subprocess.check_output(cmd, shell=True, encoding='utf8') assert output.strip() == expected @@ -87,6 +94,8 @@ def check_query_instances(cls, testcase, arguments, expected): def check_error_message(cls, testcase, arguments, error_message): current = os.path.dirname(__file__) binary = os.path.join(current, '../clang_delta') + if os.name == 'nt': + binary += '.exe' cmd = f'{binary} {os.path.join(current, testcase)} {arguments}' proc = subprocess.run(cmd, shell=True, encoding='utf8', stdout=subprocess.PIPE) assert proc.returncode == 255 From 84787fb2fee13ab9c7b371d0c34043481ab2a28f Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 00:43:03 +0100 Subject: [PATCH 30/37] dbg --- clang_delta/CMakeLists.txt | 2 +- clang_delta/tests/test_clang_delta.py | 30 +++++++++++++-------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/clang_delta/CMakeLists.txt b/clang_delta/CMakeLists.txt index 352d39f11..676b32238 100644 --- a/clang_delta/CMakeLists.txt +++ b/clang_delta/CMakeLists.txt @@ -24,7 +24,7 @@ function(configure_one_file path) configure_file( "${clang_delta_SOURCE_DIR}/${path}" "${clang_delta_BINARY_DIR}/${path}" - COPYONLY + @ONLY ) endfunction(configure_one_file) diff --git a/clang_delta/tests/test_clang_delta.py b/clang_delta/tests/test_clang_delta.py index 4c3bedf3e..97d0facd7 100644 --- a/clang_delta/tests/test_clang_delta.py +++ b/clang_delta/tests/test_clang_delta.py @@ -18,11 +18,8 @@ def get_clang_version(): - current = os.path.dirname(__file__) - binary = os.path.join(current, '../clang_delta') - if os.name == 'nt': - binary += '.exe' - output = subprocess.check_output(f'{binary} --version', shell=True, text=True) + binary = get_clang_delta_path() + output = subprocess.check_output(f'"{binary}" --version', shell=True, text=True) for line in output.splitlines(): m = re.match(r'clang version (?P[0-9]+)\.', line) if m: @@ -32,9 +29,14 @@ def get_clang_version(): def get_clang_delta_path() -> Path: - p = Path(__file__).parent.parent / 'clang_delta' - if os.name == 'nt': - return p.with_suffix('.exe') + current = Path(__file__).parent.parent.resolve() + binary_name = 'clang_delta' + '@CMAKE_EXECUTABLE_SUFFIX@' + p = current / binary_name + if not p.exists(): + for cfg in ['Release', 'Debug', 'RelWithDebInfo', 'MinSizeRel']: + p_cfg = current / cfg / binary_name + if p_cfg.exists(): + return p_cfg return p @@ -83,20 +85,16 @@ def check_clang_delta_hints( @classmethod def check_query_instances(cls, testcase, arguments, expected): current = os.path.dirname(__file__) - binary = os.path.join(current, '../clang_delta') - if os.name == 'nt': - binary += '.exe' - cmd = f'{binary} {os.path.join(current, testcase)} {arguments}' + binary = get_clang_delta_path() + cmd = f'"{binary}" {os.path.join(current, testcase)} {arguments}' output = subprocess.check_output(cmd, shell=True, encoding='utf8') assert output.strip() == expected @classmethod def check_error_message(cls, testcase, arguments, error_message): current = os.path.dirname(__file__) - binary = os.path.join(current, '../clang_delta') - if os.name == 'nt': - binary += '.exe' - cmd = f'{binary} {os.path.join(current, testcase)} {arguments}' + binary = get_clang_delta_path() + cmd = f'"{binary}" {os.path.join(current, testcase)} {arguments}' proc = subprocess.run(cmd, shell=True, encoding='utf8', stdout=subprocess.PIPE) assert proc.returncode == 255 assert proc.stdout.strip() == error_message From 25d4c7e9efe484999be949ce274973d03c8bf654 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 01:10:53 +0100 Subject: [PATCH 31/37] dbg --- conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index cc3bee9b3..a025cc228 100644 --- a/conftest.py +++ b/conftest.py @@ -2,6 +2,8 @@ import multiprocessing +import platform + import pytest @@ -12,4 +14,5 @@ def mp_start_method(): The "forkserver" mode is the same as the one used by the C-Vise CLI. """ # Enforce the method selection, in case the test framework previously set a different one. - multiprocessing.set_start_method('forkserver', force=True) + method = 'spawn' if platform.system() == 'Windows' else 'forkserver' + multiprocessing.set_start_method(method, force=True) From 91989142bfb01314b7cfd82f42b0083de64e162f Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 01:45:58 +0100 Subject: [PATCH 32/37] dbg --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e96b593b5..a354cb288 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,7 +128,7 @@ jobs: shell: bash -l {0} run: | cd objdir - pytest + pytest -x -s CI-python: runs-on: ubuntu-latest From c1b79bd47b70f0fb9a472f0b7bc40278bdb3db4f Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 02:05:28 +0100 Subject: [PATCH 33/37] dbg --- clang_delta/tests/test_clang_delta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_delta/tests/test_clang_delta.py b/clang_delta/tests/test_clang_delta.py index 97d0facd7..1ef822d80 100644 --- a/clang_delta/tests/test_clang_delta.py +++ b/clang_delta/tests/test_clang_delta.py @@ -1333,9 +1333,9 @@ def test_union_to_struct_union3(self): def test_piggypacking(self): current = os.path.dirname(__file__) - binary = os.path.join(current, '../clang_delta') + binary = get_clang_delta_path() args = '--transformation=remove-unused-function --counter=111 --to-counter=222 --warn-on-counter-out-of-bounds --report-instances-count' - cmd = '{} {} {}'.format(binary, os.path.join(current, 'remove-unused-function/macro2.cc'), args) + cmd = f'"{binary}" {os.path.join(current, "remove-unused-function/macro2.cc")} {args}' run = subprocess.run(cmd, shell=True, encoding='utf8', capture_output=True) assert 'Available transformation instances: 1' in run.stderr assert 'Warning: number of transformation instances exceeded' in run.stderr From 941796bc47c87f9b2a93801b9cb6ff0673b9df4b Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 02:27:40 +0100 Subject: [PATCH 34/37] dbg --- clang_delta/tests/test_clang_delta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_delta/tests/test_clang_delta.py b/clang_delta/tests/test_clang_delta.py index 1ef822d80..c92e06778 100644 --- a/clang_delta/tests/test_clang_delta.py +++ b/clang_delta/tests/test_clang_delta.py @@ -96,7 +96,7 @@ def check_error_message(cls, testcase, arguments, error_message): binary = get_clang_delta_path() cmd = f'"{binary}" {os.path.join(current, testcase)} {arguments}' proc = subprocess.run(cmd, shell=True, encoding='utf8', stdout=subprocess.PIPE) - assert proc.returncode == 255 + assert proc.returncode in (255, 4294967295) assert proc.stdout.strip() == error_message def test_aggregate_to_scalar_cast(self): From 593322cabcc7e56ee7103657077450f6327b98d8 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 02:54:25 +0100 Subject: [PATCH 35/37] dbg --- cvise/tests/test_balanced.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cvise/tests/test_balanced.py b/cvise/tests/test_balanced.py index 6548ad8bb..09f466cea 100644 --- a/cvise/tests/test_balanced.py +++ b/cvise/tests/test_balanced.py @@ -78,7 +78,14 @@ def test_parens_dir(self): state = self._pass_new() all_transforms = collect_all_transforms_dir(self.pass_, state, self.input_path) - self.assertIn((('a.txt', b'This is a test!\n'), ('b.txt', b'This \n')), all_transforms) + # Normalize line endings for Windows compatibility + normalized_transforms = set() + for t in all_transforms: + normalized_transforms.add( + tuple((name, content.replace(b'\r\n', b'\n')) for name, content in t) + ) + + self.assertIn((('a.txt', b'This is a test!\n'), ('b.txt', b'This \n')), normalized_transforms) class BalancedParensOnlyTestCase(unittest.TestCase): From b0cf7fa1206b4171b023809831846e76651c873a Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 10:44:16 +0100 Subject: [PATCH 36/37] dbg --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a354cb288..7ed94ea79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,7 @@ jobs: -DCLANG_FORMAT_PATH="$CONDA_PREFIX_UNIX/Library/bin/clang-format.exe" - name: Build shell: bash -l {0} - run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS + run: cmake --build objdir --config Release - name: Test shell: bash -l {0} run: | From 823cbc335bd81c1de84f2b26229019d11656138a Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Feb 2026 13:04:12 +0100 Subject: [PATCH 37/37] dbg --- .github/workflows/build.yml | 2 +- clex/CMakeLists.txt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ed94ea79..a354cb288 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,7 @@ jobs: -DCLANG_FORMAT_PATH="$CONDA_PREFIX_UNIX/Library/bin/clang-format.exe" - name: Build shell: bash -l {0} - run: cmake --build objdir --config Release + run: cmake --build objdir --config Release --parallel $NUMBER_OF_PROCESSORS - name: Test shell: bash -l {0} run: | diff --git a/clex/CMakeLists.txt b/clex/CMakeLists.txt index da4a029ae..8b19aeae2 100644 --- a/clex/CMakeLists.txt +++ b/clex/CMakeLists.txt @@ -66,6 +66,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" set_source_files_properties(clex.c PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-sign-compare") set_source_files_properties(strlex.c PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-sign-compare") endif() + +# Serialize flex execution to avoid potential race conditions with temporary files +add_custom_command(OUTPUT ${FLEX_strlex_scanner_OUTPUTS} + APPEND + DEPENDS ${FLEX_clex_scanner_OUTPUTS} +) + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set_source_files_properties(clex.c PROPERTIES COMPILE_FLAGS -DYY_NO_UNISTD_H) set_source_files_properties(strlex.c PROPERTIES COMPILE_FLAGS -DYY_NO_UNISTD_H)