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: add neovimRequireCheckHook only when needed #364378

Closed
wants to merge 4 commits into from

Conversation

teto
Copy link
Member

@teto teto commented Dec 11, 2024

neovim not building should not prevent the build of vim plugins that dont use neovim to run tests

Things done

  • we now include "neovimRequireCheckHook" only when doCheck is enabled and
    if the derivation has an nvimRequireCheckHook.
  • set doCheck to true in buildVimPlugin (might need to do something similar in buildNeovimPlugin ?)
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@teto
Copy link
Member Author

teto commented Dec 13, 2024

gets broken for wrong lua versions. Not sure if that's true on master either way.

6 packages marked as broken and skipped:
lua52Packages.neotest lua53Packages.neotest lua54Packages.neotest lua54Packages.sqlite luajitPackages.neotest vimPlugins.one-nvim

If that's ok with you @GaetanLepage I will target staging and merge

@teto teto changed the base branch from master to staging December 13, 2024 22:41
teto added 4 commits December 13, 2024 22:41
I first tried with config.doCheckByDefault but it's false by default and
I do want to enable the nvimRequireChecks by default.
so they dont break eval/build when not needed.

neovim not building should not prevent the build of vim plugins that dont use neovim to run tests.

we now include "neovimRequireCheckHook" only when doCheck is enabled and
if the derivation has an nvimRequireCheckHook.
seems like several 'nvimRequirecheck' have been added instead of 'nvimRequireCheck'.

removed it for neotest-gtest since it makes the build fail apparently
@teto teto force-pushed the teto/optional-neovim-check-hook branch from 5767e7a to db44e25 Compare December 13, 2024 22:50
# many neovim plugins keep using buildVimPlugin
neovimRequireCheckHook
];
doCheck = oldAttrs.doCheck or true;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is useful for buildNeovimPlugin mostly since buildVimPlugin sets it to true in this PR.

@teto teto requested a review from khaneliman December 13, 2024 22:56
@teto
Copy link
Member Author

teto commented Dec 13, 2024

@khaneliman I've added you as reviewer since this conflicted with some code in staging.

oldAttrs.nativeCheckInputs or [ ]
++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
[
vimCommandCheckHook
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that vimCommandCheckHook is written to also use neovim-unwrapped; check line 429.

Copy link
Contributor

@khaneliman khaneliman Dec 14, 2024

Choose a reason for hiding this comment

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

Hmm... might need to get updated to use vim instead for the goal of this work? We can do that in a separate PR though if that's the direction.

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 introduced vimCommandCheck and I am using neovim. vimCommandCheck is applied mostly to neovim plugins I think. Anyway replacing neovim by vim would have a similar effect as neovim wouldn't be able to use plugins when vim breaks.
I dont think it's worth it to provide vimPlugins sets just to run the test. Your best bets are either:

  • to fix neovim on your platform such that everyone benefits from it
  • override neovim = vim in the hook ?
  • disable the checks

[
vimCommandCheckHook
]
++ lib.optional (finalAttrs.finalPackage ? nvimRequireCheck) neovimRequireCheckHook
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this limiting the running to explicit nvimRequireChecks in overrides?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this just reverts #352277 essentially

Copy link
Member

Choose a reason for hiding this comment

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

+1, you should check for doCheck = false instead of nvimRequireCheck

Copy link
Contributor

Choose a reason for hiding this comment

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

Passing doCheck = false already skips running the hooks in native check inputs. I don't know if there's a different behavior by explicitly adding it here

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 haven't looked at #352277 so without the hook it wouldn't work ? my change made a lot of sense before realizing most of it was already available in staging. Looks like this PR is not needed after all, worse it degrades the automatic checks ?

Copy link
Contributor

@GaetanLepage GaetanLepage 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
Copy link
Member Author

teto commented Dec 16, 2024

closing since the required changes were already in staging, sorry for wasting your time (It did prompt me to find the nvimRequirecheck typos so there is that).
As for the initial issue, see #364378 (comment)

@teto teto closed this Dec 16, 2024
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.

5 participants