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

ruby: check disallowed references with jitSupport disabled #103584

Merged
merged 1 commit into from Nov 13, 2020

Conversation

@danieldk
Copy link
Member

@danieldk danieldk commented Nov 12, 2020

Motivation for this change

This makes it easier to detect regressions.

cc @doronbehar

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
  • 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.
@@ -210,6 +210,8 @@ let
sed -i "s|'--with-baseruby=${baseruby}/bin/ruby'||" $rbConfig
'';

disallowedReferences = op (!jitSupport) stdenv.cc;

This comment has been minimized.

@doronbehar

doronbehar Nov 12, 2020
Contributor

Maybe:

Suggested change
disallowedReferences = op (!jitSupport) stdenv.cc;
disallowedReferences = lib.optionals (!jitSupport) [ stdenv.cc stdenv.cc.cc ];

This comment has been minimized.

@danieldk

danieldk Nov 12, 2020
Author Member

Then I propose

        disallowedRequisites = op (!jitSupport) stdenv.cc.cc;

Since that checks the transitive closure and stdenv.cc will have stdenv.cc.cc in its closure.

This makes it easier to detect regressions.
@danieldk danieldk force-pushed the danieldk:ruby-check-disallowed-references branch from d8292a8 to b235552 Nov 12, 2020
Copy link
Contributor

@doronbehar doronbehar left a comment

LGTM but I wonder if it'll actually be detected and fixed if at some point, a future version of ruby will add another point of reference to cc (not handled currently).. @lilyball thinks (I think) there should be a ruby derivation built by Hydra that doesn't reference cc.

@danieldk
Copy link
Member Author

@danieldk danieldk commented Nov 12, 2020

LGTM but I wonder if it'll actually be detected and fixed if at some point, a future version of ruby will add another point of reference to cc (not handled currently).. @lilyball thinks (I think) there should be a ruby derivation built by Hydra that doesn't reference cc.

I don't really have an opinion, I don't use Ruby (aside from one website that uses Jekyll for historical reasons). I just happened to see the topic on Discourse & it's usually good to match a removeReferencesTo with a disallowedReferences. Saved the day in a private Nix repo a few times ;).

@doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Nov 13, 2020

OK. We can make another PR in the future, this is good enough as a start.

@doronbehar doronbehar merged commit 2e7d97a into NixOS:staging Nov 13, 2020
19 checks passed
19 checks passed
tests
Details
action
Details
Evaluation Performance Report Evaluator Performance Report
Details
Wait for ofborg
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b235552"; rev="b235552837175841fcb5a1d273157047b644fc2f"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
ruby, ruby.passthru.tests on aarch64-linux Success
Details
ruby, ruby.passthru.tests on x86_64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.