Comments (3)
As documented here, for example
https://github.com/sparklemotion/nokogiri#native-gems-faster-more-reliable-installation
there's a way to start from a pre-compiled native gem instead. I think most Bazel users should be using this to achieve reproducible builds.
That's only available for certain gems like nokogiri. For pysch, we could potentially install libyaml and follow the steps in https://github.com/ruby/psych#installation to point to use it instead of system libyaml.
How does other rules (node/python) handle installation that expects certain libraries in the system?
from rules_ruby.
Node.js and Python rules do a poor job of this as well. You have three choices:
- custom wiring with
cc_library
to replace the package manager's build system with Bazel, and figure out how to stitch the result into how the ruleset gets its third-party libraries. Pretty much no one knows how to do this although it feels ilke the principled answer - just let the package manager's build system do its thing and deal with non-hermeticity. 90% of bazel users do this.
- use a pre-compiled binary package for your platform. In cases where upstream maintainers don't ship one, build one yourself and put into artifactory or some custom registry. The sophisticated 10% do this
Random note, the native build system used under Node.js is GYP and they considered using Bazel to implement it at one point
from rules_ruby.
If you're on a supported platform, either gem install or bundle install should install a native gem without any additional action on your part. This installation should only take a few seconds, and your output should look something like:
Native gems are selected during installation time automatically by RubyGems. We can't really force that. Let's for now stick to option 2.
from rules_ruby.
Related Issues (20)
- `rb_binary` does not work unless Gemfile is listed as transitive srcs
- Support bzlmod
- rb_binary should work as the tool in a run_binary HOT 1
- bundler downloads gem dependencies rather than Bazel downloader HOT 44
- bzlmod users should get a default toolchain registration HOT 5
- Tech debt: CI bzlmod testing ignores ruby_version.bzl HOT 1
- Only download gems needed for the targets I request
- rubocop failure on Windows due to line endings HOT 4
- Dependency Dashboard
- Provide a hermetic bundle command HOT 12
- Failure compiling MRI HOT 6
- Enable the ability to run a binary manually HOT 2
- Support gems installed from Git repositories in `rb_bundle_fetch(...)`
- Support CHECKSUMS for Bundler 2.5.0 in `rb_bundle_fetch(...)`
- Long filepath issue on Windows
- toolchain/gem binary quirks HOT 10
- Generate convenience target alongside binary.sh target that changes the current working directory HOT 1
- Error downloading toolchain using bazelmod HOT 17
- using "system" ruby fails as bazel is unable to access `@@rules_ruby~~ruby~ruby//:dist/bin/sudo` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_ruby.