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

Additional dependencies or prerequisite for plugins with v3.20.0 #3675

Closed
mamo3gr opened this issue Mar 17, 2025 · 1 comment · Fixed by #3682
Closed

Additional dependencies or prerequisite for plugins with v3.20.0 #3675

mamo3gr opened this issue Mar 17, 2025 · 1 comment · Fixed by #3682

Comments

@mamo3gr
Copy link
Contributor

mamo3gr commented Mar 17, 2025

Dear authors,

Thank you for the great framework.
I have used Goa with a plugin for a long time.
goa gen fails in some use cases with v3.20.0.

How to reproduce

The same steps with https://github.com/goadesign/goa/blob/11f1923620be3d8215b108f652031e1e4cd7ea2d/README.md#-quick-start but design/design.go is modified as below:

package design

import (
    . "goa.design/goa/v3/dsl"
    slogdriver "github.com/kitagry/goaplugin/slogdriver/dsl"
)

var _ = Service("calc", func() {
    slogdriver.HealthCheckPaths("/healthz")
})
  • Just executing goa gen calcsvc/design (hereafter goa gen in short) with blank go.mod succeeds. gen directory is generated.
  • Starting blank go.mod, go mod tidy and then goa gen fails with error err: exit status 1: stderr: go: updates to go.mod needed; to update it: go mod tidy.
    • Executing go mod tidy makes no sense. goa gen fails again.
    • Generating intermediate file with goa gen --debug and go mod tidy again makes goa gen succeed.
    • After generating, remove gen directory and intermediate file (goa[1-9]+
      directory), then executing go mod tidy removes github.com/gohugoio/hashstructure.

Goa v3.19.1 seems not to fail in despite of those failing procedure.
In #3642, github.com/gohugoio/hashstructure is added. I suspect that this change affect the requirement and/or prerequisite of the plugins.

Question

  • Does Goa support the use case of cleaning up and re-generating with goa gen?
  • If it is yes, what is the requirement plugins must fulfill?
    • I'm not an author of the plugin in the example, but can/will submit improving PR to the repository.

Kind regards,

@raphael
Copy link
Member

raphael commented Mar 26, 2025

Thank you for the detailed explanation and the repro. This is fixed by #3682.
TL;DR there was a missing anonymous import to force Go to add the hashstructure dependency.

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 a pull request may close this issue.

2 participants