Skip to content
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

x/tools/gopls: loading locally replaced modules fails due to missing sum entries #65762

Closed
findleyr opened this issue Feb 16, 2024 · 2 comments
Closed
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

Due (I think) to precise pruning in the go command, the fix for #64888 doesn't really work: locally replaced modules may have spurious import errors in packages that are pruned, due to missing go.sum entries. I think I was overfitting to the Kubernetes use-case.

Therefore, we should at least temporarily revert this behavior until we figure out something better. In general, even a locally replaced module must be loaded as a separate build, as only the local go.sum will be complete.

Fortunately, we can just revert the default value of "includeReplaceInWorkspace".

CC @adonovan

@findleyr findleyr added this to the gopls/v0.15.0 milestone Feb 16, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 16, 2024
@gopherbot
Copy link

Change https://go.dev/cl/564558 mentions this issue: gopls/internal/settings: default "includeReplaceInWorkspace" to false

@gopherbot
Copy link

Change https://go.dev/cl/564559 mentions this issue: [gopls-release-branch.0.15] gopls/internal/settings: default "includeReplaceInWorkspace" to false

gopherbot pushed a commit to golang/tools that referenced this issue Feb 16, 2024
…ReplaceInWorkspace" to false

As described in golang/go#65762, treating locally replaced modules the
same as workspace modules doesn't really work, since there will be
missing go.sum entries. Fortunately, this functionality was guarded by
the "includeReplaceInWorkspace" setting. Revert the default value for
this setting.

Fixes golang/go#65762

Change-Id: I521acb2863404cba7612887aa7730075dcfebd96
Reviewed-on: https://go-review.googlesource.com/c/tools/+/564558
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
(cherry picked from commit 3ac77cb)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/564559
Auto-Submit: Robert Findley <rfindley@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants