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

refactor: refactor jruby to allow multiple versions #94876

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fzakaria
Copy link
Contributor

@fzakaria fzakaria commented Aug 7, 2020

Motivation for this change

Many packages within Nix support multiple packages & a versionless
attribute that tracks "latest";

This refactors the JRuby derivation to be similar to that of Ruby
itself.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions (Debian)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
> nix-build $(pwd) -A jruby-group.v9_2_13_0
/nix/store/52nrl3czv5jxvpw9kvnvgaa7npwc4kkx-jruby-9.2.13.0

> nix-build $(pwd) -A jruby
/nix/store/52nrl3czv5jxvpw9kvnvgaa7npwc4kkx-jruby-9.2.13.0

v9_2_12_0 = generic_jruby {
version = "9.2.12.0";
sha256 = "013c1q1n525y9ghp369z1jayivm9bw8c1x0g5lz7479hqhj62zrh";
rubyVersion = rubyVersion "2" "5" "7" "";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> nix run -f $(pwd) jruby-group.v9_2_13_0 --command ruby -e 'puts RUBY_VERSION'
2.5.7

v9_2_13_0 = generic_jruby {
version = "9.2.13.0";
sha256 = "0n5glz6xm3skrfihzn3g5awdxpjsqn2k8k46gv449rk2l50w5a3k";
rubyVersion = rubyVersion "2" "5" "7" "";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ nix run -f $(pwd) jruby-group.v9_2_12_0 --command ruby -e 'puts RUBY_VERSION'
[1 built, 25 copied (211.7 MiB), 67.4 MiB DL]
2.5.7

@@ -10084,7 +10084,8 @@ in

sourceFromHead = callPackage ../build-support/source-from-head-fun.nix {};

jruby = callPackage ../development/interpreters/jruby { };
jruby-group = callPackage ../development/interpreters/jruby {};
jruby = jruby-group.latest;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this keeps all packages that rely on JRuby still working and backwards compatible

Many packages within Nix support multiple packages & a versionless
attribute that tracks "latest";

This refactors the JRuby derivation to be similar to that of Ruby
itself.
Comment on lines -58 to -61
passthru = oldAttrs.passthru // {
devEnv = callPackage ../ruby/dev.nix {
ruby = jruby;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary and inlined within the generic builder.
It relies on "self" to be self-referential to the ruby it's building.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/261

@stale
Copy link

stale bot commented Jun 6, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 6, 2021
@wegank wegank marked this pull request as draft March 20, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants