Skip to content
Closed
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
28 changes: 16 additions & 12 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ jobs:
extension_name: mobilityduck
ci_tools_version: v1.4.4
vcpkg_commit: c27eeddba73f608f10605d80bc0144c1166f8fb7
# Windows is excluded because the MEOS vcpkg port does not currently
# build under MSVC or MinGW: it pulls in PostgreSQL-derived sources
# that depend on POSIX-only headers (e.g. <dirent.h>) and GCC-only
# attribute syntax (`__attribute__((unused))`). Re-enable once the
# MEOS port grows Windows support.
exclude_archs: windows_amd64;windows_amd64_mingw;linux_amd64_musl
# Windows / linux_amd64_musl / wasm_* are excluded because the
# MEOS vcpkg port does not currently build there: Windows pulls in
# POSIX-only headers (e.g. <dirent.h>) and GCC-only attribute syntax,
# and the Wasm/emscripten targets fail to compile PostgreSQL's port
# code (`pg_bitutils.h` cannot pick an integer type matching
# `uint64_t` under the emscripten ABI). Re-enable once the MEOS
# port grows targets for those toolchains.
exclude_archs: windows_amd64;windows_amd64_mingw;linux_amd64_musl;wasm_mvp;wasm_eh;wasm_threads

duckdb-latest-deploy:
needs: duckdb-latest-build
Expand All @@ -52,9 +54,11 @@ jobs:
ci_tools_version: v1.4.4
extension_name: mobilityduck
deploy_latest: ${{ startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/main' }}
# Windows is excluded because the MEOS vcpkg port does not currently
# build under MSVC or MinGW: it pulls in PostgreSQL-derived sources
# that depend on POSIX-only headers (e.g. <dirent.h>) and GCC-only
# attribute syntax (`__attribute__((unused))`). Re-enable once the
# MEOS port grows Windows support.
exclude_archs: windows_amd64;windows_amd64_mingw;linux_amd64_musl
# Windows / linux_amd64_musl / wasm_* are excluded because the
# MEOS vcpkg port does not currently build there: Windows pulls in
# POSIX-only headers (e.g. <dirent.h>) and GCC-only attribute syntax,
# and the Wasm/emscripten targets fail to compile PostgreSQL's port
# code (`pg_bitutils.h` cannot pick an integer type matching
# `uint64_t` under the emscripten ABI). Re-enable once the MEOS
# port grows targets for those toolchains.
exclude_archs: windows_amd64;windows_amd64_mingw;linux_amd64_musl;wasm_mvp;wasm_eh;wasm_threads
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ endif()
# MEOS from overlay port
find_package(MEOS CONFIG REQUIRED)

# h3 — transitively needed because `meos_h3.h` includes `<h3api.h>`.
# vcpkg's h3 port installs the header at `include/h3/h3api.h` (under
# a subdirectory). `find_package(h3 CONFIG)` finds the import target
# but its `INTERFACE_INCLUDE_DIRECTORIES` only contains `include/`,
# not `include/h3/`. Probe the header directly with `find_path` and
# add the resolved directory to the global include path so the
# `#include <h3api.h>` in `meos_h3.h` resolves.
find_package(h3 CONFIG)
if(h3_FOUND)
message(STATUS "Found h3 (CONFIG): version ${h3_VERSION}")
endif()
find_path(H3_INCLUDE_DIR NAMES h3api.h PATH_SUFFIXES h3)
if(H3_INCLUDE_DIR)
include_directories(${H3_INCLUDE_DIR})
message(STATUS "Found h3 include dir: ${H3_INCLUDE_DIR}")
else()
message(WARNING "h3api.h not found; the th3index extension surface will fail to compile")
endif()

if(TARGET GEOS::geos_c)
set(GEOS_TGT GEOS::geos_c)
elseif(TARGET GEOS::geos)
Expand Down Expand Up @@ -89,6 +108,7 @@ set(EXTENSION_SOURCES
src/geo/tgeogpoint.cpp
src/geo/tgeogpoint_in_out.cpp
src/geo/tgeogpoint_ops.cpp
src/h3/th3index.cpp
src/index/rtree_module.cpp
src/single_tile_getters.cpp
src/index/rtree_index_create_physical.cpp
Expand All @@ -113,13 +133,18 @@ endif()
# -----------------------------
# Link libraries
# -----------------------------
if(TARGET h3::h3)
set(H3_TGT h3::h3)
endif()

target_link_libraries(${EXTENSION_NAME}
MEOS::meos
${GEOS_TGT}
PROJ::proj
GSL::gsl
GSL::gslcblas
${JSONC_TGT}
${H3_TGT}
OpenSSL::SSL
OpenSSL::Crypto
)
Expand All @@ -131,6 +156,7 @@ target_link_libraries(${LOADABLE_EXTENSION_NAME}
GSL::gsl
GSL::gslcblas
${JSONC_TGT}
${H3_TGT}
OpenSSL::SSL
OpenSSL::Crypto
)
Expand Down
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,39 @@ include extension-ci-tools/makefiles/duckdb_extension.Makefile
# both MEOS (meos_initialize_timezone) and DuckDB (DBConfig::SetOptionByName
# "TimeZone") to Europe/Brussels. Tests pass on any OS timezone — the
# extension is the single source of truth, no TZ env var needed.
#
# LoadInternal also calls ExtensionHelper::AutoLoadExtension(db, "icu") so
# the timezone option is honoured. Autoload looks for the extension on disk
# at $HOME/.duckdb/extensions/<duckdb_version>/<platform>/icu.duckdb_extension
# and falls back to a hub download. That fails both inside the linux_amd64
# test docker container (empty path, no network egress) and on the macOS
# osx_arm64 test runner (hub icu not reliably resolvable). We copy the
# icu.duckdb_extension that was built locally as part of this extension's
# build (declared in extension_config.cmake) into the expected path,
# matched to the DuckDB platform string, before running the unittester.
DUCKDB_VERSION_TAG := v1.4.4

define stage_icu
@if [ -f ./build/$(1)/extension/icu/icu.duckdb_extension ]; then \
case "$$(uname -s)-$$(uname -m)" in \
Linux-x86_64) platform=linux_amd64 ;; \
Linux-aarch64) platform=linux_arm64 ;; \
Darwin-arm64) platform=osx_arm64 ;; \
Darwin-x86_64) platform=osx_amd64 ;; \
*) platform=$$(uname -m) ;; \
esac; \
target=$$HOME/.duckdb/extensions/$(DUCKDB_VERSION_TAG)/$$platform; \
mkdir -p "$$target" && cp -f ./build/$(1)/extension/icu/icu.duckdb_extension "$$target/" && \
echo "Staged icu.duckdb_extension at $$target/"; \
fi
endef

test_release_internal:
$(call stage_icu,release)
./build/release/$(TEST_PATH) "$(PROJ_DIR)test/*"
test_debug_internal:
$(call stage_icu,debug)
./build/debug/$(TEST_PATH) "$(PROJ_DIR)test/*"
test_reldebug_internal:
./build/reldebug/$(TEST_PATH) "$(PROJ_DIR)test/*"
$(call stage_icu,reldebug)
./build/reldebug/$(TEST_PATH) "$(PROJ_DIR)test/*"
Loading
Loading