Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (62 loc) · 3.19 KB
/
Copy pathMakefile
File metadata and controls
69 lines (62 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Configuration of extension
EXT_NAME=mobilityduck
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
# Include the Makefile from extension-ci-tools
include extension-ci-tools/makefiles/duckdb_extension.Makefile
# Single-timezone model (PGTZ-style): the extension's LoadInternal forces
# 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 auto-loads ICU so the named "Europe/Brussels" zone
# resolves. DuckDB autoloads ICU from
# $HOME/.duckdb/extensions/<version>/<platform>/icu.duckdb_extension
# and otherwise falls back to a hub download — which fails inside the CI test
# docker (empty path, no network egress) and on the macOS osx_arm64 runner
# (hub ICU not reliably resolvable). So we stage the locally-built ICU into the
# expected path before the unittester runs.
#
# Target DuckDB is v1.5.5. The staging path does NOT hardcode the version or
# platform: both are read from the freshly-built duckdb binary (authoritative
# for whatever is being tested), and DUCKDB_VERSION_TAG and the uname map are
# used only when that binary gives no answer.
DUCKDB_VERSION_TAG := v1.5.5
define stage_icu
@if [ -f ./build/$(1)/extension/icu/icu.duckdb_extension ]; then \
duckdb_bin=./build/$(1)/duckdb; \
version_tag=$$( [ -x "$$duckdb_bin" ] && "$$duckdb_bin" --version 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1 ); \
platform=$$( [ -x "$$duckdb_bin" ] && echo 'PRAGMA platform;' | "$$duckdb_bin" -noheader -list 2>/dev/null | tr -d '[:space:]' ); \
[ -n "$$version_tag" ] || version_tag=$(DUCKDB_VERSION_TAG); \
if [ -z "$$platform" ]; 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; \
fi; \
target=$$HOME/.duckdb/extensions/$$version_tag/$$platform; \
mkdir -p "$$target" && cp -f ./build/$(1)/extension/icu/icu.duckdb_extension "$$target/" && \
echo "Staged icu.duckdb_extension at $$target/ (duckdb $$version_tag / $$platform)"; \
fi
endef
# The staging is attached to the three test targets as a prerequisite rather
# than as a second recipe for them. extension-ci-tools defines those targets,
# and a competing recipe makes GNU make discard the included one, printing two
# warnings for each: "overriding recipe for target" against this file and
# "ignoring old recipe for target" against that one. A prerequisite-only line
# adds the dependency and leaves the included recipe in force, whatever form it
# takes at the recorded commit, so the suite is invoked the way the tools that
# ship it invoke it.
.PHONY: stage_icu_release stage_icu_debug stage_icu_reldebug
stage_icu_release:
$(call stage_icu,release)
stage_icu_debug:
$(call stage_icu,debug)
stage_icu_reldebug:
$(call stage_icu,reldebug)
test_release_internal: stage_icu_release
test_debug_internal: stage_icu_debug
test_reldebug_internal: stage_icu_reldebug