Skip to content

Commit

Permalink
chore(make): install rust toolchain in the dev target (#13873)
Browse files Browse the repository at this point in the history
  • Loading branch information
oowl authored Nov 19, 2024
1 parent 96a8bac commit 3140f81
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ bin/h2client:
https://github.com/Kong/h2client/releases/download/v$(H2CLIENT_VERSION)/h2client_$(H2CLIENT_VERSION)_$(OS)_$(H2CLIENT_MACHINE).tar.gz | tar xz -C bin;
@$(RM) bin/README.md

install-rust-toolchain:
@if command -v cargo; then \
echo "Rust is already installed in the local directory, skipping"; \
else \
echo "Installing Rust..."; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path; \
. $$HOME/.cargo/env; \
rustup toolchain install stable; \
rustup default stable; \
fi


check-bazel: bin/bazel
ifndef BAZEL
Expand Down Expand Up @@ -100,6 +111,7 @@ build-openresty: check-bazel

install-dev-rocks: build-venv
@. $(VENV) ;\
export PATH=$$PATH:$$HOME/.cargo/bin; \
for rock in $(DEV_ROCKS) ; do \
if luarocks list --porcelain $$rock | grep -q "installed" ; then \
echo $$rock already installed, skipping ; \
Expand All @@ -110,7 +122,7 @@ install-dev-rocks: build-venv
fi \
done;

dev: build-venv install-dev-rocks bin/grpcurl bin/h2client wasm-test-filters
dev: install-rust-toolchain build-venv install-dev-rocks bin/grpcurl bin/h2client wasm-test-filters

build-release: check-bazel
$(BAZEL) clean --expunge
Expand Down Expand Up @@ -189,9 +201,10 @@ remove:
$(warning 'remove' target is deprecated, please use `make dev` instead)
-@luarocks remove kong

dependencies: bin/grpcurl bin/h2client
dependencies: install-rust-toolchain bin/grpcurl bin/h2client
$(warning 'dependencies' target is deprecated, this is now not needed when using `make dev`, but are kept for installation that are not built by Bazel)

export PATH=$$PATH:$$HOME/.cargo/bin; \
for rock in $(DEV_ROCKS) ; do \
if luarocks list --porcelain $$rock | grep -q "installed" ; then \
echo $$rock already installed, skipping ; \
Expand Down

1 comment on commit 3140f81

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:3140f810f54b152b21df8d2f5c07892be3fe464d
Artifacts available https://github.com/Kong/kong/actions/runs/11912182455

Please sign in to comment.