-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fails when built with -trimpath #910
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bugs don't disappear just because time passes! |
So don't use trimpath? gqlgen doesnt get shipped to your servers, its a tool used in your ci/dev environment. We might start inlining templates again, but its trading off a lot of developer experience to fix your build environment. |
Trimpath is a very nice default. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
bazel uses trimpath to achieve reproducible builds. We use gqlgen/api to generate code. And modelgen fails in locating templates. The following patch works for us.
Update: Instead of patching gqlgen code, changing directory to the runtime path helped. No patch required in gqlgen. |
How about using the embed feature introduced in Go 1.16? |
See 99designs/gqlgen#910 Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
What happened?
What did you expect?
Success, like without
-trimpath
:Minimal graphql.schema and models to reproduce
Just about anything, really.
versions
gqlgen version
?go version
?And obviously modules.
It seems gqlgen is using build-time paths to try to locate its template files, and trimpath confuses that. Perhaps the templates should be bundled into the executable.
The text was updated successfully, but these errors were encountered: