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

feat: expose toolchain and bundled binaries #70

Merged
merged 6 commits into from
Jan 22, 2024
Merged

feat: expose toolchain and bundled binaries #70

merged 6 commits into from
Jan 22, 2024

Conversation

p0deje
Copy link
Member

@p0deje p0deje commented Jan 19, 2024

This PR exposes Ruby toolchain binaries (such as ruby, bundle, gem, etc) and binstubs generated by Bundler so they could be used via bazel run .... Also gardens the codebase and documentation a little bit.

@p0deje p0deje force-pushed the binstubs branch 11 times, most recently from c1ea0f2 to bcb3268 Compare January 20, 2024 02:31
@p0deje p0deje marked this pull request as ready for review January 20, 2024 02:31
@p0deje p0deje requested a review from alexeagle January 20, 2024 02:32
This allows to use gems installed in toolchain directly.
It works by running binaries with `bazel run @ruby//:<binary>`.
Some examples:

bazel run @ruby -- -e "puts 123"             -> evaluate Ruby script
bazel run @ruby//:bundle -- update           -> update gems in Gemfile.lock
bazel run @ruby//:bundle -- add rails        -> add Rails gem to Gemfile
bazel run @ruby//:gem -- install rails       -> install Rails gem to the toolchain
bazel run @ruby//:rails -- new $(pwd)/my_app -> create Rails application to ./my_app directory

Fixes #41
This allows to build binary targets and then call them from the console
directly. For example, one could run `bazel build @bundle` and then
call binary targets with `bazel-bin/external/bundle/rspec`.

Doesn't work on Windows at the moment.

Fixes #51.
@p0deje p0deje merged commit 81bf18e into main Jan 22, 2024
41 checks passed
@p0deje p0deje deleted the binstubs branch January 22, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants