Skip to content

Commit 092357f

Browse files
committed
internal/lsp/cache: disable GOPACKAGESDRIVER
In practice, we only support the go command, and now that we rely on the private packagesinternal APIs to set -mod and -modfile, GOPACKAGESDRIVER is actively broken. Forcibly disable it. Change-Id: I91f8c0d29fada2fe87ad9fdfec6ba8c5504c80cd Reviewed-on: https://go-review.googlesource.com/c/tools/+/268977 Trust: Heschi Kreinick <[email protected]> Run-TryBot: Heschi Kreinick <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent f6c1dd6 commit 092357f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/lsp/cache/snapshot.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,14 @@ func (s *snapshot) config(ctx context.Context, inv *gocommand.Invocation) *packa
190190
verboseOutput := s.view.options.VerboseOutput
191191
s.view.optionsMu.Unlock()
192192

193+
// Forcibly disable GOPACKAGESDRIVER. It's incompatible with the
194+
// packagesinternal APIs we use, and we really only support the go commmand
195+
// anyway.
196+
env := append(append([]string{}, inv.Env...), "GOPACKAGESDRIVER=off")
193197
cfg := &packages.Config{
194198
Context: ctx,
195199
Dir: inv.WorkingDir,
196-
Env: inv.Env,
200+
Env: env,
197201
BuildFlags: inv.BuildFlags,
198202
Mode: packages.NeedName |
199203
packages.NeedFiles |

0 commit comments

Comments
 (0)