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

feature: detection of plugin with build steps #902

Closed
1 task done
tjdevries opened this issue Jun 30, 2023 · 1 comment · Fixed by #903
Closed
1 task done

feature: detection of plugin with build steps #902

tjdevries opened this issue Jun 30, 2023 · 1 comment · Fixed by #903
Labels
enhancement New feature or request

Comments

@tjdevries
Copy link

Did you check the docs?

  • I have read all the lazy.nvim docs

Is your feature request related to a problem? Please describe.

Various plugins have external tooling / requirements that must be either installed or built:

For example:

  • telescope-fzf-native must compile some C files into a shared library.
  • There are also various other plugins that build shared libraries in other compiled languages (rust, for example).
  • Remote plugins would benefit from a way to install their dependencies without the user having to care what language the plugin is interested in ("do i need npm or yarn? does XYZ work")

Describe the solution you'd like

My proposal is not that we create a package management system, but instead a standard location for some lua file (perhaps build.lua or build/init.lua at the root of the plugin for example) that can be executed and is expected to handle any environment/tooling setup. This will still be on the plugin authors to still do an actually good job of making this happen. But the file would be executed via nvim -l build.lua so that it doesn't require make / bash / etc that makes it difficult to support build steps on windows. This also provides a more standardized and isolated env to run the steps).

The reason I like having a particular file for this is because lazy can make optimizations (not running this on every startup but only when updating or installing a package). It's not always trivial to ensure that everything is built/up-to-date (npm run build is non-trivial blocking time, even with nothing extra to do).

If this catches on, I think a build/ directory could eventually land in core as an interface (perhaps with no additional functionality baked into core).

I don't want nvim to have to worry at all about the actual installing, it's just a standard entry point so that users aren't forced to copy & paste in a script for installation, but instead it can be discovered (and updated by authors, which means less annoying/silent breaking changes -- I can expand on real world cases of this if people are interest [a very simple one is pure lua plugin wants to add some shared library / dep... how to notify users that they have to change the installation configuration they had before?])

Describe alternatives you've considered

Not doing this and just keeping things the way they are :) which is also good

Additional context

This is not a 100% well thought idea, but just something I thought might be interesting to discuss here, and if it catches on, could be upstreamed in some way that makes this easier/standard for all package managers.

@tjdevries tjdevries added the enhancement New feature or request label Jun 30, 2023
@folke folke mentioned this issue Jun 30, 2023
@folke
Copy link
Owner

folke commented Jun 30, 2023

Good idea! See the linked PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants