Skip to content

Commit 094664d

Browse files
committed
build: check-ci builds the semantics library with each dialect feature alone
Every other check-ci target builds the workspace with all features unified, so library code in one dialect's folder that reaches another dialect's module builds there and breaks only a single-dialect build. `make dialect-builds` runs `cargo check -p sqlquack-semantics --lib --no-default-features --features <dialect>` once per dialect. The dialects are read from the crate's features, so a new dialect is checked without editing the target. check-ci runs it after engine-free. The tests are not checked per dialect: they read every dialect through the crate's dev-dependency on itself, so a single-feature test build is the all-features build.
1 parent d0860ca commit 094664d

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎Makefile‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PYTHON_TYPED := scripts tests/unit/scripts python/src $(PYTHON_API_TESTS)
3030
PYTHON_TESTS := tests/unit/scripts $(PYTHON_API_TESTS)
3131
endif
3232

33-
.PHONY: distribution-notices format rust-lint python-check fensu syntax-coverage depth-probe depth-probe-debug gate-build evidence-guard polyglot-guard engine-free generate-cases generated-cases generate-syntax-cases syntax-cases dialect-cases corpus-rerecord generate-referee-cases referee-cases referee-pending translation-results help pending check-syntax record-syntax check-convert record-convert sql-sizes sql-size-baseline sql-benchmark check-ci check-merge test test-rust test-python python-module python-api python-wheel verify-recorded polyglot-duckshop census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure
33+
.PHONY: distribution-notices format rust-lint python-check fensu syntax-coverage depth-probe depth-probe-debug gate-build evidence-guard polyglot-guard engine-free dialect-builds generate-cases generated-cases generate-syntax-cases syntax-cases dialect-cases corpus-rerecord generate-referee-cases referee-cases referee-pending translation-results help pending check-syntax record-syntax check-convert record-convert sql-sizes sql-size-baseline sql-benchmark check-ci check-merge test test-rust test-python python-module python-api python-wheel verify-recorded polyglot-duckshop census-duckshop fuzz-smoke gate gate-parallel census duckshop-compiled duckshop-measure
3434

3535
format:
3636
cargo fmt --all
@@ -93,6 +93,18 @@ engine-free:
9393
echo "sqlquack-convert reaches DuckDB's engine" >&2; exit 1; \
9494
fi
9595

96+
# Fails when the semantics library does not build with one dialect feature alone. The other targets
97+
# build every feature together, so they cannot see library code that needs another dialect. Its tests
98+
# are not checked this way: they read every dialect, through the crate's dev-dependency on itself.
99+
dialect-builds:
100+
@set -e; dialects="$$(cargo metadata --locked --no-deps --format-version 1 | uv run python -c \
101+
'import json, sys; print(*sorted(set(next(p for p in json.load(sys.stdin)["packages"] if p["name"] == "sqlquack-semantics")["features"]) - {"default"}))')"; \
102+
test -n "$$dialects"; \
103+
for dialect in $$dialects; do \
104+
echo "sqlquack-semantics --features $$dialect"; \
105+
cargo check --locked --quiet -p sqlquack-semantics --lib --no-default-features --features $$dialect; \
106+
done
107+
96108
# Rewrites cases/generated/ from the generators in scripts/case_generators/.
97109
generate-cases:
98110
uv run python -m scripts.generate_cases
@@ -140,7 +152,7 @@ referee-pending:
140152
uv run python -m scripts.write_referee_pending $(REFEREE_ARGS)
141153

142154
# The static gate, the first step of `gate`, and the Python API's tests.
143-
check-ci: rust-lint python-check fensu syntax-coverage depth-probe evidence-guard polyglot-guard engine-free generated-cases syntax-cases dialect-cases referee-cases python-api distribution-notices ## The static gate CI runs.
155+
check-ci: rust-lint python-check fensu syntax-coverage depth-probe evidence-guard polyglot-guard engine-free dialect-builds generated-cases syntax-cases dialect-cases referee-cases python-api distribution-notices ## The static gate CI runs.
144156

145157
# Each distribution ships the licence and third-party notices; its copies must match the root files.
146158
distribution-notices:

0 commit comments

Comments
 (0)