Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
8 changes: 7 additions & 1 deletion extension_config.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# 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}
LOAD_TESTS
)

# Any extra extensions that should be built
# e.g.: duckdb_extension_load(json)
# e.g.: duckdb_extension_load(json)
27 changes: 27 additions & 0 deletions scripts/patch_bundled_fmt.cmake
Original file line number Diff line number Diff line change
@@ -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()