- Notifications
You must be signed in to change notification settings - Fork928
fix: executerbacgen
even if dependencies' mod times are older than source file's#13757
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
… fileSigned-off-by: Danny Kopping <danny@coder.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Are we missingcodersdk/rbacresources_gen.go
ingen/mark-fresh
for a reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could just be an omission?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It's an omission. There is no reason. We should add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
PHONY target is fine, but can we just add thepolicy.go
file as a dependency? Then updates to that would work?
But adding PHONY so it runs on every gen seems fine to me too. I usually run with-B
.
Signed-off-by: Danny Kopping <danny@coder.com>
@Emyrk yeah, on reflection adding |
98c09bf
intomainUh oh!
There was an error while loading.Please reload this page.
I'm using GNU Make 4.4.1
When executing
codersdk/rbacresources_gen.go
, I found that the make target was not actually being executed. I traced this down to the dependencies' modification times being less than the target file's. This appears to be a performance-related behaviour inmake
, since a target file would not need to change if all of its dependencies were modified before it.In this case, however, we need to execute the
scripts/rbacgen/main.go
script even if it has not been recently modified, and the solution to this is to add aPHONY
target.I suspect we have other cases in our
Makefile
which are preventing targets from running when we expect them to.