-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: long delay before error for missing replaced module #35902
Comments
Personally I disable modules for local dev, I'm pro-modules but it's extremely annoying at times. |
(Warning: I am learning Go so please be skeptical of my assertions.) It appears that the Go build process uses 3 separate cache facilities: GOPROXY, GOCACHE and $GOPATH/pkg.
|
/cc @bcmills @jayconrod |
Is there anything different than what you posed in #33478? Was there any output at all (even at the end of 30 seconds)? Is there anything unusual about your network setup (proxy or firewall)? I couldn't reproduce this with go 1.13.4. I ran
Did you see any output at all? There's generally some chatter about "finding", "downloading", and "extracting" modules, though we've trimmed that back a bit as it's generally a bit much. |
Here's my minimal repro: https://github.com/alltom/gobug-35902 I've tripped the bug on a few different networks, so I don't think it's them. I do, however, run Encrypt.me, although it's supposed to be disabled on those networks. Let me know if it still doesn't repro for you and I'll try harder to disable it. FWIW, the title you gave this bug addresses item 1 in my original report, but no longer addresses item 2. Silently using an unexpected version of my code (on my laptop, I always want the source that is on disk) is at least at confusing and frustrating as the other bug. |
@alltom Thanks for putting together that repo. I was able to reproduce this. The reason the
Since there's no requirement or replacement for The |
@alltom About the retitling: by design, If you find yourself using |
I would like to make the |
Regarding item 2, the |
@jayconrod I understand the concern with transitive replacements, but I believe that it's important for us to find a mitigation for "all of my modules need to add I'm developing several command-line tools right now, consisting of about 15 modules. There are dependency chains like tool → plugin lib → networking lib. Yesterday I made a breaking change to fix a bug in "networking lib" and to figure out if the fix was adequate for all the tools, I had to add several With a GOROOT, the only steps would have been building and testing. I haven't used a GOROOT because the only thing they all have in common is that I happen to be working on them at the same time. gohack seems to solve a different problem, where I'm editing a dependency but only testing the change in one dependent. @bcmills I will try to give it a shot. I've never tried installing a second Go before. Please tell me it's painless. :) |
@alltom, the painless way is |
Ah, for that workflow I would recommend doing the testing “in reverse”: do all of your work in the “networking lib” module, and use But this is getting a bit off-topic: #27542 is the main bug for editing interdependent modules. |
Awesome, it really was painless. The change in gotip fixes my first issue. And I'm happy to let the second issue in my report be duped to #27542 since the discussion over there is great. Thanks! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Create three local modules a, b, and c, where a depends on b, and b depends on c, as in #33478.
What did you expect to see?
Successful build.
What did you see instead?
go build a.go
appears to hang, but it's actually waiting 30 seconds for a doomed network request to fetch module c.I understand the motivation (assuming that my comment here is correct: #33478 (comment)) However, I'm working on modules locally that may never be published, so I feel like there are two bugs wrt the local development workflow:
go build
appears to hang for 30 seconds. It took a while for me to figure out what was going on because I kept getting impatient and killing the process before seeing an error message. Adding-v
doesn't help.replace
in dependencies means that all of my modules need to addreplace
statements for the entire transitive closure of their dependencies. If I forget one and that dependency has not been published, the build will silently hang for 30 seconds before failing. If I forget one that has been published at least once before, the build will silently use the published version instead of my local version. Neither is great.Thanks!
The text was updated successfully, but these errors were encountered: