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
go/build: Import seems to require absolute srcDir #14282
Comments
cc: @rsc |
If build.Import is changed/fixed such that it accepts a relative srcDir we can undo the changes to FindPkg (computing of absolute srcDir) in the following CLs: |
Another CL to update if this gets addressed: http://golang.org/cl/37405/ |
@rsc I'm going to assign this one to you (go/build issue); to decide and/or fix or document since you're most familiar with go/build. I can take care of my CLs that contain the work-arounds. |
If the solution turns out to be that build.Import creates an absolute path from a relative |
I think we should fix it, for Go 1.10. Will send a CL. |
CL https://golang.org/cl/45831 mentions this issue. |
Decided to hold off. go/build is basically going to be deprecated for this kind of use in another release or two. |
@rsc are there any written down plans on the package management changes, changes to go/build and so on that you have planned for future releases? This is probably something that tool authors want to know about way ahead of time. |
Things are in flux with vgo coming down the pike. Pushing this to next release, and perhaps at some point we can just close it as not relevant anymore. |
Moving to 1.13 where we may decide this doesn't matter anymore per #14282 (comment). |
This has been "working" as is for > 3 years. With modules this code won't be executed anymore. It's unlikely that there is a need to fix this. |
While investigating go/types issue #14215, I noticed that (after fixing the obvious go/types bug), build.Import didn't find the desired package if srcDir was relative. Computing its absolute path (relative to cwd) fixed the problem.
Reminder to investigate behavior. Fix and/or document.
The text was updated successfully, but these errors were encountered: