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

[RDY] neovim-unwrapped: ease hacking/development #75164

Merged
merged 1 commit into from Jun 6, 2020
Merged

Conversation

teto
Copy link
Member

@teto teto commented Dec 7, 2019

Motivation for this change

I am hacking on neovim and I need some extra config to be able to run the :

make clint
make lualint

targets.
I've introduced a devMode flag on top of the doCheck but I don't like the increased complexity.
I would like to merge both under the name of devMode as it is what makes most sense.
Any thought ?

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 nix-review --run "nix-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.
Notify maintainers

cc @

@teto
Copy link
Member Author

teto commented Dec 7, 2019

hum I guess I can still improve things to run more tests:

[==========] 3902 tests from 328 test files ran. (145522.45 ms total)
[  PASSED  ] 3882 tests.
[ SKIPPED  ] 20 tests, listed below:
[ SKIPPED  ] test/functional/api/server_requests_spec.lua @ 148: server -> client requests and notifications interleaved will close connection if not properly synchronized
[ SKIPPED  ] test/functional/api/server_requests_spec.lua @ 326: server -> client connecting to another (peer) nvim via ipv6 address
test/functional/api/server_requests_spec.lua:331: no ipv6 stack
[ SKIPPED  ] test/functional/core/channels_spec.lua @ 31: channels can connect to socket
[ SKIPPED  ] test/functional/core/job_spec.lua @ 729: jobs exit event follows stdout, stderr
[ SKIPPED  ] test/functional/eval/backtick_expansion_spec.lua @ 39: backtick expansion with shell=fish
test/functional/eval/backtick_expansion_spec.lua:41: missing "fish" command
[ SKIPPED  ] test/functional/eval/interrupt_spec.lua @ 16: List support code does not actually allows interrupting with just got_int
[ SKIPPED  ] test/functional/lua/treesitter_spec.lua @ 33: treesitter API with C parser works
test/functional/lua/treesitter_spec.lua:33: TREE_SITTER_PATH not set, skipping treesitter parser tests
[ SKIPPED  ] test/functional/normal/langmap_spec.lua @ 243: 'langmap' Translates modified keys correctly
[ SKIPPED  ] test/functional/normal/langmap_spec.lua @ 249: 'langmap' handles multi-byte characters
[ SKIPPED  ] test/functional/normal/langmap_spec.lua @ 259: 'langmap' handles multibyte mappings
[ SKIPPED  ] test/functional/options/keymap_spec.lua @ 190: 'keymap' / :lmap mappings not applied to macro replay of :lnoremap
[ SKIPPED  ] test/functional/plugin/lsp/lsp_spec.lua @ 462: Language Client API basic_init test should check the body and didChange incremental
[ SKIPPED  ] test/functional/plugin/lsp/lsp_spec.lua @ 510: Language Client API basic_init test should check the body and didChange incremental normal mode editting
[ SKIPPED  ] test/functional/provider/nodejs_spec.lua @ 12: Missing nodejs host, or nodejs version is too old.
[ SKIPPED  ] test/functional/provider/python3_spec.lua @ 19: Python 3 (or the pynvim module) is broken/missing
[ SKIPPED  ] test/functional/provider/python_spec.lua @ 27: Python 2 (or the pynvim module) is broken/missing
[ SKIPPED  ] test/functional/provider/ruby_spec.lua @ 27: Missing neovim RubyGem.
[ SKIPPED  ] test/functional/terminal/tui_spec.lua @ 1329: TUI 't_Co' (terminal colors) TERM=interix uses 8 colors
[ SKIPPED  ] test/functional/ui/float_spec.lua @ 1389: floatwin with ext_multigrid supports second UI without multigrid
[ SKIPPED  ] test/functional/ui/messages_spec.lua @ 1050: ui/msg_puts_printf output multibyte characters correctly
test/functional/ui/messages_spec.lua:1068: Locale ja_JP.UTF-8 not supported

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Besides this all LGTM.

pkgs/applications/editors/neovim/default.nix Outdated Show resolved Hide resolved
@teto teto changed the title neovim-unwrapped: ease hacking/development [WIP] neovim-unwrapped: ease hacking/development Feb 13, 2020
@teto teto changed the title [WIP] neovim-unwrapped: ease hacking/development [RDY] neovim-unwrapped: ease hacking/development May 23, 2020
@teto
Copy link
Member Author

teto commented Jun 4, 2020

@GrahamcOfBorg build neovim-unwrapped

@teto
Copy link
Member Author

teto commented Jun 4, 2020

cc @timokau

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

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

As I said in my email, I don't really understand why this is necessary (what are the advantages over your own shell.nix or just adding these packages to your system?).

I don't really have anything against it though, and if it helps you with development we can go ahead with this. The complexity increase is rather small.

