-
-
Notifications
You must be signed in to change notification settings - Fork 557
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: goa gen ignores vendor directory #2979
Fix: goa gen ignores vendor directory #2979
Conversation
This looks great, thank you. Make sense that the |
I like that idea and have some ideas as to how I might implement it. I'll update this PR when I get a chance. |
Back to the drawing board. There's no consistency between what the |
Could it do something as simple as whether the |
I was hoping for something more elegant than that but the The other thing is that the presence of the directory doesn't necessarily indicate the completeness of the package contained within. Another approach that might be awful but would certainly give us enough info would be to create another temp dir, write a go file with a bare import of the relevant package and attempt to build it, capturing errors with enough info to make it actionable. Alternatively we could test the output of the |
Yeah it's not the most elegant for sure, an alternative could be to add a error handler (instead of checking proactively) that would understand that vendoring is enabled and suggest making sure that Goa is vendored. It depends a bit on how easy or hard it is to write such a handler... |
Unfortunately the biggest issue at hand is just that the |
@raphael is there a good location to document troubleshooting information? I noticed the docs aren't in the |
The closest that exists to this atm is the FAQ https://goa.design/learn/faq/ - but happy to create an explicit troubleshooting document if that makes more sense. |
I've updated with the best approach I could come up with. Instead of trying to determine if the dependency is satisfied ahead of time, we just check the error that comes from |
Looks great, thank you! |
…shooting info in README.
b009a60
to
bce218b
Compare
This PR fixes #2978 by only running
go get
from generator code if the module does not have avendor
directory. The gotcha is that thevendor
directory must contain thegoa.design/goa/v3/codegen/generator
.Because of the general guarantee that using a
vendor
directory provides a measure of predictability in builds, I'm reluctant to find some way to install that package as part of the code generation process. Instead, it may be more appropriate to document this requirement and suggest the user use thetools.go
model to ensure the package is included.I'm open to suggestions for how to handle this case.