syzkaller icon indicating copy to clipboard operation
syzkaller copied to clipboard

mod: bump golang.org/x/tools from 0.14.0 to 0.18.0

Open dependabot[bot] opened this issue 1 year ago • 8 comments

Bumps golang.org/x/tools from 0.14.0 to 0.18.0.

Release notes

Sourced from golang.org/x/tools's releases.

gopls/v0.15.0-pre.3

These are release notes for a prerelease version of gopls. v0.15.0 will be released soon, but please try the prerelease if you can!

go install golang.org/x/tools/[email protected]

This release introduces "zero config" gopls, which is a set of heuristics allowing gopls to Do The Right Thing when you open a Go file. We believe this addresses the two largest pain points we hear about from our users: difficulty configuring multi-module repositories, and working on multiple GOOS/GOARCH combinations. However, this is a large change to the way gopls models your workspace, and the dynamic loading/unloading of builds may be surprising in some cases. Your feedback on this new feature is greatly appreciated. See below for more details.

New Features

Simpler workspace configuration and improved build tag support

The headline feature of this release is a rewrite of gopls's logic for associating files with build configurations that enables gopls to give accurate answers when navigating almost any Go source file on your machine.

Most features of gopls rely on type information, which comes not from the file in isolation but depends on the relationship between the file and the other files in its package, and between the package and all its dependencies; this in turn depends on go.mod and go.work files. In effect, gopls needs to decide which go build command--which working directory, package arguments, GOOS, GOARCH, build tags, and so on--would cause each file to be processed by the compiler.

Previous versions of gopls only allowed one build per workspace folder, and users had to be careful to configure the right workspace root and build environment. As a result, users often encountered confusing error messages when they opened the wrong directory, or a file that was tagged for a different operating system or architecture--the dreaded "No packages found" error. This situation was improved by the introduction of go.work files, but still required configuration and a preexisting understanding of the code being edited.

With this release, gopls now allows multiple builds per workspace, and uses heuristics to automatically derive the set of active builds. Gopls will ensure that an active build contains every module with an open file in your workspace, adding new builds and GOOS/GOARCH combinations as needed to cover files that don't match the host operating system or architecture.

For example, suppose we had a repository with three modules: moda, modb, and modc, and a go.work file using modules moda and modb. If we open the files moda/a.go, modb/b.go, moda/a_windows.go, and modc/c.go, gopls will automatically create three builds:

Zero Config

In some cases this may cause gopls to do more work, since gopls is now tracking three builds instead of one. However, the scalability redesign we first announced in v0.12 allows us to avoid most of this work by efficient caching in a persistent store.

So, all gopls' navigation, query, analysis, and refactoring features should work equally well in both files. Notably, you'll see compiler diagnostics for the appropriate build in real time, making it much easier to make changes to cross-platform code.

Preview refactoring edits

Refactoring code actions now support resolving edits. This update enables features like code action previews within VS Code (triggered by Ctrl+Enter).

Refactor preview in VS Code

To take advantage of this new gopls feature, clients must register support via:

{
	"textDocument": {
		"codeAction": {
			"dataSupport": true,
			"resolveSupport": {
				"properties": ["edit"]
			}
		}
	}
}

Analysis & diagnostics

... (truncated)

Commits
  • c5643e9 gopls/internal/server: fix two bugs related to dynamic configuration
  • 50b4f1b gopls/internal/golang: close open file
  • f0ef3c6 gopls: update x/telemetry dependency to fix crash
  • 8cf0a8e gopls: record that v0.15 will be the last to support go1.18
  • 730dc3c gopls/internal/settings: add a hidden option to disable zero config
  • 95f04f4 gopls/internal/golang: add resolve support for inline refactorings
  • 9619683 gopls/internal/cache: treat local replaces as workspace modules
  • a5af84e gopls/internal/cache: check views on any on-disk change to go.mod files
  • a7407fa gopls: update telemetry
  • 314368d go/analysis/passes/deepequalerrors: audit for types.Alias safety
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

dependabot[bot] avatar Feb 14 '24 12:02 dependabot[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 62.7%. Comparing base (23536c2) to head (b47a63f). Report is 17 commits behind head on master.

:exclamation: Current head b47a63f differs from pull request most recent head 2529918. Consider uploading reports for the commit 2529918 to get more accurate results

Additional details and impacted files

see 37 files with indirect coverage changes

codecov[bot] avatar Feb 14 '24 13:02 codecov[bot]

@dependabot rebase

tarasmadan avatar Feb 15 '24 14:02 tarasmadan

Looks like this PR has been edited by someone other than Dependabot. That means Dependabot can't rebase it - sorry!

If you're happy for Dependabot to recreate it from scratch, overwriting any edits, you can request @dependabot recreate.

dependabot[bot] avatar Feb 15 '24 14:02 dependabot[bot]

@dependabot recreate

tarasmadan avatar Feb 15 '24 14:02 tarasmadan

This PR makes me crazy. 2 equivalent ci/build tests return different result. Can we read it as a golangci-lint flakiness proof?

@a-nogikh , wdyt?

tarasmadan avatar Feb 15 '24 20:02 tarasmadan

Not just flakiness (it's not that the linter tests pass/fail), but a bug in the linter implementation.

anic during analysis: runtime error: index out of range [1] with length 1, goroutine 17375 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x5e
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105

a-nogikh avatar Feb 15 '24 20:02 a-nogikh

Yes. I meant golangci-lint bug flakiness... One day I'll try to disable this linter once more. Previously used way to disable it didn't work.

tarasmadan avatar Feb 16 '24 10:02 tarasmadan

The beautified log:

level=error msg="[linters_context/goanalysis] nilness: panic during analysis: runtime error: index out of range [1] with length 1, goroutine 17375 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x5a
panic({0x174db40?, 0xc0018804e0?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
honnef.co/go/tools/analysis/facts/nilness.impl.func1({0x1a6d358, 0xc00b0b8000})
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/honnef.co/go/tools/analysis/facts/nilness/nilness.go:160 +0x891
honnef.co/go/tools/analysis/facts/nilness.impl.func1({0x1a6d288, 0xc00b09cc80})
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/honnef.co/go/tools/analysis/facts/nilness/nilness.go:147 +0x8e7
honnef.co/go/tools/analysis/facts/nilness.impl(0xc00ed2f2b0, 0xc00585c3c0, 0xc00bd2dcb8)
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/honnef.co/go/tools/analysis/facts/nilness/nilness.go:246 +0x348
honnef.co/go/tools/analysis/facts/nilness.run(0xc00ed2f2b0)
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/honnef.co/go/tools/analysis/facts/nilness/nilness.go:66 +0x110
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc00627e730)
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:195 +0x9d6
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:113 +0x17
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc001783090, {0x17c443e, 0x7}, 0xc005936748)
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc001cb3860?)
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:112 +0x7a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc00627e730)
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xa8
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 4085
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x205
"

tarasmadan avatar Feb 16 '24 11:02 tarasmadan

@dependabot recreate

tarasmadan avatar Mar 05 '24 12:03 tarasmadan

Superseded by #4555.

dependabot[bot] avatar Mar 05 '24 12:03 dependabot[bot]