11# Auto-detect musl target for static binaries (Linux only)
2+ # Only set MUSL_TARGET on supported architectures; targets that need it will check
23MUSL_TARGET := $(shell uname -m | sed 's/^x86_64$$/x86_64-unknown-linux-musl/;s/^aarch64$$/aarch64-unknown-linux-musl/')
3- ifeq ($(filter % unknown-linux-musl,$(MUSL_TARGET ) ) ,)
4- $(error Unsupported architecture : $(shell uname -m) . Static musl builds only supported on Linux x86_64 and aarch64)
5- endif
4+
5+ define check-musl-target
6+ $(if $(filter % unknown-linux-musl,$(MUSL_TARGET ) ) ,,$(error Unsupported architecture: $(shell uname -m) . Static musl builds only supported on Linux x86_64 and aarch64) )
7+ endef
68
79# Use --locked in CI to ensure reproducible builds
810CARGO_LOCKED := $(if $(CI ) ,--locked,)
911
1012.PHONY : default
1113default : compile
1214
15+ .PHONY : check-shell-permissions
16+ check-shell-permissions :
17+ ./ci/check-scripts-permissions.sh
18+
1319.PHONY : check-rust-formatting
1420check-rust-formatting :
1521 cargo fmt --all -- --check --config=group_imports=StdExternalCrate
1622
17- .PHONY : check-shell-formatting
18- check-shell-formatting :
19- shfmt --simplify --diff ci/*
20-
21- .PHONY : check-python-formatting
22- check-python-formatting :
23- autopep8 --exit-code --diff --aggressive --aggressive --max-line-length 120 --recursive end-to-end-tests/
24-
25- .PHONY : check-yaml-formatting
26- check-yaml-formatting :
27- yamlfmt -verbose -lint -dstar .github/workflows/*
28-
2923.PHONY : fix-rust-formatting
3024fix-rust-formatting :
3125 cargo fmt --all -- --config=group_imports=StdExternalCrate
3226
27+ .PHONY : check-shell-formatting
28+ check-shell-formatting :
29+ shfmt --simplify --diff ci/*
30+
3331.PHONY : fix-shell-formatting
3432fix-shell-formatting :
3533 shfmt --simplify --write ci/*
3634
35+ .PHONY : check-python-formatting
36+ check-python-formatting :
37+ autopep8 --exit-code --diff --aggressive --aggressive --max-line-length 120 --recursive end-to-end-tests/
38+
3739.PHONY : fix-python-formatting
3840fix-python-formatting :
3941 autopep8 --in-place --aggressive --aggressive --max-line-length 120 --recursive end-to-end-tests/
4042
43+ .PHONY : check-yaml-formatting
44+ check-yaml-formatting :
45+ yamlfmt -verbose -lint -dstar .github/workflows/*
46+
4147.PHONY : fix-yaml-formatting
4248fix-yaml-formatting :
4349 yamlfmt -verbose -dstar .github/workflows/*
@@ -50,13 +56,21 @@ check-rust-linting:
5056check-shell-linting :
5157 shellcheck ci/* .sh
5258
59+ .PHONY : check-python-linting
60+ check-python-linting :
61+ ruff check --line-length 120 end-to-end-tests/
62+
63+ .PHONY : fix-python-linting
64+ fix-python-linting :
65+ ruff check --fix --line-length 120 end-to-end-tests/
66+
5367.PHONY : check-github-actions-workflows-linting
5468check-github-actions-workflows-linting :
5569 actionlint -verbose -color
5670
57- .PHONY : check-scripts-permissions
58- check-scripts-permissions :
59- ./ci/check-scripts-permissions.sh
71+ .PHONY : check-rust-dependencies
72+ check-rust-dependencies :
73+ cargo machete
6074
6175.PHONY : compile
6276compile :
@@ -72,6 +86,7 @@ end-to-end-test: compile
7286
7387.PHONY : release
7488release :
89+ $(call check-musl-target)
7590 cargo build --release --target=$(MUSL_TARGET ) --locked --verbose
7691
7792.PHONY : publish-binary
0 commit comments