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

Custom Ruby / Bundler versions #14

Closed
Matt-Yorkley opened this issue Feb 21, 2022 · 5 comments
Closed

Custom Ruby / Bundler versions #14

Matt-Yorkley opened this issue Feb 21, 2022 · 5 comments

Comments

@Matt-Yorkley
Copy link

I had a quick look at getting default.nix to build with arbitrary Ruby versions here: main...Matt-Yorkley:versions

I'm not sure if that's the right way to do it, but it builds and successfully runs the app on the latest Ruby 3.1.1 (which was just released a few days ago). It feels like it should be extracted into a nice module somehow, but I'm not sure what that looks like 😅

To be useful for a range of Rails apps, it'll ultimately need the ability to specify a Ruby dot-version, specify a bundler dot-version, then build / fetch them both, then install all gems through bundix using the exact Ruby and bundler versions.

@jsierles
Copy link
Contributor

Nice, this looks about right. We'll probably want to extract these into a separate repo where we build and upload to a binary cache. I'll open a separate issue to try to outline what I think we can try.

@Matt-Yorkley
Copy link
Author

Matt-Yorkley commented Feb 22, 2022

Just a note on some of the details of building Ruby versions (which might be a bit much at this early stage, but could be a consideration later): there's a couple of build flags that are quite popular and might be in demand if the Rails/Nix thing takes off, related to increasing Ruby's performance/speed. The first is the --with-jemalloc flag for switching out the default memory allocator, and the second is the new flag for enabling YJIT (which is now available in Ruby, but I think still disabled by default).

@jsierles
Copy link
Contributor

jsierles commented Feb 22, 2022

Yeah, I was thinking about that. We definitely want jemalloc enabled for every version, so we should start thinking about it. @samueldr can probably get us into shape here once the build stuff is sorted. I'm going to create a repo for the nix stuff to be extracted to. We can start plopping things like this in there.

@Matt-Yorkley
Copy link
Author

Matt-Yorkley commented Feb 22, 2022

There are some bits built in to the pkgs.ruby implementation for handling jemalloc already 👌 But yeah the opt-in or opt-out YJIT thing will be in demand and that makes things a bit more complex if you want to offer that.

@jsierles
Copy link
Contributor

jsierles commented Mar 9, 2022

Now this is being moved into https://github.com/fly-apps/nix-base, we can open more specific tickets there.

@jsierles jsierles closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants