forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bundlerEnv: Add support for precompiled 'nativeSources' gems
- Loading branch information
1 parent
0325fda
commit e7316af
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e7316af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdelStrother hey this looks like exactly what I want. I've managed to run your branch of bundix, but I'm not sure how to run a different version of bundlerEnv. Could you share some tips? I'm pretty new to nix in general, so I think it's just a matter of not knowing what I don’t know at this point. I'm using a flake for the project if that matters at all.
e7316af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@will It's a little while since I looked at this, we didn't end up using this approach. What I have instead is this hack to rewrite the Gemfile.lock to avoid platform-specific gems entirely, which has worked ok for our purposes:
Ruby definitely feels a bit under-maintained in the nix community... if you share some code you're struggling with I'll try & take another look.
e7316af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the gems (sorbet) builds native stuff with haskell I think, which seems like it'd be annoying to get working if you had to build it each time vs downloading the prebuilt versions. So I think your approach here seems like it'd be great
But I'm just using the bundlerEnv from wherever that comes from, and I'm not sure how to use an alternate version that has this changed composeGemAttrs
Haven't gotten to anywhere fancy in the flake yet, I think this is all pretty standard:
When you were developing that alternate version of
composeGemAttrs
how did you iterate on it?e7316af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Urgh, yeah - someone was asking about this with sorbet a while back (nix-community/bundix#71)
IIRC I didn't find a good way to patch it into nixpkgs (eg as an overlay or whatever), so would just have nixpkgs checked out locally and in my shell.nix have something like
pkgs = import ../vendor/nixpkgs {}
.Unless I'm missing something it's a little more cumbersome with flakes - you can set, eg,
nixpkgs.url = "/Users/jon/Developer/vendor/nixpkgs";
, but AFAIK any changes you make in your local nixpkgs directory need to be git-committed and then you'd neednix flake update
each time you make a change.I did briefly try my multiplatform branches with sorbet - sadly they don't magically fix it, looks like there's still some work to be done there 😞
e7316af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e7316af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit late to the scene! @jdelStrother I just published a flake that made use of your work here. It supports native sources, among other things.
https://github.com/sagittaros/ruby-nix