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

Fix caching by not depending on PHONY target in non-PHONY target #17965

Merged
merged 1 commit into from
May 8, 2024
Merged
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
25 changes: 14 additions & 11 deletions tests/robustness/makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,34 @@ test-robustness-issue15271: /tmp/etcd-v3.5.7-failpoints/bin

# Failpoints

GOPATH = $(shell go env GOPATH)
GOFAIL_VERSION = $(shell cd tools/mod && go list -m -f {{.Version}} go.etcd.io/gofail)

.PHONY:install-gofail
install-gofail: $(GOPATH)/bin/gofail

.PHONY: gofail-enable
gofail-enable: install-gofail
gofail enable server/etcdserver/ server/lease/leasehttp server/storage/backend/ server/storage/mvcc/ server/storage/wal/ server/etcdserver/api/v3rpc/
gofail-enable: $(GOPATH)/bin/gofail
$(GOPATH)/bin/gofail enable server/etcdserver/ server/lease/leasehttp server/storage/backend/ server/storage/mvcc/ server/storage/wal/ server/etcdserver/api/v3rpc/
cd ./server && go get go.etcd.io/gofail@${GOFAIL_VERSION}
cd ./etcdutl && go get go.etcd.io/gofail@${GOFAIL_VERSION}
cd ./etcdctl && go get go.etcd.io/gofail@${GOFAIL_VERSION}
cd ./tests && go get go.etcd.io/gofail@${GOFAIL_VERSION}

.PHONY: gofail-disable
gofail-disable: install-gofail
gofail disable server/etcdserver/ server/lease/leasehttp server/storage/backend/ server/storage/mvcc/ server/storage/wal/ server/etcdserver/api/v3rpc/
gofail-disable: $(GOPATH)/bin/gofail
$(GOPATH)/bin/gofail disable server/etcdserver/ server/lease/leasehttp server/storage/backend/ server/storage/mvcc/ server/storage/wal/ server/etcdserver/api/v3rpc/
cd ./server && go mod tidy
cd ./etcdutl && go mod tidy
cd ./etcdctl && go mod tidy
cd ./tests && go mod tidy

.PHONY: install-gofail
install-gofail:
$(GOPATH)/bin/gofail: tools/mod/go.mod tools/mod/go.sum
go install go.etcd.io/gofail@${GOFAIL_VERSION}

# Build previous releases for robustness tests

/tmp/etcd-v3.6.0-failpoints/bin: install-gofail
/tmp/etcd-v3.6.0-failpoints/bin: $(GOPATH)/bin/gofail
rm -rf /tmp/etcd-v3.6.0-failpoints/
mkdir -p /tmp/etcd-v3.6.0-failpoints/
cd /tmp/etcd-v3.6.0-failpoints/; \
Expand All @@ -72,7 +75,7 @@ install-gofail:
/tmp/etcd-v3.5.2-failpoints/bin:
/tmp/etcd-v3.5.4-failpoints/bin:
/tmp/etcd-v3.5.5-failpoints/bin:
/tmp/etcd-v3.5.%-failpoints/bin: install-gofail
/tmp/etcd-v3.5.%-failpoints/bin: $(GOPATH)/bin/gofail
rm -rf /tmp/etcd-v3.5.$*-failpoints/
mkdir -p /tmp/etcd-v3.5.$*-failpoints/
cd /tmp/etcd-v3.5.$*-failpoints/; \
Expand All @@ -83,7 +86,7 @@ install-gofail:
(cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \
FAILPOINTS=true ./build;

/tmp/etcd-release-3.5-failpoints/bin: install-gofail
/tmp/etcd-release-3.5-failpoints/bin: $(GOPATH)/bin/gofail
rm -rf /tmp/etcd-release-3.5-failpoints/
mkdir -p /tmp/etcd-release-3.5-failpoints/
cd /tmp/etcd-release-3.5-failpoints/; \
Expand All @@ -95,15 +98,15 @@ install-gofail:
FAILPOINTS=true ./build;

/tmp/etcd-v3.4.23-failpoints/bin:
/tmp/etcd-v3.4.%-failpoints/bin: install-gofail
/tmp/etcd-v3.4.%-failpoints/bin: $(GOPATH)/bin/gofail
rm -rf /tmp/etcd-v3.4.$*-failpoints/
mkdir -p /tmp/etcd-v3.4.$*-failpoints/
cd /tmp/etcd-v3.4.$*-failpoints/; \
git clone --depth 1 --branch v3.4.$* https://github.com/etcd-io/etcd.git .; \
go get go.etcd.io/gofail@${GOFAIL_VERSION}; \
FAILPOINTS=true ./build;

/tmp/etcd-release-3.4-failpoints/bin: install-gofail
/tmp/etcd-release-3.4-failpoints/bin: $(GOPATH)/bin/gofail
rm -rf /tmp/etcd-release-3.4-failpoints/
mkdir -p /tmp/etcd-release-3.4-failpoints/
cd /tmp/etcd-release-3.4-failpoints/; \
Expand Down
Loading