-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (59 loc) · 3.32 KB
/
Copy pathMakefile
File metadata and controls
70 lines (59 loc) · 3.32 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
70
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# VCPKG setup: Set the VCPKG_TOOLCHAIN_PATH variable that the included makefile expects.
ifeq ($(VCPKG_ROOT),)
export VCPKG_TOOLCHAIN_PATH ?= $(PROJ_DIR)/vcpkg_installed/$(VCPKG_TARGET_TRIPLET)/share/vcpkg/scripts/buildsystems/vcpkg.cmake
else
export VCPKG_TOOLCHAIN_PATH ?= $(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake
endif
# Configuration of extension
EXT_NAME=anofox_tabular
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
# Include the Makefile from extension-ci-tools
include extension-ci-tools/makefiles/duckdb_extension.Makefile
# Force unified "build" directory regardless of generator (ninja or make)
# This simplifies .gitignore and documentation by avoiding build-ninja vs build split
BUILD_ROOT:=build
# Patches applied to the DuckDB submodule before building (see duckdb_patches/).
# Currently EMPTY: the previous fmt stdext::checked_array_iterator removal
# (upstream duckdb/duckdb@0c19d698ca) is now included in v1.4.5 and v1.5.4, so
# no patch is needed. The mechanism is kept for future submodule patches.
# Idempotent: already-applied patches are detected and skipped; an empty
# duckdb_patches/ directory is a no-op (the unexpanded glob is skipped).
.PHONY: apply_duckdb_patches
apply_duckdb_patches:
@for p in $(PROJ_DIR)duckdb_patches/*.patch; do \
[ -e "$$p" ] || continue; \
if git -C duckdb apply --reverse --check "$$p" 2>/dev/null; then \
echo "DuckDB patch already applied: $$p"; \
elif git -C duckdb apply --check "$$p" 2>/dev/null; then \
git -C duckdb apply "$$p" && echo "Applied DuckDB patch: $$p"; \
else \
echo "ERROR: DuckDB patch does not apply: $$p" && exit 1; \
fi; \
done
release: apply_duckdb_patches
debug: apply_duckdb_patches
reldebug: apply_duckdb_patches
# Override configure_ci to build libpostal from source with -fPIC
# System packages (Alpine libpostal-dev) lack -fPIC, which is required
# for linking into shared libraries (DuckDB extensions)
configure_ci: apply_duckdb_patches
bash $(PROJ_DIR)/scripts/install-deps-ci.sh
# The postal module is only compiled when libpostal is available (see
# CMakeLists.txt: static lib in /usr/local or /usr/lib, else pkg-config). On
# macOS/Windows it is absent, so postal functions and the
# anofox_tab_postal_data_path setting are not registered. Mirror that same
# detection here so postal tests run in Linux CI and skip elsewhere, via the
# POSTAL_AVAILABLE env var the postal sqllogictests guard on.
POSTAL_AVAILABLE := $(if $(or $(wildcard /usr/local/lib/libpostal.a),$(wildcard /usr/lib/libpostal.a),$(shell pkg-config --exists libpostal 2>/dev/null && echo 1)),1,)
POSTAL_TEST_ENV := $(if $(POSTAL_AVAILABLE),POSTAL_AVAILABLE=1,)
# Override test targets to disable telemetry during test runs
# This prevents local tests and CI/CD from polluting PostHog telemetry data
# DNNL_MAX_CPU_ISA=AVX2: limits OneDNN (used by OpenVINO) to AVX2 at most,
# preventing SIGILL in manylinux Docker containers that restrict AVX-512 CPUID
test_release_internal:
DATAZOO_DISABLE_TELEMETRY=1 DNNL_MAX_CPU_ISA=AVX2 $(POSTAL_TEST_ENV) ./build/release/test/unittest "test/*"
test_debug_internal:
DATAZOO_DISABLE_TELEMETRY=1 DNNL_MAX_CPU_ISA=AVX2 $(POSTAL_TEST_ENV) ./build/debug/test/unittest "test/*"
test_reldebug_internal:
DATAZOO_DISABLE_TELEMETRY=1 DNNL_MAX_CPU_ISA=AVX2 $(POSTAL_TEST_ENV) ./build/reldebug/test/unittest "test/*"