Skip to content

Deploy pre-built binaries #38

Description

@cbachhuber

Ruby is not per default installed in most Linux distros, nor on Windows. With prek, this leads to errors such as

error: Failed to install hook `search-and-replace`
  caused by: Failed to install Ruby
  caused by: No suitable Ruby found for request: 3.2.0

No Ruby version manager detected. Install Ruby via:
  System package manager:
    Ubuntu/Debian: sudo apt install ruby
    macOS: brew install ruby
  Or install a version manager:
    rvm: https://rvm.io/
    mise: https://mise.jdx.dev/
    rbenv: https://github.com/rbenv/rbenv

While pre-commit manages Ruby ok (still, users run into issues like pre-commit/pre-commit#2057), the slow build process still causes issues such as this timeout, #28, or local gem build failures. I know CI maintainers of bigger companies who struggle because of this Ruby dependency.

Many pre-commit hooks distribute their binaries via PyPI, see for example https://github.com/astral-sh/ruff-pre-commit. If you build the binary from a language like rust with the default static linkage, it has no runtime system dependencies and can be downloaded and executed nicely hermetic via pre-commit/prek. Did you consider migrating this hook to rust and deploying via PyPI, for example? As a demo, I tasked an LLM to migrate this repo to rust. The result is here and works just fine. A sample usage is in cbachhuber/CppVideoStreamer#15.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions