-
Notifications
You must be signed in to change notification settings - Fork 634
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: generated wire file to be compatible with workspaces #410
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
I'm realizing that this fix works until you run For example:
|
Hello, do you have any news regarding the progress of this PR? |
@euskadi31 Unfortunately I don't think this project is actively maintained anymore, the README claims its been feature complete. The last release was almost a year ago and to support Go 1.22 and before that the last commit was in 2022. At this point, Its unlikely the maintainers merge this PR. |
I understand, but here, it is not a new feature, but more a bug with the functioning of the go workspaces... In any case, thanks for this PR, I found a workaround using |
Fair, I suppose we could get input from the maintainers. @zombiezen and @vangent what's your take on this issue? I understand this repo is feature complete, but would you consider this a bug fix that would be worth adding to the next release? |
I'd be up for reviewing a fix for something like this; it seems important. In general, the amount of time that I have for back-and-forth code reviews on this project is pretty limited. Glancing over the description and the issue, my main question is: do we need to introduce a new flag for this? Wire was built when Go modules were fairly new, so I suspect the |
I can remember this from a time before wire was calling -mod=mod. The workaround was to have a tools.go with something like
But there is now/will be (golang 1.24) a tool directive in go.mod |
Fixes #403
Problem
After trying to run
wire ./...
on a module inside of a go workspace subsequent calls togo generate ./...
failThis is because the
wire_gen.go
files contain the following generate command (see #403 for more details)Solution
This fix adds a flag to the compiled binary to allow this flag to be either unset or overridden with a different value.
For example running this command:
Would generate the following
wire_gen.go
file