Debian Patches

Status for gopls/2:0.16.1+ds-1

Patch Description Author Forwarded Bugs Origin Last update
0009-Skip-internal-gcimporter-TestStdlib.patch Skip internal/gcimporter TestStdlib
gopls/doc/generate.go:33:2: cannot find package "github.com/jba/printsrc" in any of:
/usr/lib/go-1.19/src/github.com/jba/printsrc (from $GOROOT)
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/jba/printsrc (from $GOPATH)
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/golang.org/x/tools/gopls/doc/generate.go:33:2: could not import github.com/jba/printsrc (invalid package name: "")
stdlib_test.go:52: there were errors during loading
Shengjing Zhu <zhsj@debian.org> not-needed 2023-02-07
0010-Set-GO111MODULE-auto-in-tests.patch Set GO111MODULE=auto in tests Shengjing Zhu <zhsj@debian.org> no 2023-08-03
0001-Make-godoc-support-symlinks.patch Make godoc support symlinks.

Due to the FHS, we use a symlink from /usr/share/golang/src to
/usr/lib/golang/src, but godoc does not support that.

See also https://groups.google.com/forum/#!topic/golang-nuts/396pWLsz-WI
Dmitry Azhichakov <dmitry@dsa.pp.ru> yes 2020-11-17
0002-Disable-static-files-for-present-cmd.patch Disable static files for present cmd
This path is debian-specific, hence this patch cannot go upstream.
=?utf-8?q?Mart=C3=ADn_Ferrari?= <tincho@debian.org> not-needed 2020-11-17
0003-Disable-embedding-static-files-for-godoc-cmd.patch Disable embedding static files for godoc cmd
This path is debian-specific, hence this patch cannot go upstream.


Original authors:
+ Martín Ferrari <tincho@debian.org>
+ Anthony Fok <foka@debian.org>
Shengjing Zhu <zhsj@debian.org> not-needed 2020-11-17
0004-Support-mips-in-testdata-in-go-analysis-passes-atomi.patch Support mips in testdata in go/analysis/passes/atomicalign
but mips/mipsle are missing.
Debian Go Packaging Team <team+pkg-go@tracker.debian.org> no 2020-11-17
0005-Skip-cmd-godoc-TestURL.patch Skip cmd/godoc TestURL

If golang-doc is not present, the start page for godoc does not contain the
text expected in tests.
=?utf-8?q?Mart=C3=ADn_Ferrari?= <tincho@debian.org> not-needed vendor 2019-07-29
0006-Skip-cmd-stringer-e2e-test.patch Skip cmd/stringer e2e test

Seems like 'go build' can't work offline:
Arnaud Rebillout <arnaud.rebillout@collabora.com> not-needed vendor 2023-02-07
0007-Skip-go-packages-TestLoadOverlayGoMod.patch Skip go/packages TestLoadOverlayGoMod The TestLoadOverlayGoMod test needs to be in modules mode
to give correct results.
.
Fixes "Load:
got [_/<<PKGBUILDDIR>>/_build/src/golang.org/x/tools/go/packages/testdata],
want [./testdata]" error in GOPATH mode.
Anthony Fok <foka@debian.org> not-needed vendor 2024-08-02
0008-Skip-go-packages-TestOverlaysInReplace.patch Skip go/packages TestOverlaysInReplace
Needs go mod
Shengjing Zhu <zhsj@debian.org> not-needed 2020-11-17
0011-Set-GO111MODULE-on-to-fix-TestExampleSeparateAnalysi.patch Set GO111MODULE=on to fix TestExampleSeparateAnalysis
Fixes the following error when GO111MODULE=off:

