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

vimPlugins: vim-go: make gocode, gocode-mod and keyify available to it #49815

Merged
merged 4 commits into from
Nov 6, 2018

Conversation

kalbasit
Copy link
Member

@kalbasit kalbasit commented Nov 6, 2018

Motivation for this change

This is a continuation of #49669, it seems that I have missed the gocode-gomod binary and I forgot to add gocode and go-tools to the vim-go path.

With regards to the sed change, initially, I patched go#path#CheckBinPath() which is called anytime a binary is called. However, there's also this call left unpached that can cause confusion if the user runs :GoInstallBinaries as it won't see the nix-store paths. In this PR, I decided to patch go#config#BinPath() which is called by any call out to a binary. As an added bonus, this patch patches the default go_bin_path, so a user can simply let g:go_bin_path="..." from the vimrc to override it.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

cc @Mic92

@kalbasit
Copy link
Member Author

kalbasit commented Nov 6, 2018

@GrahamcOfBorg build gocode gocode-gomod vimPlugins.vim-go

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gocode, gocode-gomod

Partial log (click to expand)

checking for references to /build in /nix/store/1l6xa9angm47jsi0ipaap8yzqsm9dp2d-gocode-gomod-unstable-2018-10-16-bin...
shrinking /nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin/bin/gocode
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin/bin
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin
checking for references to /build in /nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin...
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
/nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin
/nix/store/1l6xa9angm47jsi0ipaap8yzqsm9dp2d-gocode-gomod-unstable-2018-10-16-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gocode, gocode-gomod

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin
shrinking /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin/bin/gocode-gomod
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin/bin
patching script interpreter paths in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin
checking for references to /build in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin...
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
/nix/store/z6q3k7k8sbzy7v9qh839cy5bsr50j7dh-gocode-unstable-2018-11-05-bin
/nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin

@@ -261,6 +261,9 @@ with generated;
asmfmt
delve
errcheck
go-tools
gocode
gocode-gomod
Copy link
Member

@Mic92 Mic92 Nov 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does gocode-gomode? It looks a bit like gocode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was taken by this as well. gocode-gomod is a fork of gocode with support for Go modules. Unfortunately, neither project can replace the other!

See gocode README https://github.com/mdempsky/gocode#githubcommdempskygocode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is vim-go smart enough to switch between the too?

Copy link
Member Author

@kalbasit kalbasit Nov 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is. it installs it here and uses it here.

@Mic92 Mic92 merged commit bd21116 into NixOS:master Nov 6, 2018
@kalbasit kalbasit deleted the nixpkgs_fix-vim-go branch November 6, 2018 17:31
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gocode, gocode-gomod, vimPlugins.vim-go

Partial log (click to expand)

  /nix/store/dycgvqypzwg0dzbl07ji39m3n9kcvl28-motion-4.1.1
  /nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin
copying path '/nix/store/1l6xa9angm47jsi0ipaap8yzqsm9dp2d-gocode-gomod-unstable-2018-10-16-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/191afq418k7k9z1a1gwyp2chzs2wmd9z-ffmpeg-3.4.4' from 'https://cache.nixos.org'...
copying path '/nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/dycgvqypzwg0dzbl07ji39m3n9kcvl28-motion-4.1.1' from 'https://cache.nixos.org'...
copying path '/nix/store/1jikdhdi3aaippcnsbd4s4f1n6wx53jm-vimplugin-vim-go-2018-10-23' from 'https://cache.nixos.org'...
/nix/store/z5iay2slghni7982p78a1knwc4plh16m-gocode-unstable-2018-11-05-bin
/nix/store/1l6xa9angm47jsi0ipaap8yzqsm9dp2d-gocode-gomod-unstable-2018-10-16-bin
/nix/store/1jikdhdi3aaippcnsbd4s4f1n6wx53jm-vimplugin-vim-go-2018-10-23

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gocode, gocode-gomod

The following builds were skipped because they don't evaluate on aarch64-linux: vimPlugins.vim-go

Partial log (click to expand)

patching script interpreter paths in /nix/store/z6q3k7k8sbzy7v9qh839cy5bsr50j7dh-gocode-unstable-2018-11-05-bin
checking for references to /build in /nix/store/z6q3k7k8sbzy7v9qh839cy5bsr50j7dh-gocode-unstable-2018-11-05-bin...
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin/bin
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin
checking for references to /build in /nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin...
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
/nix/store/z6q3k7k8sbzy7v9qh839cy5bsr50j7dh-gocode-unstable-2018-11-05-bin
/nix/store/alrgx14aaq63cvgblbw9vbivhpip7sv2-gocode-gomod-unstable-2018-10-16-bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants