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: allowModfileModifications when using tempModFile or go.work #51056

Open
findleyr opened this issue Feb 7, 2022 · 3 comments
Open
Labels
gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Member

findleyr commented Feb 7, 2022

govim uses an internal gopls setting: tempModFile, along with allowModfileModifications. This appears to be recently broken, perhaps by https://go.dev/cl/382241.

Reported in slack, from their CI:

&protocol.LogMessageParams{Type:1, Message:"2022/02/07 17:40:55 imports fixes: AllImportsFixes: -modfile is unsupported for this Go version\n\tfile=\"/tmp/go-test-script3721705982/script-initial_open_go/main.go\"\n"}

To begin with, this error message is incorrect, as -modfile is supported.

Needs investigation, and should block gopls@v0.8.0

CC @myitcv @leitzler

@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 7, 2022
@gopherbot gopherbot added this to the Unreleased milestone Feb 7, 2022
@findleyr findleyr added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 7, 2022
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.8.0 Feb 7, 2022
leitzler added a commit to govim/govim that referenced this issue Feb 7, 2022
The previous default value for for the config setting
ExperimentalAllowModfileModifications was "true", which isn't the
default value for gopls.

Enabling this setting causes issues with the new workspace mode in
gopls as described in #1112 and referred golang/go#48186. It also seem
to cause issues in upcoming Go 1.18, see golang/go#51056.

Closes #1112
leitzler added a commit to govim/govim that referenced this issue Feb 7, 2022
The previous default value for for the config setting
ExperimentalAllowModfileModifications was "true", which isn't the
default value for gopls.

Enabling this setting causes issues with the new workspace mode in
gopls as described in #1112 and referred golang/go#48186. It also seem
to cause issues in upcoming Go 1.18, see golang/go#51056.

Closes #1112
leitzler added a commit to govim/govim that referenced this issue Feb 21, 2022
The previous default value for for the config setting
ExperimentalAllowModfileModifications was "true", which isn't the
default value for gopls.

Enabling this setting causes issues with the new workspace mode in
gopls as described in #1112 and referred golang/go#48186. It also seem
to cause issues in upcoming Go 1.18, see golang/go#51056.

Closes #1112
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/388436 mentions this issue: gopls/integration/govim: build gopls using go1.18rc1

gopherbot pushed a commit to golang/tools that referenced this issue Feb 28, 2022
Govim tests expect error messages to use 'any', so build gopls using the
RC.

For golang/go#51056

Change-Id: I0f8cab5d7eea3efbbd5b3f3dd9918e85831c2d50
Reviewed-on: https://go-review.googlesource.com/c/tools/+/388436
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
@findleyr
Copy link
Member Author

I have confirmed that our gopls+govim CI is now passing (after updating our build to use RC1).

I think allowModfileModifications may still be buggy, but that shouldn't block the gopls@v0.8.0 release.

@findleyr findleyr modified the milestones: gopls/v0.8.0, gopls/v0.8.1 Feb 28, 2022
@findleyr findleyr modified the milestones: gopls/v0.8.1, gopls/v0.8.2 Mar 7, 2022
@findleyr findleyr modified the milestones: gopls/v0.8.2, gopls/on-deck Mar 22, 2022
@findleyr findleyr changed the title x/tools/gopls: govim CI broken when using tempModfile+allowModfileModifications x/tools/gopls: allowModfileModifications when using tempModFile or go.work Mar 30, 2022
@findleyr
Copy link
Member Author

Also reported in slack: allowModfileModifications breaks when using go.work:
https://gophers.slack.com/archives/CJZH85XCZ/p1648403482985169?thread_ts=1648402889.084469&cid=CJZH85XCZ

@findleyr findleyr added the gopls/workspace Issues related to support for modules or multi-module workspaces. label May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. 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