-
Notifications
You must be signed in to change notification settings - Fork 18k
go get downloads all directories except the directory specified on bitbucket #42450
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
Comments
Following the third paragraph of the docs I created the tag
and verified that it got pushed to bitbucket. When I
but nothing gets downloaded. A silent failure. I also tried this
but it returns immediately and does nothing. |
Have you tried asking this as a question first? https://golang.org/wiki/Questions It's likely this has something to do with the way you set up the module(s). You could also try using the latest version of Go. |
@dwschulze, the argument to The command you are probably looking for here is
with the desired commit tagged |
That said, in general we recommend only one module per repo. (Is there a particular reason you need to have the |
I've tried the command
with the tag One module per repo could lead to proliferation of repos, which we could probably handle. But what do groups that put everything into one repo do with modules? (I've heard Google has one huge repo for all of their code which I find hard to believe.) |
In general it is fine to have all of your packages in one big module in one big repo. (IMO the only really compelling use-case for multi-module repos is to be able to tag independent releases of packages within that repo. But that seems like a rare use-case, and often isn't worth the overhead of maintaining multiple modules.) |
@mvdan - I've asked this question on both the golang-nuts forum and stackoverflow. Thanks for asking. I got one response that didn't fix anything. As far as upgrading to a newer version of Go, was there a bug fix relevant to this issue? If not that sounds like the mindless advice you get by calling an 800 number for tech. support for a childrens computer game. This is a serious problem and I need to either get a bug fixed or find out if it is a documentation problem. |
There have been fixes in the module system in every release since Go 1.11. Many of the recent improvements are specifically to provide clearer diagnostics. Also note that the issue template specifically asks “Does this issue reproduce with the latest release?”, and the latest supported releases are Finally, note that our Gopher values include to “be patient” and “avoid … snarking”. We have the common goal of making Go development simple and productive. I understand that you're feeling frustrated, but please keep comments constructive. |
Thanks for having asked the question elsewhere. A significant portion of modules issues raised here are essentially questions phrased as bug reports, so that's why I tend to ask. And, like Bryan says, trying the latest stable release is indeed part of the bug reporting process. Go 1.14.x is still supported, but you should still check if your problem has been solved in 1.15.x (or even the upcoming 1.16, once beta1 is out in a few weeks). |
I added the -v to go get but it gives no output and downloads the same thing (all the subdirectories except the one I'm asking for) $ go get -v bitbucket.org/orgname/reponame/integration-common/util/@v0.0.1 Something unusual is that that the downloaded dirs/files have permission 500. The directory I'm trying to get was created on a branch as was the tag v0.0.1. That directory doesn't exist on any other branch. I can see the directory under the tag on the bitbucket UI. My understanding is that tags are independent of branches. |
@dwschulze, what is the output of You could also try using a totally different version for the nested module to remove any ambiguity. (What happens if you apply the tag |
I could also imagine that you might be running into issue #37438, which is fixed at head but not in any prior release. (You could confirm that one way or the other by trying the same steps using |
I upgraded to go v1.15.4. Same results. $ go list -versions -m bitbucket.org/orgname/reponame I added the tag integration-common/util/v0.0.2 and pushed. I can see it in bitbucket with my directories and files in it. When I do go get -v bitbucket.org/orgname/reponame/integration-common/util/@v0.0.2 it downloads reponame@v0.0.1 however with all the directories except the one I'm asking for. I deleted the v0.0.1 tag git push --delete origin integration-common/util/v0.0.1 and ran the same go get with @v0.0.2 and it still downloads reponame@v0.0.1. Something is really haywire. |
Ok, that really sounds like #37438. 😞 Try |
That's possibly as expected? What about |
$ go list -versions -m bitbucket.org/orgname/reponame/integration-common/util Makes sense since the go.mod is in the util/ directory. But v0.0.1 is gone so why should go get download it? Is it pulling the v0.0.1 off of the proxy even though I have bitbucket.org/orgname/* set in GOPRIVATE? |
Are you sure it is downloading, and not just pulling from the local cache? (That's in either If the repo is private, the public proxy can't possibly have the module cached. (The public proxy does not receive credentials or module content from the |
I deleted the cache. Later today I'm going to setup a public bitbucket repo and try to reproduce this. I'll send you the repo once I get it set up and if it reproduces. |
I took out all the I don't know if this is a bug or just an FAQ. |
@dwschulze, you didn't mention any That could certainly explain it, but we'd need more detail to figure out how that maps to the behavior you observed. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
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?
In my git repo (bitbucket.org) I have
The module directory is a subdirectory of the git repository. The repository is tagged with
v0.0.1
.Here's the go.mod
When I do
go get
for this module I getI can see the
integration-common/util/
directory in bitbucket if I look with the web browser. The go.mod has the contents shown above.What is even more odd is that
go get
does manage to download the other directories in the repository (integration1
andintegration2
). For some reason it thinks thev0.0.1
tag contains all the other directories except for theintegration-common/util
directory, even though bitbucket shows it there for that tag.I download with ssh, not https, because https reqires 2fa on our bitbucket repo. I have this in my ~/.gitconfig:
I know bitbucket is weird when it comes to using go get. Is there something I missed, or is the a bug with go get?
What did you expect to see?
I wanted to see one directory from a repo pulled down.
What did you see instead?
go get
pulled all the other directories instead of the one specifiedThe text was updated successfully, but these errors were encountered: