Skip to content

Commit

Permalink
Fix caching by not depending on PHONY target in non-PHONY target
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
  • Loading branch information
serathius committed May 8, 2024
1 parent 7bff148 commit b7e9645
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/robustness/makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ test-robustness-issue15271: /tmp/etcd-v3.5.7-failpoints/bin
GOFAIL_VERSION = $(shell cd tools/mod && go list -m -f {{.Version}} go.etcd.io/gofail)

.PHONY: gofail-enable
gofail-enable: install-gofail
gofail-enable:
$(MAKE) install-gofail
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:
$(MAKE) install-gofail
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
Expand All @@ -61,7 +63,8 @@ install-gofail:

# Build previous releases for robustness tests

/tmp/etcd-v3.6.0-failpoints/bin: install-gofail
/tmp/etcd-v3.6.0-failpoints/bin:
$(MAKE) install-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,8 @@ 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:
$(MAKE) install-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 +87,8 @@ 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:
$(MAKE) install-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 +100,17 @@ 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:
$(MAKE) install-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:
$(MAKE) install-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

0 comments on commit b7e9645

Please sign in to comment.