golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
121.47k stars 17.4k forks source link

x/pkgsite: package removal request for github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity #60232

Closed fortuna closed 1 year ago

fortuna commented 1 year ago

What is the path of the package that you would like to have removed?

github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity

Are you the owner of this package?

Yes

What is the reason that you could not retract this package instead?

Module github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity obscures package outline-connectivity in module github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity. Retracting doesn't seem to work in that case.

bcmills commented 1 year ago

There are two modules involved:

At HEAD, github.com/Jigsaw-Code/outline-internal-sdk/x contains an outline-connectivity package, and github.com/Jigsaw-Code/outline-internal-sdk does not.

What is the concrete problem you are trying to solve, and what is the end state that you want to end up in?

fortuna commented 1 year ago

This is the problem:

$ go run github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity@latest
go: github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity@latest (in github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity@v0.0.0-20230505210647-dbe3f575a4d7):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

When I try to use outline-connectivity, it thinks it's the github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity module, instead of the github.com/Jigsaw-Code/outline-internal-sdk/x module.

I need to get rid of the github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity module, which shouldn't exist in the first place. Go should interpret github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity as a package in the github.com/Jigsaw-Code/outline-internal-sdk/x module instead.

image
bcmills commented 1 year ago

I need to get rid of the github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity module, which shouldn't exist in the first place.

Ah! So, that's supposed to be solvable using retract. (I'd prefer #39007 even more, but haven't gotten much traction on that.)

Here's what I think ought to work:

That should cause go install to skip over the retracted versions of the inner module and fall back to the next-longest module path (the intended x module). Please give that a shot and let me know how it goes.

fortuna commented 1 year ago

It works!

$ go run github.com/Jigsaw-Code/outline-internal-sdk/x/outline-connectivity@latest 
Usage of /var/folders/rt/m2vyf3bd4jvfyl2zbcdrr7xc0010qy/T/go-build1262098280/b001/exe/outline-connectivity:
  -domain string
        Domain name to resolve in the test (default "example.com.")
  -key string
        Outline access key
  -proto string
        Comma-separated list of the protocols to test. Muse be "tcp", "udp", or a combination of them (default "tcp,udp")
  -resolver string
        Comma-separated list of addresses of DNS resolver to use for the test (default "8.8.8.8,2001:4860:4860::8888")
  -v    Enable debug output
exit status 1

For reference, this is the mod file: https://github.com/Jigsaw-Code/outline-internal-sdk/blob/x/outline-connectivity/v0.1.0-retracted/x/outline-connectivity/go.mod

It still shows up as a submodule on the documentation site:

image

But it's mostly cosmetic, since when I click on it, is shows in the right module now:

image
bcmills commented 1 year ago

I'm glad it worked out! Hopefully the Module chip is just some stale indexing in the database — but if it doesn't disappear in a day or two consider filing a separate pkgsite issue for that.

Should we close this issue as resolved? (Are there any other lingering problems from the retraction?)

gopherbot commented 1 year ago

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.)