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
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe:

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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 ruby-check-disallowed-references branch from d8292a8 to b235552 Compare November 12, 2020 14:13
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

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
Contributor Author

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants