-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore: avoid apparent race condition in Make task execution #23
Conversation
Makefile
Outdated
@@ -35,7 +35,7 @@ mod: | |||
${GO_CMD} go mod init github.com/${GIT_ORG}/${GIT_REPO} | |||
${GO_CMD} go mod tidy | |||
|
|||
test: | |||
test: mod |
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.
As a first pass I've made mod
a prerequisite for test
and removed it from the prerequisites list for generate
in the SDK Makefile(s). This works for now but I think the actual race involves mod
running before remove-unused
has finished removing the generated <service>/go.(mod|sum)
files. A more direct fix might be to have the mod
task remove generated service-specific go.mod
and go.sum
files instead.
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.
Just checked this out and tried building on my linux server, seems to run fine at least.
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.
I ended up updating the mod
task to clean up the extra go.mod
and go.sum
files and reordering the prerequisites for generate
and that approach seems to work to. Let me know if you prefer the earlier version of this PR instead, though.
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.
No, I prefer this way.
ff9d028
to
9bfd6cb
Compare
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.
lgtm
This PR is included in version 0.31.2 🎉 |
This is a weird one...somehow, switching to running Go commands in a container (#14), combined with the passage of time (worked fine for me last week, consistently doesn't this week) has broken the
make generate-all
task (and the underlyingmake -f Makefile.metalv1 generate
task). But only when I'm running locally.In CI,
make generate-all
runs just fine (as it used to do for me locally). Today, locally, it fails every time. After digging through loads of console output I found this message about halfway through:As a result of this failed execution, the
go.mod
andgo.sum
don't declare any dependencies, which eventually causes the Go tests to fail.