golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.78k stars 727 forks source link

vscgo: retract the vscgo "module" #3420

Closed hyangah closed 2 weeks ago

hyangah commented 3 weeks ago

Problem: https://pkg.go.dev/github.com/golang/vscode-go/vscgo shows the old unversioned vscgo. Moreover, go install github.com/golang/vscode-go/vscgo@latest picks up an old version of vscgo.

What happened?: Before we restructured the repo struct and settled in the current shape , there was a brief period of time that we had a go.mod file under github.com/golang/vscode-go/vscgo directory (golang/vscode-go@b01b0b7).

  vscode-go (go.mod)
      + ...other code...
      + vscgo (go.mod)

In mid Jan, we moved the vscgo package to the github.com/golang/vscode-go module, and moved the extension code to a separate module. https://github.com/golang/vscode-go/issues/3122 The following is the current state of this project

  vscode-go (go.mod)
      + vscgo
      + extension (go.mod)
      + docs (go.mod)
              ...other code...

It's an oversight that we didn't retract the (short-lived) vscgo module during the transition. It isn't an issue since the released extension always installs a specific version of vscgo like:

go install github.com/golang/vscode-go/vscgo@v0.41.3

In that case, the go command does the right thing.

Unfortunately, the short-lived vscgo module was already seen by the proxy.golang.org - https://proxy.golang.org/github.com/golang/vscode-go/vscgo/@latest which returns v0.0.0-20240105193802-b01b0b756e58

As a result, if someone runs go install github.com/golang/vscode-go/vscgo@latest with the default GOPROXY (proxy.golang.org), the go command will pick up this old copy of the vscgo module and install the old version of vscgo tool.

pkg.go.dev also thinks currently there are two modules offering the vscgo package, and prefers the old version. That is not what we want.

How to fix it:

We need to properly retract the github.com/golang/vscode-go/vscgo module. Note: we still use the vscgo package (in github.com/golang/vscode-go module)

Follow the instruction in https://github.com/golang/go/issues/67567#issuecomment-2141056340

Option 1)

  1. Add back the go.mod file in github.com/golang/vscode-go/vscgo
  2. Add a retract directive to the go.mod. Tag v0.0.1-deprecated and make sure it's seen by proxy.golang.org.
  3. Remove go.mod file. --> Cons: this will create the unnecessary churn in the main branch.

Option 2)

  1. Create a branch (e.g. vscgo-v0.0.1-deprecated)
  2. Commit a change that bring back go.mod with retract.
  3. Tag the branch with vscgo/v0.0.1-deprecated, and forget about the branch. --> Cons: we will need to create a temporary branch.

If the option 2 works, I think it is better (not leaving the trace in the main branch)

cc @suzmue

gopherbot commented 3 weeks ago

Change https://go.dev/cl/591158 mentions this issue: vscgo: retract the vscgo module

gopherbot commented 3 weeks ago

Change https://go.dev/cl/591159 mentions this issue: Revert "vscgo: retract the vscgo module"

gopherbot commented 2 weeks ago

Change https://go.dev/cl/591755 mentions this issue: vscgo: deprecate github.com/golang/vscode-go/vscgo "module"

nightlyone commented 2 weeks ago

@hyangah I missed the discussion why this is happening. Could you please point me to the discussion?

The linked issue only seems to explain how to do depublish unintentionally published code, not why this tool is being retracted.

hyangah commented 2 weeks ago

@nightlyone Sorry that I omitted the detail. I just updated the issue description.

Note: the tool is not getting retracted. We are retracting the module. Our intention is to move more extension's logic to the vscgo tool (e.g. tools update and installation), and keep the TS/JS code minimal.

hyangah commented 2 weeks ago

This is done. Still pkgsite doesn't display the doc due to license check failure, but that's a separate issue.