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

Conversation

serathius
Copy link
Member

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

Do we have an issue for this or some more context on what is happening with cache?

@serathius
Copy link
Member Author

If you run make test-robustness-issue14370 twice, it will download and build etcd-v3.5.4 twice, when it doesn't need to.

@ivanvc
Copy link
Member

ivanvc commented May 8, 2024

Would it make sense to define the install-gofail phony target as dependent on the actual gofail binary path? This would work, too, without having to change the target dependencies. i.e., something like:

@@ -58,13 +56,14 @@ gofail-disable:
        cd ./tests && go mod tidy
 
 .PHONY: install-gofail
-install-gofail:
+install-gofail: $(GOPATH)/bin/gofail
+
+$(GOPATH)/bin/gofail:
        go install go.etcd.io/gofail@${GOFAIL_VERSION}

@serathius
Copy link
Member Author

Would it make sense to define the install-gofail phony target as dependent on the actual gofail binary path? This would work, too, without having to change the target dependencies. i.e., something like:

@@ -58,13 +56,14 @@ gofail-disable:
        cd ./tests && go mod tidy
 
 .PHONY: install-gofail
-install-gofail:
+install-gofail: $(GOPATH)/bin/gofail
+
+$(GOPATH)/bin/gofail:
        go install go.etcd.io/gofail@${GOFAIL_VERSION}

Right, but what happens when GOFAIL_VERSION is changed?

@ivanvc
Copy link
Member

ivanvc commented May 8, 2024

Right, but what happens when GOFAIL_VERSION is changed?

Good point, it won't work. Although we could add the version to the path, it won't be a clean solution.

@serathius
Copy link
Member Author

Figured out we can do it by depending on go.mod, PTAL @ivanvc

Copy link
Member

@ivanvc ivanvc left a comment

Choose a reason for hiding this comment

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

/lgtm 👍

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

We need to bump go version first to make CI happy

@ivanvc
Copy link
Member

ivanvc commented May 8, 2024

We need to bump go version first to make CI happy

@fuweid, we're tracking that in #17964.

@serathius serathius merged commit c4ff2c2 into etcd-io:main May 8, 2024
42 of 44 checks passed
@serathius
Copy link
Member Author

LGTM

We need to bump go version first to make CI happy

Or I can just merge :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants