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
ruby: export generic builder #55636
ruby: export generic builder #55636
Conversation
This is wonderful. I’d been wanting to get around to this. I’ll have some more substantial feedback later, but I definitely want to have this in Nixpkgs |
I like this very much :) |
I thought thought that maybe the version should be called something more specific, if maybe that is to be changed, so backwards compatibility would be easier. |
@@ -198,6 +198,10 @@ let | |||
) args; in self; | |||
|
|||
in { | |||
ruby_build_generic = { version, ... } @ args: generic (args // { |
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.
ruby_build_generic = { version, ... } @ args: generic (args // { | |
mkRuby = { version, ... } @ args: generic (args // { |
mk
or build
are the name prefixes that are generally used by that produce derivations.
It would be nice is mkRuby could also be used subsequently below to make it clear how to use it.
Great idea! |
5534e14
to
11cedf1
Compare
Allow building any ruby, like ruby-build does.
11cedf1
to
b7b4c44
Compare
I renamed it to |
@@ -97,7 +97,7 @@ let | |||
(import ./patchsets.nix { | |||
inherit patchSet useRailsExpress ops; | |||
patchLevel = ver.patchLevel; | |||
})."${ver.majMinTiny}"; | |||
})."${ver.majMinTiny}" or []; |
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.
I think that, if we’re doing this, the existing rubies should be built using mkRuby
, and their patches should be passed into it. (I’d be fine with getting rid of patchsets.nix and just inlining the patches here — there are a lot fewer patches than there used to be.)
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.
Should I not use the patches if useRailsExpress
is false within the mkDerivation
?
Patches inlined, mkRuby — used! I added |
The builds should cache though, right? (By that I mean it should be possible to make them cache, since nothing really changed, since the version numbers get converted to the same end value.) Also, ping! |
version = rubyVersion "2" "6" "1" ""; | ||
sha256 = { | ||
src = "1f0w37jz2ryvlx260rw3s3wl0wg7dkzphb54lpvrqg90pfvly0hp"; | ||
git = "07gp7df1izw9rdbp9ciw4q5kq8icx3zd5w1xrhwsw0dfbsmmnsrj"; | ||
}; | ||
# no Rails Express patchset yet (2019-01-30) |
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.
The patchset is now available at https://github.com/rvm/rvm/blob/master/patchsets/ruby/2.6.1/railsexpress
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.
I just copypasted, but I can include it — sure. :)
ruby_2_3 = generic { | ||
version = rubyVersion "2" "3" "8" ""; | ||
in rec { | ||
mkRuby = { version ? null, versionNrs ? null, versionStr ? null, ... } @ args: |
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.
Could also add some documentation to doc/languages-frameworks/ruby.xml
about this function?
Inlining the patches, which happens from 7297606 to b7b4c44, makes the cache fail. Is that supposed to be that way? I don't entirely know why or should it be that way.
Please advise, I've no idea. :) |
It translates down to rubyVersion, but I myself as a user would like to use
the same format as in `.ruby-version` — that's why. :)
…On Thu., 21 Mar. 2019, 6:57 am Alyssa Ross, ***@***.***> wrote:
> Inlining the patches, which happens from 7297606 to b7b4c44,
makes the cache fail. Is that supposed to be that way? I don't entirely
know why or should it be that way.
Possibly related; not sure -- why change from using rubyVersion to
versionNrs and versionStr?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#55636 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOWi9OtyP-7jOT-AbZskQ8Mrirvmkhtks5vYrzxgaJpZM4a2Qj7>
.
|
It translates down to rubyVersion, but I myself as a user would like to use
the same format as in `.ruby-version` — that's why. :)
Hmm. I'm not sure it's worth it. It makes the code really quite
difficult to follow. Maybe if you could pull it out into some other
function or something we could have the best of both worlds. I do
appreciate the idea of having it be the same as .ruby-version.
|
I could just move the Do those rebuilds qualify this as non-mergable for now? |
I've used |
I could just move the `versionStr -> rubyVersion` function from `mkRuby` into a function with its own name so you could 'get' it without having to read the implementation. How 'bout that? :P
Sounds good.
Do those rebuilds qualify this as non-mergable for now?
Not necessarily. I'm hoping whatever's causing them will just disappear
as we continue to work on the code, but even if they stick around we
can still merge this.
|
@manveru That looks like a list. The object that ought to be created is that weird set that |
I am not quite familiar with PR processes in NixPkgs. @siers Can you please explain why this was closed? |
because I don't have lots of dedicated computer volunteer time and so I couldn't support it |
Got it ;) Maybe I'll continue a bit later. Will use your fork, thanks. |
Allow building any ruby, like ruby-build does.
Motivation for this change
I think it would it make sense to allow building (m)any ruby, like ruby-build does.
What do you think about this change, @manveru, @vrthra? (did I ping the wrong people? 😅)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)