invoke.go:265: 40.546052ms for GOROOT= GOPATH=/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu GO111MODULE=off GOPROXY=off PWD=/tmp/TestExampleSeparateAn
alysis4090709764/001 go list -e -f {{context.ReleaseTags}} -- unsafe
invoke.go:265: 35.954687ms for GOROOT= GOPATH=/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu GO111MODULE=off GOPROXY=off PWD=/tmp/TestExampleSeparateAn
alysis4090709764/001 go list -e -json=Name,ImportPath,Error,Dir,GoFiles,IgnoredGoFiles,IgnoredOtherFiles,CFiles,CgoFiles,CXXFiles,MFiles,HFiles,FF
iles,SFiles,SwigFiles,SwigCXXFiles,SysoFiles,CompiledGoFiles,Export,DepOnly,Imports,ImportMap,Module -compiled=true -test=false -export=false -dep
s=true -find=false -pgo=off -- separate/main
/usr/lib/go-1.21/src/separate/main (from $GOROOT)
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/separate/main (from $GOPATH)
separate_test.go:105: there were errors among loaded packages
Anthony Fok <foka@debian.org> no 2023-10-14
0012-internal-refactor-inline-Skip-tests-failing-to-impor.patch internal/refactor/inline: Skip tests failing to import "testdata/{a,b}"

For example:

=== NAME Test/revdotimport.txtar
inline_test.go:68: b/b.go:3:8: cannot find package "testdata/a" in any of:
/usr/lib/go-1.21/src/testdata/a (from $GOROOT)
/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/go/src/testdata/a (from $GOPATH)
inline_test.go:68: /tmp/Testrevdotimport.txtar1884530485/001/b/b.go:3:8: could not import testdata/a (invalid package name: "")
inline_test.go:68: c/c.go:4:8: cannot find package "testdata/b" in any of:
/usr/lib/go-1.21/src/testdata/b (from $GOROOT)
/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/go/src/testdata/b (from $GOPATH)
inline_test.go:68: /tmp/Testrevdotimport.txtar1884530485/001/c/c.go:3:10: could not import testdata/a (invalid package name: "")
inline_test.go:68: /tmp/Testrevdotimport.txtar1884530485/001/c/c.go:4:8: could not import testdata/b (invalid package name: "")
inline_test.go:68: /tmp/Testrevdotimport.txtar1884530485/001/c/c.go:7:2: undefined: A
inline_test.go:124: doInlineNote /tmp/Testrevdotimport.txtar1884530485/001/c/c.go:8:11
inline_test.go:126: /tmp/Testrevdotimport.txtar1884530485/001/c/c.go:8:11: @inline(B, result): cannot inline: not a static call
...
--- FAIL: Test (0.67s)
--- PASS: Test/comments.txtar (0.12s)
--- PASS: Test/basic-reduce.txtar (0.03s)
--- PASS: Test/err-shadow-pkg.txtar (0.19s)
--- PASS: Test/basic-literal.txtar (0.08s)
--- FAIL: Test/revdotimport.txtar (0.13s)
--- PASS: Test/n-ary.txtar (0.15s)
--- PASS: Test/method.txtar (0.19s)
--- FAIL: Test/internal.txtar (0.22s)
--- PASS: Test/exprstmt.txtar (0.09s)
--- FAIL: Test/import-shadow.txtar (0.21s)
--- PASS: Test/err-shadow-builtin.txtar (0.42s)
--- FAIL: Test/err-unexported.txtar (0.74s)
--- PASS: Test/err-basic.txtar (0.73s)
--- FAIL: Test/dotimport.txtar (0.63s)
--- PASS: Test/basic-err.txtar (3.86s)
--- FAIL: Test/crosspkg.txtar (4.73s)

These tests still fail despite removing the typo "GO111MODULES=on"
to "GO111MODULE=on", so I decided to simply remove the failing *.txtar
test files.
Anthony Fok <foka@debian.org> no 2023-11-06
0013-Fix-typo-GO111MODULES-GO111MODULE.patch Fix typo GO111MODULES -> GO111MODULE Shengjing Zhu <zhsj@debian.org> no 2023-11-21
1000-Skip-gopls-internal-licenses-TestLicenses.patch Skip gopls/internal/licenses TestLicenses Shengjing Zhu <zhsj@debian.org> not-needed 2024-08-09
1001-Skip-gopls-internal-lsp-cmd-TestCapabilities.patch Skip gopls/internal/cmd TestCapabilities
Needs go mod
Shengjing Zhu <zhsj@debian.org> not-needed 2023-02-07
1002-Skip-gopls-internal-lsp-cmd-TestRename-and-TestStats.patch Skip gopls/internal/cmd TestRename and TestStats

TestRename's "in 'package' identifier" subtest expects the error message

gopls: cannot rename package: module path "example.com" is the same as
the package path, so renaming the package directory would have no effect

but when GO111MODULE=off, gets an alternative error message instead:

gopls: cannot rename package: missing module information for package "_."

Similarly, TestStats gives different counts when GO111MODULE=off:

stats.WorkspaceStats.Views[0].WorkspaceModules = 0, want 1
stats.WorkspaceStats.Views[0].WorkspacePackages = 1, want 2
Anthony Fok <foka@debian.org> not-needed vendor 2023-06-26
1003-Skip-TestTemplates-in-gopls-internal-debug-template_.patch Skip TestTemplates in gopls/internal/debug/template_test.go
(needs golang-github-jba-templatecheck-dev which is not yet packaged)
Anthony Fok <foka@debian.org> no 2023-12-27
1004-Set-GO111MODULE-on-for-TestExecute-and-TestCodeLens.patch Set GO111MODULE=on for TestExecute and TestCodeLens Anthony Fok <foka@debian.org> no 2023-12-30
1005-Set-GO111MODULE-auto-for-TestZeroConfigAlgorithm.patch Set GO111MODULE=auto for TestZeroConfigAlgorithm
Debian dh-golang is currently still using GO111MODULE=off
which confuses many tests TestZeroConfigAlgorithm.

Full test log:

=== RUN TestZeroConfigAlgorithm
=== RUN TestZeroConfigAlgorithm/basic_go.work_workspace
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
}
=== RUN TestZeroConfigAlgorithm/basic_go.mod_workspace
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
}
=== RUN TestZeroConfigAlgorithm/basic_GOPATH_workspace
=== RUN TestZeroConfigAlgorithm/basic_AdHoc_workspace
=== RUN TestZeroConfigAlgorithm/multi-folder_workspace
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "a",
Env: nil,
},
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "b",
Env: nil,
},
}
=== RUN TestZeroConfigAlgorithm/multi-module_workspace
=== RUN TestZeroConfigAlgorithm/zero-config_open_module
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{Type: s"AdHocView", Root: "."},
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "a",
Env: nil,
},
}
=== RUN TestZeroConfigAlgorithm/zero-config_open_modules
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{Type: s"AdHocView", Root: "."},
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "a",
Env: nil,
},
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "b",
Env: nil,
},
}
=== RUN TestZeroConfigAlgorithm/unified_workspace
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
+ {Type: s"AdHocView", Root: "a"},
+ {Type: s"AdHocView", Root: "b"},
}
=== RUN TestZeroConfigAlgorithm/go.work_from_env
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
+ {Type: s"AdHocView", Root: "a"},
+ {Type: s"AdHocView", Root: "b"},
}
=== RUN TestZeroConfigAlgorithm/independent_module_view
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
+ {Type: s"AdHocView", Root: "a"},
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "b",
- Env: []string{"GOWORK=off"},
+ Env: nil,
},
}
=== RUN TestZeroConfigAlgorithm/multiple_go.work
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
- Root: "b",
+ Root: "a",
Env: nil,
},
+ {Type: s"AdHocView", Root: "b"},
+ {Type: s"AdHocView", Root: "b/c"},
}
=== RUN TestZeroConfigAlgorithm/multiple_go.work,_c_unused
session_test.go:281: selectViews() mismatch (-want +got):
[]cache.viewSummary{
{
- Type: s"GoWorkView",
+ Type: s"AdHocView",
Root: ".",
Env: nil,
},
+ {Type: s"AdHocView", Root: "a"},
+ {Type: s"AdHocView", Root: "b"},
{
- Type: s"GoModView",
+ Type: s"AdHocView",
Root: "b/c",
- Env: []string{"GOWORK=off"},
+ Env: nil,
},
}
Anthony Fok <foka@debian.org> no 2024-02-04

All known versions for source package 'gopls'

Links