Dear Maintainer,
When using vim-youcompleteme, the environment set GOPATH and PATH are ignored
for gopls. When opening test.go I receive the following error:
FileNotFoundError: [Errno 2] No such file or directory: '/home/kyle/go/bin/gopls'
This can only be resolved by linking $GOPATH/bin/gopls to
~/go/bin/gopls.
I can replicate this with vim-youcompleteme being the only plugin
installed (moving ~/.vim/bundle to ~/.vim/bundle.bak).
Output of ':! goenv' (within vim)
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/kyle/.cache/go-build"
GOENV="/home/kyle/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/kyle/projects/.go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/kyle/projects/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1862550245=/tmp/go-build -gno-record-gcc-switches"
gopls version:
golang.org/x/tools/gopls v0.6.6
golang.org/x/tools/gopls@v0.6.6 h1:GmCsAKZMEb1BD1BTWnQrMyx4FmNThlEsmuFiJbLBXio=
.vimrc:
execute pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
let g:go_echo_command_info = 1
Hi,
README.Debian file says, as in: pick it up from ~/go/bin/gopls. So, this
is technically not a bug, but documented behaviour… close kthxbye ;P
Note that Debian has gopls packaged in the meantime[1], but I was too
late to notice it, so a patch to that effect (and a few more) is what
I dabble at while the freeze is ongoing, so at least that should be
picked up auto-magically in the future.
If you could provide a (modified) patch to look at GOPATH first that
would be nice. I don't have experience with Go apart from doing what the
README said back than I adopted this package(set) and a smoke test so
someone with actual go experience who can tell if its working would be
cool!
I think what we should arrive at is configured-path or /usr/bin/gopls¹ or
$GOPATH/bin/gopls or ~/go/bin/gopls (although that is probably the
default of $GOPATH). Upstream isn't going to be interested in any of
this though, as you see in the patch they just use the binary they embed
like they do for all the other things™, but I have already resigned to
*go* a patch-heavy approach with these packages here so that is fine.
(¹ or actually search in all of PATH now that I wrote this…)
Apropos configured-path: As you use vim you can use the option
`g:ycm_gopls_binary_path` to explicitly set your chosen path.
You could also modify `/usr/lib/ycmd/ycmd/default_settings.json`, but
that would be overridden by the next ycmd install (and is not used as
you would think by all clients; I patched vim-youcompleteme to pick
settings from there in Debian, but upstream refused it).
Hope that helps for the short term (and stable) as I don't think the
release team will be happy to accept patches for bugs which are
technically documented behaviour at this stage.
Best regards
David Kalnischkies
[0] https://salsa.debian.org/debian/ycmd/-/blob/master/debian/patches/03-go-use-home-gopls.patch
[1] I am not too sure which version that is though. I got the ycmd
testsuite mostly running earlier this week, but the go part is still
mostly red. I hope it is just 'not the version upstream wrote their
tests again' (as with clangd) but I haven't got that far in testing.
Hi, :P I definitely should have read README.Debian Sure, I'm having a look at it. It seems the FindExecutableWithFallback only expects 1 fallback, so it will need some modification to ShouldEndableGoCompleter() and GoCompleter(). I think the hierarchy you have described is correct (with PATH search over /usr/bin/gopls). If I get a chance, I can take a look. No promises on the time-frame though
We believe that the bug you reported is fixed in the latest version of
ycmd, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 989722@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
David Kalnischkies <donkult@debian.org> (supplier of updated ycmd package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 09 Jun 2022 19:11:33 +0200
Source: ycmd
Architecture: source
Version: 0+20220401+gitdbe806f+ds-1
Distribution: unstable
Urgency: medium
Maintainer: David Kalnischkies <donkult@debian.org>
Changed-By: David Kalnischkies <donkult@debian.org>
Closes: 989722 990466
Changes:
ycmd (0+20220401+gitdbe806f+ds-1) unstable; urgency=medium
.
* New upstream version 0+20220401+gitdbe806f+ds
- Refresh patches & drop backported upstream patches
- Remove python3-requests dep
- Remove python3-waitress dep
- Add libabsl-dev dep and use it
- Upstream Core-Version is now 45, drop 42 compat
- Update copyright for upstream release
* Drop unused imports from default ycm_extra_conf.py (Closes: #990466)
* Support and use packaged gopls if available (Closes: #989722)
* Suggests all supported completion servers
* Use gmock (and gtest) instead of googletest package
* Use upstream unittest as autopkgtest
* Bump Standards-Version to 4.6.1 (no change needed)
* Override dh_makeshlibs to avoid ldconfig trigger activation
Checksums-Sha1:
b2f3d2334a7f409e897f8144b8ca99773cfd3e5f 2323 ycmd_0+20220401+gitdbe806f+ds-1.dsc
cc8849d0cfcab65db406f65426a54a04ff601d86 388052 ycmd_0+20220401+gitdbe806f+ds.orig.tar.xz
6978a3d9cf04fbcfd3c0e193ee1e1b9615ce8e2b 23692 ycmd_0+20220401+gitdbe806f+ds-1.debian.tar.xz
96d95b2f306d2e964f5150843acc7b070e92fc8b 8535 ycmd_0+20220401+gitdbe806f+ds-1_amd64.buildinfo
Checksums-Sha256:
eecf5e32e096c97efe80d0c174ee6c9efd113ecbb0c1d6047e869bd565194c44 2323 ycmd_0+20220401+gitdbe806f+ds-1.dsc
a930bfd5eeaeee87fa232827ba60aed247946026557b0ca2466b8b65f0c5ddea 388052 ycmd_0+20220401+gitdbe806f+ds.orig.tar.xz
e296400c7eb7208124e232ac6807b90d8e4c6ef3887c3fea1f933383425d5788 23692 ycmd_0+20220401+gitdbe806f+ds-1.debian.tar.xz
5f45a96f7356dfdd43c5f181ffbcfe75a1d7f1c76a016cdde214fbe411745bff 8535 ycmd_0+20220401+gitdbe806f+ds-1_amd64.buildinfo
Files:
6b5f39a1faaf2c356038603e133ca969 2323 devel optional ycmd_0+20220401+gitdbe806f+ds-1.dsc
e7a5040bd8e9cdaaa37f5b50508ff9ee 388052 devel optional ycmd_0+20220401+gitdbe806f+ds.orig.tar.xz
f2f36ff242ed523e848d9a10b52f3449 23692 devel optional ycmd_0+20220401+gitdbe806f+ds-1.debian.tar.xz
7fea9d0e7da0e48ddef33d79bd61c932 8535 devel optional ycmd_0+20220401+gitdbe806f+ds-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJHBAEBCgAxFiEE5sn+Q4uCja/tn0GrMRvlz3HQeIMFAmKid94THGRvbmt1bHRA
ZGViaWFuLm9yZwAKCRAxG+XPcdB4g2oVD/0aXBXiqTpQKOh0wnQ4myjZjBYSWWD+
j8PO+YVUl5oM+pleKDaSNSy8TZKQb/nY94F8RzmbdTsQ6oho23TwniTfzakOv5s/
wI93p9dNV6Iyhwv1lRgKAlF8gfWMzLDABkchK34Rqj4IwBOWUJzx6FrLKV7UycOX
mY62ERkhXjyHQ5QbrORLd3sDEIyptJJekUZPC3mpBXbocuElg5n58qCRM/ZFNI1k
JawERk0a5GYPwbeQbUpeYRriTg5IsQb7GjbKCcHfscDL9vSDquVqZuZN/Qe1UjwQ
sjWYSmHXYqkyWF3LYoVJfkQqwCDYQteprYPYdNivEUurgWeouUEUaReXdYkYkLfa
/PCmo/T4pYCWUCRXU0NXKz1GaJY8RWdmzeb0ytKdy06NxM3vK3+lF8MRxYaJKnfL
k1+g7oveaR+WHg8duAgiaTxeKXzf7C5F4QaxPb2de67LvftV9KO1cRrumuEy0IGe
sILHVllTvjJAS03Az9W1KlcvfRjt4BujYmMsHFZh/aa/S1BCKAkvV/KFFx8DHZSQ
p+kkvEANc1V/DunYGcKfet1htJ4q0oHCywNP9+WzWG7afPGKVHGurMMETpQDTq3W
1m/gPvDBcZZ0oigAuk6Hd4oZGb5LQoLIUqn0nRLinaABSJezACoEoBRdUYA6PRNv
6as0dzshzY+DyQ==
=USn3
-----END PGP SIGNATURE-----