From b39bd4a633fa3c7f45fd493aa36c34fb1695f795 Mon Sep 17 00:00:00 2001 From: Nils Schimmelmann Date: Tue, 21 Apr 2026 11:41:13 -0500 Subject: [PATCH 1/4] add Windows Clang target (win64_llvm_mingw) to CI (#218) - Enable windows-2022 clang target in build-test matrix. - Implement robust recursive discovery of LLVM-MinGW toolchain under C:\Qt. - Set CC and CXX to absolute paths of clang/clang++ executables. - Enable ASAN and UBSAN for Windows Debug builds when using Clang. - Ensure sanitizers remain disabled for Windows GCC to avoid regressions. - Standardize PowerShell exit codes to 1 for failures. * ci: add windows clang target and enable address sanitizer - Enable windows-2022 clang target in build-test matrix. - Implement robust recursive discovery of LLVM-MinGW toolchain under C:\Qt. - Set CC and CXX to absolute paths of clang/clang++ executables. - Enable ASAN and UBSAN for Windows Debug builds when using Clang. - Exclude --compiler-runtime from windeployqt for Clang on Windows. - Ensure sanitizers remain disabled for Windows GCC to avoid regressions. --- .github/workflows/build-test.yml | 27 ++++++++++++++++++++++++--- CMakeLists.txt | 16 +++++++--------- src/CMakeLists.txt | 5 ++++- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0abfd9220..b51591ad3 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -30,8 +30,6 @@ jobs: compiler: 'gcc' - os: macos-latest compiler: 'msvc' - - os: windows-2022 - compiler: 'clang' steps: - uses: actions/checkout@v6 with: @@ -119,6 +117,16 @@ jobs: cache: true modules: 'qtwebsockets qtmultimedia' tools: 'tools_mingw1310' + - if: runner.os == 'Windows' && matrix.compiler == 'clang' + name: Install Qt for Windows (LLVM-MinGW) + uses: jurplel/install-qt-action@v4 + with: + version: '6.8.3' + dir: 'C:\' + arch: win64_llvm_mingw + cache: true + modules: 'qtwebsockets qtmultimedia' + tools: 'tools_llvm_mingw1706' # # Build @@ -135,9 +143,22 @@ jobs: echo "C:/Qt/Tools/mingw1310_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append $env:PATH = "C:\Qt\Tools\mingw1310_64\bin;$env:PATH" } + if ('${{ matrix.compiler }}' -eq 'clang') { + $llvmDir = Get-ChildItem -Path "C:\Qt\Tools" -Filter "llvm-mingw*" -Directory | Sort-Object Name -Descending | Select-Object -First 1 + if ($null -ne $llvmDir) { + $llvmBin = Join-Path $llvmDir.FullName "bin" + echo "$($llvmBin.Replace('\', '/'))" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $env:PATH = "$llvmBin;$env:PATH" + $env:CC = Join-Path $llvmBin "clang.exe" + $env:CXX = Join-Path $llvmBin "clang++.exe" + } else { + Write-Error "LLVM-MinGW toolchain not found" + exit 1 + } + } $packageDir = ($env:GITHUB_WORKSPACE -replace '\\', '/') + "/artifact" $launcher = ${{ matrix.compiler == 'msvc' && 'sccache' || 'ccache' }} - cmake -DCMAKE_BUILD_TYPE=Debug -G 'Ninja' -DWITH_MAP=OFF -DCPACK_PACKAGE_DIRECTORY="$packageDir" -DCMAKE_PREFIX_PATH=$env:QT_ROOT_DIR -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DPACKAGE_TYPE=Nsis -DCMAKE_C_COMPILER_LAUNCHER="$launcher" -DCMAKE_CXX_COMPILER_LAUNCHER="$launcher" -S .. || exit -1 + cmake -DCMAKE_BUILD_TYPE=Debug -G 'Ninja' -DWITH_MAP=OFF -DCPACK_PACKAGE_DIRECTORY="$packageDir" -DCMAKE_PREFIX_PATH=$env:QT_ROOT_DIR -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DPACKAGE_TYPE=Nsis -DCMAKE_C_COMPILER_LAUNCHER="$launcher" -DCMAKE_CXX_COMPILER_LAUNCHER="$launcher" -S .. || exit 1 cmake --build . --parallel - if: runner.os == 'Linux' || runner.os == 'macOS' name: Build MMapper for Linux and Mac diff --git a/CMakeLists.txt b/CMakeLists.txt index c8918b798..719f3a1ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,7 +331,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) add_compile_options(-fsanitize=address) add_link_options(-fsanitize=address) - message(STATUS "Building with GCC undefined behavior sanitizer") + message(STATUS "Building with GCC undefined behavior sanitizer") add_compile_options(-fsanitize=undefined) add_link_options(-fsanitize=undefined) endif() @@ -397,14 +397,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() if(MMAPPER_IS_DEBUG) - if(NOT WIN32) - # segfaults in ASAN initializer on 32-bit Ubuntu 18.04.1 with clang 6.0 - # note: apparently -fsanitize=address can't be used with gnu libc 2.25+ - # Ubuntu 18.04.1 has libc 2.27. - message(STATUS "Building with Clang address sanitizer") - add_compile_options(-fsanitize=address) - add_link_options(-fsanitize=address) - endif() + # segfaults in ASAN initializer on 32-bit Ubuntu 18.04.1 with clang 6.0 + # note: apparently -fsanitize=address can't be used with gnu libc 2.25+ + # Ubuntu 18.04.1 has libc 2.27. + message(STATUS "Building with Clang address sanitizer") + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) if(TRUE) message(STATUS "Building with Clang undefined behavior sanitizer") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d2dfbf8a..efc40e91a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1147,7 +1147,10 @@ if(WIN32) endif() # Bundle Library Files - set(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} --compiler-runtime --no-translations --no-system-d3d-compiler --no-opengl-sw --verbose 1) + set(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} --no-translations --no-system-d3d-compiler --no-opengl-sw --verbose 1) + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} --compiler-runtime) + endif() find_program(WINDEPLOYQT_APP windeployqt HINTS ${QTDIR} ENV QTDIR PATH_SUFFIXES .) message(" - windeployqt path: ${WINDEPLOYQT_APP}") message(" - windeployqt args: ${WINDEPLOYQT_ARGS}") From 8f3ea8a788375d6a3443807d18f4a68b8dee63ce Mon Sep 17 00:00:00 2001 From: Nils Schimmelmann Date: Tue, 21 Apr 2026 11:42:03 -0500 Subject: [PATCH 2/4] enable ASAN for MSVC debug builds (#217) - Added `/fsanitize=address` and `/Oy-`. - Explicitly removed `/RTC1` as it's incompatible with ASAN. - Set `/INCREMENTAL:NO` for the linker. --- CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 719f3a1ea..43bd4115d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -472,6 +472,24 @@ if(MSVC) add_compile_options(/Zc:__cplusplus) add_compile_options(/utf-8) add_compile_options(/permissive-) + + if(MMAPPER_IS_DEBUG) + message(STATUS "Building with MSVC address sanitizer") + add_compile_options(/fsanitize=address) + add_compile_options(/Oy-) # Disable frame-pointer omission + + # ASAN is incompatible with /RTC (Runtime Checks) + # CMake defaults to /RTC1 for Debug builds. We need to remove it. + string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/RTC1" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + + # Linker flags for ASAN + add_link_options(/fsanitize=address) + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO") + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO") + set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO") + endif() + if(CMAKE_BUILD_TYPE_UPPER MATCHES "^RELWITHDEBINFO$") # improve performance string(REPLACE "/Ob1" "/Ob2" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") From 179ac9c85180e4fb669553feacc4ec6fa48d90e5 Mon Sep 17 00:00:00 2001 From: nschimme <5505185+nschimme@users.noreply.github.com> Date: Mon, 4 May 2026 14:25:39 +0000 Subject: [PATCH 3/4] docs: update installation instructions for macOS Sequoia and Microsoft Edge Update docs/macos.md and docs/windows.md with modern instructions for bypassing security blocks. On macOS, the right-click workaround is replaced by the System Settings "Open Anyway" method, which requires an initial failed launch attempt to trigger the setting. On Windows, explicit steps are added for bypassing Microsoft Edge's download block (Keep -> Show more -> Keep anyway), in addition to SmartScreen and manual file unblocking instructions. The instructions maintain the original descriptive style and layout as requested. --- docs/macos.md | 15 +++++++-------- docs/windows.md | 16 +++++++--------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/docs/macos.md b/docs/macos.md index d930dbd86..aba67b4a7 100644 --- a/docs/macos.md +++ b/docs/macos.md @@ -15,17 +15,16 @@ title: Download MMapper for macOS
Important Notice for macOS Users:
- This application is not notarized by Apple, so macOS might prevent it from opening directly.
+ This application is not notarized by Apple, so macOS will prevent it from opening directly.
To run the application the first time:
    -
  1. Locate the downloaded .dmg file and open it.
  2. -
  3. Drag the MMapper application to your Applications folder (or another location).
  4. -
  5. Right-click (or Control-click) the MMapper application icon.
  6. -
  7. Select "Open" from the context menu.
  8. -
  9. A dialog box will appear warning you about the developer. Click "Open" again.
  10. +
  11. Drag the MMapper application to your Applications folder.
  12. +
  13. Try to open MMapper from your Applications folder. When a warning appears, click Done or Cancel (this registers the app with macOS).
  14. +
  15. Go to System Settings > Privacy & Security and scroll down to the Security section.
  16. +
  17. Look for the message "MMapper was blocked..." and click the Open Anyway button.
  18. +
  19. Enter your password if prompted, then click Open on the final dialog box.
- Alternatively, you can go to System Settings > Privacy & Security, scroll down to the "Security" section, and look for an "Open Anyway" button related to MMapper after trying to open it the first time.
- You only need to do this the first time you run this version. + You only need to do this the first time you run a new version of MMapper.
{% include download.md %} diff --git a/docs/windows.md b/docs/windows.md index e5e5ac34e..080fe745f 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -19,17 +19,15 @@ title: Download MMapper for Windows {% endfor %}
- Important Notice for .exe Downloaders:
- This application is not digitally signed, so Windows might prevent it from running initially.
- To run the application: + Important Notice for Windows Users:
+ This application is not digitally signed, which may cause Microsoft Edge or Windows SmartScreen to block it initially.
+ To download and run the application:
    -
  1. Right-click the downloaded .exe file and select "Properties".
  2. -
  3. In the Properties window, look for a section near the bottom that says "Security".
  4. -
  5. If you see a checkbox or button labeled "Unblock", check it or click it.
  6. -
  7. Click "Apply" and then "OK".
  8. -
  9. You should now be able to run the MMapper installer.
  10. +
  11. If Edge blocks the download: Open your download list, click the ... (three dots) next to the file, and select Keep. Then click Show more and select Keep anyway.
  12. +
  13. If SmartScreen blocks the installer: Click More info in the "Windows protected your PC" window, then click Run anyway.
  14. +
  15. If the installer still won't run: Right-click the downloaded .exe file and select Properties. In the General tab, check the Unblock checkbox at the bottom and click OK.
- You only need to do this the first time you run this version. + You only need to do this the first time you run a new version.
{% include download.md %} From 8828661ff63d25a959e1d728ceab58796093aa3e Mon Sep 17 00:00:00 2001 From: nschimme <5505185+nschimme@users.noreply.github.com> Date: Mon, 4 May 2026 14:55:44 +0000 Subject: [PATCH 4/4] docs: update installation instructions for macOS Sequoia and Microsoft Edge Update docs/macos.md and docs/windows.md with modern instructions for bypassing security blocks. On macOS, the right-click workaround is replaced by the System Settings "Open Anyway" method. On Windows, explicit steps are added for bypassing Microsoft Edge's download block and SmartScreen warnings. Note: Previous CI failure in build-snap was a transient network error (Connection failed while fetching libssl3t64) and is unrelated to these documentation changes.