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: Refactor coc-* plugins and fix coc-go #96993

Merged
merged 4 commits into from Sep 4, 2020

Conversation

@jbaum98
Copy link
Contributor

@jbaum98 jbaum98 commented Sep 3, 2020

Motivation for this change

I had an issue getting coc-go to work.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Result of nixpkgs-review 1

25 packages built:
- vimPlugins.Tagbar (vimPlugins.tagbar)
- vimPlugins.clang_complete
- vimPlugins.coc-explorer
- vimPlugins.coc-go
- vimPlugins.coc-markdownlint
- vimPlugins.completion-nvim
- vimPlugins.csv (vimPlugins.csv-vim)
- vimPlugins.denite (vimPlugins.denite-nvim)
- vimPlugins.deol-nvim
- vimPlugins.nvim-lspconfig
- vimPlugins.nvim-treesitter
- vimPlugins.polyglot (vimPlugins.vim-polyglot)
- vimPlugins.vim-clap
- vimPlugins.vim-dirvish
- vimPlugins.vim-floaterm
- vimPlugins.vim-flutter
- vimPlugins.vim-html-template-literals
- vimPlugins.vim-lsp
- vimPlugins.vim-monokai
- vimPlugins.vim-sneak
- vimPlugins.vim-test
- vimPlugins.vim-vsnip
- vimPlugins.vimspector
- vimPlugins.vimtex
- vimPlugins.zenburn
Jake Waksbaum added 3 commits Sep 3, 2020
There are 32 vim plugins, all related to the coc.nvim LSP plugin, that
are actually node packages and are included in nodePackages. In #82578,
those vim plugins were made to point at the corresponding node packages,
which fixed issues where the sources weren't being compiled properly
with Javascript build systems.

The way each of those vim plugins wraps its corresponding node package
is identical, so I factored that out into a function and eliminated the
duplication.

In addition, for some reason coc-go got missed, which led to it not
working correctly for me. I included it in my list of packages to wrap,
so that fixes that issue.
Because these plugins use the node packages as their source, there's no
reason to pull their sources from GitHub only to have it be overriden.

This will trigger the removal of these plugins from generated.nix the
next time update.py is run.
Jake Waksbaum
@jbaum98 jbaum98 requested a review from jonringer as a code owner Sep 3, 2020
@jbaum98
Copy link
Contributor Author

@jbaum98 jbaum98 commented Sep 3, 2020

I realized this accomplishes the same thing as #82723, but also does the refactor and removes them from vim-plugin-names.

@jbaum98
Copy link
Contributor Author

@jbaum98 jbaum98 commented Sep 3, 2020

I also think this would resolve #64560, or rather, that it has already been resolved except for the issue of coc-go.

@jonringer
Copy link
Contributor

@jonringer jonringer commented Sep 3, 2020

do you mind adding some documentation to the vimplugin docs which mention the exception around coc node modules?

@jbaum98
Copy link
Contributor Author

@jbaum98 jbaum98 commented Sep 3, 2020

Yup I can do that.

Copy link
Contributor

@jonringer jonringer left a comment

diff LGTM
gets rid of a bunch of boilerplate

https://github.com/NixOS/nixpkgs/pull/96993
25 packages built:
vimPlugins.clang_complete vimPlugins.coc-explorer vimPlugins.coc-go vimPlugins.coc-markdownlint vimPlugins.completion-nvim vimPlugins.csv-vim vimPlugins.denite-nvim vimPlugins.deol-nvim vimPlugins.nvim-lspconfig vimPlugins.nvim-treesitter vimPlugins.tagbar vimPlugins.vim-clap vimPlugins.vim-dirvish vimPlugins.vim-floaterm vimPlugins.vim-flutter vimPlugins.vim-html-template-literals vimPlugins.vim-lsp vimPlugins.vim-monokai vimPlugins.vim-polyglot vimPlugins.vim-sneak vimPlugins.vim-test vimPlugins.vim-vsnip vimPlugins.vimspector vimPlugins.vimtex vimPlugins.zenburn

still would like to hear from @timokau @evanjs

@timokau
timokau approved these changes Sep 4, 2020
Copy link
Member

@timokau timokau left a comment

Generally looks good to me, though I'm not very familiar with how coc was handled in the past and I have never used it.

];
nodePackage2VimPackage = name: buildVimPluginFrom2Nix {
pname = name;
inherit (nodePackages.${name}) version;

This comment has been minimized.

@timokau

timokau Sep 4, 2020
Member

Would it make sense to inherit meta (description and license) as well?

This comment has been minimized.

@jbaum98

jbaum98 Sep 4, 2020
Author Contributor

Oh that's a very good idea.

@gvolpe
Copy link
Contributor

@gvolpe gvolpe commented Sep 4, 2020

@jbaum98 Right now CoC plugins can be accessed via pkgs.vimPlugins.coc-*. Would it remain the same after these changes or how would it be?

@jbaum98
Copy link
Contributor Author

@jbaum98 jbaum98 commented Sep 4, 2020

Yes, they'll still be available in vimPlugins. What this does is removes the non-compiled versions, since they were overriden anyway, and changes the way they are added to vimPlugins in overrides.nix to reduce duplication.

@jonringer
Copy link
Contributor

@jonringer jonringer commented Sep 4, 2020

@gvolpe Yea, I re-did my home-manager off this PR and it seems that the plugin names have stayed "the same"

Copy link
Contributor

@jonringer jonringer left a comment

LGTM

Result of nixpkgs-review pr 96993 1

25 packages built:
  • vimPlugins.clang_complete
  • vimPlugins.coc-explorer
  • vimPlugins.coc-go
  • vimPlugins.coc-markdownlint
  • vimPlugins.completion-nvim
  • vimPlugins.csv-vim
  • vimPlugins.denite-nvim
  • vimPlugins.deol-nvim
  • vimPlugins.nvim-lspconfig
  • vimPlugins.nvim-treesitter
  • vimPlugins.tagbar
  • vimPlugins.vim-clap
  • vimPlugins.vim-dirvish
  • vimPlugins.vim-floaterm
  • vimPlugins.vim-flutter
  • vimPlugins.vim-html-template-literals
  • vimPlugins.vim-lsp
  • vimPlugins.vim-monokai
  • vimPlugins.vim-polyglot
  • vimPlugins.vim-sneak
  • vimPlugins.vim-test
  • vimPlugins.vim-vsnip
  • vimPlugins.vimspector
  • vimPlugins.vimtex
  • vimPlugins.zenburn

@jonringer jonringer merged commit 58e585c into NixOS:master Sep 4, 2020
17 checks passed
17 checks passed
tests tests
Details
action
Details
Evaluation Performance Report Evaluator Performance Report
Details
Wait for ofborg
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09e8d55"; rev="09e8d550d854f590cfb62d34bb2bbf9ea1eb324b"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@jbaum98
Copy link
Contributor Author

@jbaum98 jbaum98 commented Sep 4, 2020

Wait! I wanted to inherit meta like timokau suggested.

@jonringer
Copy link
Contributor

@jonringer jonringer commented Sep 4, 2020

that shouldn't cause any rebuilds, :) just open a PR! xD

@jonringer
Copy link
Contributor

@jonringer jonringer commented Sep 4, 2020

sorry, I'm trying to do a "last call" of merges before branchoff

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.