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 issues with 'make generate' #819

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix issues with 'make generate' #819

wants to merge 1 commit into from

Conversation

jhump
Copy link
Member

@jhump jhump commented Feb 3, 2025

I happened to notice errors on my local machine when I would run make generate. I did a little digging and realize these were material errors that were happening in CI, too.

If you look at this latest CI job from main, in the "Unit Test" step, you'll see output that repeats the following error message:

bash: line 1: buf: command not found

On my laptop, I was seeing a different error:

Failure: plugin protoc-gen-connect-go: exec: "protoc-gen-connect-go": executable file not found in $PATH

Doh! This error should have caused the make generate target to halt and fail, but it did not. This pull request remedies that.

There are two different issues afoot:

  1. The generate.sh script would return success (zero exit code), even when the various commands it was running would fail. This is due to how the -exec flag to find works. So I changed it to instead use xargs, which will properly return a non-zero exit code if any of the processes it spawns fails.
  2. The next issue was the underlying cause for the commands in generate.sh failing: the PATH variable was not properly configured. So the make generate target was building the dependencies but not making them available on the PATH.

Now that this is fixed, this also fixes the generated code produced by that step so that it corresponds to the correct version of protoc-gen-go (i.e. the version pinned in go.mod).

Signed-off-by: Josh Humphries <[email protected]>
@jhump jhump force-pushed the jh/fix-make-generate branch from 0b24af6 to 384851d Compare February 3, 2025 22:16
@jhump jhump requested a review from emcfarlane February 3, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant