Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #15902: Only cache dependencies #2514

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions relay/sources/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ target/man/rudder-relayd.1.gz:


CACHER=../../../../../build-caching
CARGO_SHA:=$(shell sha256sum relayd/Cargo.lock | awk '{print $$1}')
SRC_SHA:=$(shell (find relayd/src/ -type f && echo relayd/Cargo.toml) | sort | xargs sha256sum | sha256sum | awk '{print $$1}')
build: man rudder-pkg/rudder_plugins_key.pub autocomplete/rudder-pkg.sh
# Build relayd
[ -x $(CACHER) ] && $(CACHER) get ../../../../../.cargo/ name=cargo cargo=$(CARGO_SHA) || true
[ -x $(CACHER) ] && $(CACHER) get relayd/target --with-env name=relayd cargo=$(CARGO_SHA) src=$(SRC_SHA) || true
# Build relayd
[ -x $(CACHER) ] && $(CACHER) get ../../../../../.cargo/ name=cargo major=$(RUDDER_MAJOR_VERSION) || true
[ -x $(CACHER) ] && $(CACHER) get relayd/target --with-env name=relayd major=$(RUDDER_MAJOR_VERSION) || true
cd relayd && cargo build --release --bin rudder-relayd
[ -x $(CACHER) ] && $(CACHER) put ../../../../../.cargo/ name=cargo cargo=$(CARGO_SHA)
[ -x $(CACHER) ] && $(CACHER) put relayd/target --with-env name=relayd cargo=$(CARGO_SHA) src=$(SRC_SHA)
# the cache is always updated and cargo will rebuild only what is needed
[ -x $(CACHER) ] && $(CACHER) put ../../../../../.cargo/ name=cargo major=$(RUDDER_MAJOR_VERSION)
[ -x $(CACHER) ] && $(CACHER) put relayd/target --with-env name=relayd major=$(RUDDER_MAJOR_VERSION)

ifeq ($(SELINUX),true)
# Build SELinux policy package
Expand Down