pkgs/applications/editors/neovim/default.nix Show resolved Hide resolved
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Although I commented a long time ago that it LGTM. I'm not sure what this PR does that an overlay couldn't do? Overlays would be needed anyway for someone to use devMode... I object just a bit to adding extra flags that are not packages while I think most of them can be binded to doCheck instead? I think that although tests are disabled, we should support them almost, so here's my opinion.

pkgs/applications/editors/neovim/default.nix Outdated Show resolved Hide resolved
Comment on lines 76 to 71
]
++ optionals devMode [
include-what-you-use # for scripts/check-includes.py
jq # jq for scripts/vim-patch.sh -r
doxygen
];
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd do:

Suggested change
]
++ optionals devMode [
include-what-you-use # for scripts/check-includes.py
jq # jq for scripts/vim-patch.sh -r
doxygen
];
# To generate dev docs
doxygen
jq # jq for scripts/vim-patch.sh -r
]
++ optionals doCheck [
include-what-you-use # for scripts/check-includes.py
];

I suggest this considering:

  • I hope that adding doxygen doesn't mean dev docs are not built and installed unconditionally.
  • jq doesn't bother anyone if it'll be there, since it'll most likely won't be referenced in the output.

Copy link
Member Author

Choose a reason for hiding this comment

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

all of these deps are just to help with development (in a nix-shell -A neovim-unwrapped), they dont change the build process.

pkgs/applications/editors/neovim/default.nix Outdated Show resolved Hide resolved
Comment on lines 10 to 12

# set devMode to true to pull the software used to develop on neovim
, devMode ? false
Copy link
Contributor

Choose a reason for hiding this comment

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

I think most of the functionality this flag suggests can be coupled with that of doCheck, so:

Suggested change
# set devMode to true to pull the software used to develop on neovim
, devMode ? false

Copy link
Member Author

Choose a reason for hiding this comment

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

devMode is really for developers to use. I intend to enable doCheck at some point in the future hence the decorrelation.

@teto
Copy link
Member Author

teto commented Jun 5, 2020

As I said in my email, I don't really understand why this is necessary (what are the advantages over your own shell.nix or just adding these packages to your system?).

This is the question why I requested external review. I believe its is worthwhile because neovim is popular enough that people may want to contribute. The dependencies to hack on neovim are neither obvious or well documented so instead of having everyone tweaking his own shell.nix, I thought I could share the changes. It's only because of this specificity that I believe it's worthwhile to have in nixpkgs. Also the complexity is low. But yeah it still is more complex than the current one so I could understand not wanting that in. I do help maintaining (the) neovim (package) if that can help with my case :)

@doronbehar
Copy link
Contributor

@teto maybe it'll be more appropriate to share your Neovim's shell.nix in the WiKi? Then perhaps it'll be nice to see a link to it in the derivation. But I tend to think that Nixpkgs should target users and not developers, with all due respect :). What bothers me is that this PR doesn't make it completely trivial to setup a shell.nix for Neovim development, and a complete shell.nic is still required for someone to either write themselves or copy. Hence I tend to think it's worth to putting all of this information in 1 place and not make the derivation more complex then it is.

Make functionaltests more complete.
@teto
Copy link
Member Author

teto commented Jun 6, 2020

no you are right, I will post this either in neovim wiki or in some neovim flake. Yet another repo to maintain :'(
I've modified the spirit of the PR to just test more in the make functionaltest call. This is not enabled by default so the close size isn't changed.

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

LGTM.

@teto teto merged commit b4c7a0b into NixOS:master Jun 6, 2020
@timokau
Copy link
Member

timokau commented Jun 7, 2020

As I said in my email, I don't really understand why this is necessary (what are the advantages over your own shell.nix or just adding these packages to your system?).

This is the question why I requested external review. I believe its is worthwhile because neovim is popular enough that people may want to contribute.

I'm not fully opposed to have dev-setup related things in nixpkgs, but @doronbehar's concerns are warranted. We'd probably have to think about how to do this right and in a uniform manner if we wanted to do it.

The dependencies to hack on neovim are neither obvious or well documented so instead of having everyone tweaking his own shell.nix, I thought I could share the changes.

That sound like you need better upstream documentation ;)

It's only because of this specificity that I believe it's worthwhile to have in nixpkgs. Also the complexity is low. But yeah it still is more complex than the current one so I could understand not wanting that in. I do help maintaining (the) neovim (package) if that can help with my case :)

Yeah I agree with the low complexity, so the benefit doesn't have to be that great to be worthwhile. In my opinion you, a neovim and nixpkgs core contributor, thinking its a good idea is sufficient. So if you really would prefer this in nixpkgs, I'm not opposed.

@teto teto deleted the neovim_dev branch September 5, 2021 01:00
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.

None yet

3 participants