Skip to content

Commit cf512fe

Browse files
Pre-stage icu extension for amd64 docker tests
LoadInternal calls ExtensionHelper::AutoLoadExtension(db, "icu") so the Europe/Brussels timezone option is honoured. Inside the linux_amd64 test docker container there is no network egress and the local extension directory is empty, so the autoload fails. Copy the icu.duckdb_extension that was just built locally (declared in extension_config.cmake) into the expected path before running the unittester.
1 parent c8cad6d commit cf512fe

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,32 @@ include extension-ci-tools/makefiles/duckdb_extension.Makefile
1111
# both MEOS (meos_initialize_timezone) and DuckDB (DBConfig::SetOptionByName
1212
# "TimeZone") to Europe/Brussels. Tests pass on any OS timezone — the
1313
# extension is the single source of truth, no TZ env var needed.
14+
#
15+
# LoadInternal also calls ExtensionHelper::AutoLoadExtension(db, "icu") so
16+
# the timezone option is honoured. Autoload looks for the extension on disk
17+
# at $HOME/.duckdb/extensions/<duckdb_version>/<platform>/icu.duckdb_extension
18+
# and falls back to a hub download. Inside the linux_amd64 test docker
19+
# container that path is empty and there is no network egress, so the
20+
# autoload fails. We copy the icu.duckdb_extension that was built locally
21+
# as part of this extension's build (declared in extension_config.cmake)
22+
# into the expected path before running the unittester.
23+
DUCKDB_VERSION_TAG := v1.4.4
24+
25+
define stage_icu
26+
@if [ -f ./build/$(1)/extension/icu/icu.duckdb_extension ]; then \
27+
platform=$$(uname -m | sed 's/x86_64/linux_amd64/;s/aarch64/linux_arm64/'); \
28+
target=$$HOME/.duckdb/extensions/$(DUCKDB_VERSION_TAG)/$$platform; \
29+
mkdir -p "$$target" && cp -f ./build/$(1)/extension/icu/icu.duckdb_extension "$$target/" && \
30+
echo "Staged icu.duckdb_extension at $$target/"; \
31+
fi
32+
endef
33+
1434
test_release_internal:
35+
$(call stage_icu,release)
1536
./build/release/$(TEST_PATH) "$(PROJ_DIR)test/*"
1637
test_debug_internal:
38+
$(call stage_icu,debug)
1739
./build/debug/$(TEST_PATH) "$(PROJ_DIR)test/*"
1840
test_reldebug_internal:
19-
./build/reldebug/$(TEST_PATH) "$(PROJ_DIR)test/*"
41+
$(call stage_icu,reldebug)
42+
./build/reldebug/$(TEST_PATH) "$(PROJ_DIR)test/*"

0 commit comments

Comments
 (0)