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

cachix: compose overrides #57545

Closed

Conversation

vaibhavsagar
Copy link
Member

@vaibhavsagar vaibhavsagar commented Mar 12, 2019

Motivation for this change

Fixes #57529

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@vaibhavsagar
Copy link
Member Author

cc @domenkozar

@domenkozar
Copy link
Member

cc @srhb does this address the issue? :)

Thanks @vaibhavsagar !

@srhb
Copy link
Contributor

srhb commented Mar 16, 2019

Hi, thanks @vaibhavsagar !

This improves one aspect of the situation, but not all of it.

The problem is that if a user has an overlay that uses extend, override doesn't even exist, and this will cause a bunch of nix tooling to misbehave because the cachix expression then fails to evaluate completely.

Arguably, this is not the fault of cachix at all, but the fact that extend is fundamentally broken, but it's still a really bad user experience. This is why I argued in the linked issue that in-tree packages maybe shouldn't use either of haskellPackages.override and haskellPackages.extend but this definitely seems to be something we should discuss and come to a kind of consensus on.

I see two options:
(a) Disallow the use of haskellPackages.{override,extend} in-tree because we might break user setups due to this.
(b) Allow the use of haskellPackages.override (never extend), and accept that this makes it impossible for users to use extend. Since extend is broken anyway, it's OK that users have to deal with rewriting their own overlays or changes.

If we converge on (a), this PR does not suffice. The expression will have to be rewritten to use neither of the haskellPackages mechanisms.

If we converge on (b), this PR suffices.

Thoughts?

@srhb
Copy link
Contributor

srhb commented Mar 16, 2019

cc @basvandijk @peti

@peti peti requested a review from domenkozar March 16, 2019 16:10
@srhb
Copy link
Contributor

srhb commented Mar 16, 2019

What happens if we simply use .extend internally instead? As far as I know, it'll always be there, and as long as we don't expose the changed haskellPackages to the users, there's no nasty surprise. Does that make sense, or did I forget something here?

@roberth
Copy link
Member

roberth commented Mar 17, 2019

extend picks up the overrides as well. sgtm

@vaibhavsagar
Copy link
Member Author

Updated!

@domenkozar
Copy link
Member

I've pushed 4c6be1f as those overrides are not needed anymore. I'll make sure I use extend next time. Thank you!

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

5 participants