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: Make it possible for it to not reference cc at all #90151
Conversation
Am I correct in understanding that even disabling JIT explicitly still requires purging compiler references manually? |
Correct. |
Fixed a bit the release notes and the comment near the |
0371a8d
to
899f977
Compare
Rebased, and checked once more that |
899f977
to
36d18aa
Compare
If JIT support is built in to ruby, there's no choice other then to leave this cc reference as is. removeReferencesToCC didn't do it's job completely since some time ago. That's why it was practically redundant - `lib/ruby/${version}/<platform>/rbconfig.rb` still referenced cc. Removing this reference from `lib/ruby/${version}/<platform>/rbconfig.rb` as well might lead to breakage in some Gems that require this feature. But, if JIT support is not desired, it should be safe enough to completely remove all cc references, both in lib/ruby/${version}/<platform>/rbconfig.rb and in $out/lib/libruby.so . Hence now `rubyMinimal` has JIT support disabled and it has no references at all to stdenv.cc.
Due to being unused, and seemingly unusable, added appropriate release notes.
36d18aa
to
9db44f6
Compare
Thanks for the approval, will merge to staging once CI is green. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/is-nixpkgs-rubys-closure-supposed-to-include-clang/9922/2 |
Motivation for this change
Fix #89445.
Ruby's build flag called
removeReferencesToCC
doesn't do it's job completely - The filerbconfig.rb
still retained the reference to CC. It seems that's unavoidable if JIT support is enabled. JIT support is enabled by default and it's probable that some Gems require this feature. Since the normalruby
we are shipping ever since a while always retained this cc reference, I think it should be best to make it possible to build a ruby flavor such asrubyMinimal
without cc reference and let that derivation alone while leaving all of the regularruby
's cc references as are (After @peterhoeg 's comment).This for example allows for someone to add an override such as (tested):
And this will allow them to not need GCC on their system for their usage of Ruby. For example, run with this PR and that overlay applied:
And you should get:
But without this PR, (and the overlay would fail without the PR) you should get:
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)