Skip to content
Merged
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ embed-smoke: amalgamation
# The full suite runs leak-clean, so leave leak detection on:
# make asan && cd tests && ASAN_OPTIONS=detect_leaks=1 bash run_all_tests.sh
asan:
$(CC) -fsanitize=address,undefined -g -O1 -o $(BINARY) $(SOURCES) \
$(CC) -fsanitize=address,undefined -Werror=switch -g -O1 -o $(BINARY) $(SOURCES) \
-DEIGENSCRIPT_EXT_HTTP=0 \
-DEIGENSCRIPT_EXT_MODEL=0 \
-DEIGENSCRIPT_EXT_DB=0 \
Expand All @@ -203,7 +203,7 @@ asan:
# therefore remains unsanitized — a separate, smaller gap.
# make asan-http && cd tests && ASAN_OPTIONS=detect_leaks=1 bash run_all_tests.sh
asan-http:
$(CC) -fsanitize=address,undefined -g -O1 -o $(BINARY) $(SOURCES) \
$(CC) -fsanitize=address,undefined -Werror=switch -g -O1 -o $(BINARY) $(SOURCES) \
$(SRC_DIR)/ext_http.c \
$(SRC_DIR)/model_io.c $(SRC_DIR)/model_infer.c $(SRC_DIR)/model_train.c \
-DEIGENSCRIPT_EXT_HTTP=1 \
Expand All @@ -217,7 +217,7 @@ asan-http:
# Complements ASan (which is not run with the thread checker). Run the tests
# under `setarch -R` — ThreadSanitizer needs ASLR disabled here (CLAUDE.md).
tsan:
$(CC) -fsanitize=thread -g -O1 -o $(BINARY) $(SOURCES) \
$(CC) -fsanitize=thread -Werror=switch -g -O1 -o $(BINARY) $(SOURCES) \
-DEIGENSCRIPT_EXT_HTTP=0 \
-DEIGENSCRIPT_EXT_MODEL=0 \
-DEIGENSCRIPT_EXT_DB=0 \
Expand All @@ -231,7 +231,7 @@ tsan:
# system without instrumented libs. -O1 keeps optimizer-induced false positives
# down while giving usable stacks. Same minimal extension surface as asan.
valgrind:
$(CC) -g -O1 -o $(BINARY) $(SOURCES) \
$(CC) -Werror=switch -g -O1 -o $(BINARY) $(SOURCES) \
-DEIGS_VALGRIND \
-DEIGENSCRIPT_EXT_HTTP=0 \
-DEIGENSCRIPT_EXT_MODEL=0 \
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ "$1" = "lsp" ]; then
LSP_SOURCES=" $SOURCES "
for u in $CLI_ONLY; do LSP_SOURCES="${LSP_SOURCES/ $u / }"; done
LSP_SOURCES="$LSP_SOURCES eigenlsp.c"
$CC -Wall -Wextra -Werror=implicit-function-declaration -O2 -fstack-protector-strong -o eigenlsp $LSP_SOURCES \
$CC -Wall -Wextra -Werror=implicit-function-declaration -Werror=switch -O2 -fstack-protector-strong -o eigenlsp $LSP_SOURCES \
-DEIGENSCRIPT_EXT_HTTP=0 \
-DEIGENSCRIPT_EXT_MODEL=0 \
-DEIGENSCRIPT_EXT_DB=0 \
Expand All @@ -52,7 +52,7 @@ if [ "$1" = "lsp" ]; then
echo "EigenScript LSP $VERSION built. Binary: $(du -sh eigenlsp | cut -f1)"
elif [ "$1" = "full" ]; then
# Full build: all extensions. Requires libpq-dev.
$CC -Wall -Wextra -Werror=implicit-function-declaration -O2 -fstack-protector-strong -o eigenscript $SOURCES ext_http.c ext_db.c \
$CC -Wall -Wextra -Werror=implicit-function-declaration -Werror=switch -O2 -fstack-protector-strong -o eigenscript $SOURCES ext_http.c ext_db.c \
model_io.c model_infer.c model_train.c \
-I/usr/include/postgresql \
-DEIGENSCRIPT_EXT_HTTP=1 \
Expand All @@ -64,7 +64,7 @@ elif [ "$1" = "full" ]; then
echo "EigenScript $VERSION (full) built. Binary: $(du -sh eigenscript | cut -f1)"
else
# Minimal build: language + stdlib only.
$CC -Wall -Wextra -Werror=implicit-function-declaration -O2 -fstack-protector-strong -o eigenscript $SOURCES \
$CC -Wall -Wextra -Werror=implicit-function-declaration -Werror=switch -O2 -fstack-protector-strong -o eigenscript $SOURCES \
-DEIGENSCRIPT_EXT_HTTP=0 \
-DEIGENSCRIPT_EXT_MODEL=0 \
-DEIGENSCRIPT_EXT_DB=0 \
Expand Down
Loading