From cb7b428bbab55fdee89f1268e3fbf1a41e2fa1c4 Mon Sep 17 00:00:00 2001 From: Alok Subbarao Date: Mon, 28 Sep 2026 10:23:45 -0700 Subject: [PATCH 1/3] ci: use extension-ci-tools v1.4.5 so Windows builds with MSVC windows-latest is now windows-2025-vs2026. The v1.4.4 reusable workflow calls only the VS 2022 vcvars64.bat, which is absent there, so the windows_amd64 job built with MinGW gcc from C:\mingw64\bin and the resulting unittest.exe failed to start under Git Bash (Error 127). v1.4.5 (extension-ci-tools #369) falls back to VS 18 and forces CC/CXX=cl. DuckDB stays at v1.4.4; the ci-tools Makefile is identical between the two. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/MainDistributionPipeline.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 9720e43..1ca1192 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -23,8 +23,10 @@ jobs: duckdb-stable-build: name: Build extension binaries - uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.4.4 + # ci-tools v1.4.5 finds VS 2026's vcvars on windows-latest; v1.4.4 only + # knows the VS 2022 path, so windows_amd64 silently built with MinGW gcc. + uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.4.5 with: duckdb_version: v1.4.4 - ci_tools_version: v1.4.4 + ci_tools_version: v1.4.5 extension_name: parser_tools From 850414f110aec30baae4e298d62c01adceb8b6f6 Mon Sep 17 00:00:00 2001 From: Alok Subbarao Date: Mon, 28 Sep 2026 11:13:56 -0700 Subject: [PATCH 2/3] build(windows): force C++17 for real-MSVC builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit duckdb/CMakeLists.txt sets CMAKE_CXX_STANDARD 11 as an unforced cache default. MSVC has no /std:c++11, so under real MSVC (now that the extension-ci-tools bump finds it instead of falling back to MinGW) that resolves to its implicit default dialect, which does not enable C++17 inline variables. Vendored fmt (third_party/fmt/include/fmt/format.h) needs them, so the windows_amd64 build fails: 'inline variables require at least /std:c++17'. -DCMAKE_CXX_STANDARD=17 on the cmake command line wins over duckdb's unforced set(... CACHE ...), and fmt has no per-target override to defeat it (verified: neither third_party/fmt/CMakeLists.txt nor duckdb/CMakeLists.txt sets CXX_STANDARD anywhere else). Scoped to windows_amd64 only via DUCKDB_PLATFORM — windows_amd64_mingw/_rtools build with g++, which already compiles fmt fine under its own default. Co-Authored-By: Claude Sonnet 5 --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d03b95c..019f982 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,17 @@ EXT_NAME=parser_tools EXT_CONFIG=${PROJ_DIR}extension_config.cmake # Include the Makefile from extension-ci-tools -include extension-ci-tools/makefiles/duckdb_extension.Makefile \ No newline at end of file +include extension-ci-tools/makefiles/duckdb_extension.Makefile + +# duckdb/CMakeLists.txt sets CMAKE_CXX_STANDARD 11 as a plain (non-FORCE) cache +# default; MSVC has no /std:c++11, so on real MSVC that resolves to its +# implicit default dialect, which does not enable C++17 inline variables. The +# vendored fmt (third_party/fmt) needs them, so a real-MSVC windows_amd64 +# build fails compiling fmt's format.h ("inline variables require +# /std:c++17"). Passing this on the cmake command line wins over the +# unforced cache set() in duckdb's own CMakeLists.txt. Scoped to plain MSVC: +# windows_amd64_mingw/_rtools build with g++, which already compiles fmt +# fine under GCC's default dialect. +ifeq ($(DUCKDB_PLATFORM),windows_amd64) + BUILD_FLAGS += -DCMAKE_CXX_STANDARD=17 +endif \ No newline at end of file From c6a905241942b1e005eff5c36012402fc80436fd Mon Sep 17 00:00:00 2001 From: Alok Subbarao Date: Fri, 2 Oct 2026 15:47:51 -0700 Subject: [PATCH 3/3] fix(windows): avoid removed fmt iterator on VS2026 Patch DuckDB v1.4.4's bundled fmt during configuration so real MSVC builds use its portable pointer fallback after VS 2026 removed stdext::checked_array_iterator. Co-Authored-By: Codex Luna 5.6 --- extension_config.cmake | 8 +++++++- scripts/patch_bundled_fmt.cmake | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 scripts/patch_bundled_fmt.cmake diff --git a/extension_config.cmake b/extension_config.cmake index 08d8033..0d742ee 100644 --- a/extension_config.cmake +++ b/extension_config.cmake @@ -1,5 +1,11 @@ # This file is included by DuckDB's build system. It specifies which extension to load +# DuckDB v1.4.4's bundled fmt uses stdext::checked_array_iterator when +# _SECURE_SCL is defined. VS 2026 removed that non-standard iterator, so select +# fmt's portable pointer implementation before DuckDB configures third_party. +set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE) +include(${CMAKE_CURRENT_LIST_DIR}/scripts/patch_bundled_fmt.cmake) + # Extension from this repo duckdb_extension_load(parser_tools SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} @@ -7,4 +13,4 @@ duckdb_extension_load(parser_tools ) # Any extra extensions that should be built -# e.g.: duckdb_extension_load(json) \ No newline at end of file +# e.g.: duckdb_extension_load(json) diff --git a/scripts/patch_bundled_fmt.cmake b/scripts/patch_bundled_fmt.cmake new file mode 100644 index 0000000..25e96c2 --- /dev/null +++ b/scripts/patch_bundled_fmt.cmake @@ -0,0 +1,27 @@ +# Work around fmt 6.1.2 using the removed MSVC stdext::checked_array_iterator. +# +# This is intentionally idempotent: configure can be re-run without changing the +# DuckDB submodule after the first successful patch. On non-MSVC compilers the +# guarded branch was already inactive, so selecting the fallback is equivalent. + +set(_parser_tools_fmt_header + "${CMAKE_CURRENT_LIST_DIR}/../duckdb/third_party/fmt/include/fmt/format.h") + +if(NOT EXISTS "${_parser_tools_fmt_header}") + message(FATAL_ERROR "Bundled fmt header not found: ${_parser_tools_fmt_header}") +endif() + +file(READ "${_parser_tools_fmt_header}" _parser_tools_fmt_contents) +string(FIND "${_parser_tools_fmt_contents}" "#ifdef _SECURE_SCL" _parser_tools_guard) + +if(_parser_tools_guard GREATER -1) + string(REPLACE + "#ifdef _SECURE_SCL" + "#if 0 // stdext::checked_array_iterator was removed from newer MSVC" + _parser_tools_fmt_contents + "${_parser_tools_fmt_contents}") + file(WRITE "${_parser_tools_fmt_header}" "${_parser_tools_fmt_contents}") + message(STATUS "Patched bundled fmt to avoid stdext::checked_array_iterator") +else() + message(STATUS "Bundled fmt already uses the portable iterator implementation") +endif()