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
GHC 8.4 package overrides #34404
GHC 8.4 package overrides #34404
Conversation
@peti, this PR is not yet intended for merging -- rather to gather your feedback. Compared to the previous situation this set of overrides has:
This has been derived 95% automatically -- the remainder (just two overrides) was explained manually. As I remember the previous conversation (in #34023), what remains to be done is:
This part only makes sense to satisfy if the fix hasn't been mainlined yet. Thankfully, the automation I have right now is helpful enough to ease that filtering -- and supply classification otherwise -- if you look at the overrides, they are grouped in
So.. I guess I'd appreciate any feedback you might have : -) |
c7af009
to
1b465b5
Compare
1b465b5
to
c2d131c
Compare
The point about upstream tracking is now satisfied: the PR URLs are supplied for those |
2a6299e
to
2897a7f
Compare
## On Hackage: | ||
|
||
blaze-markup = overrideCabal super.blaze-markup (drv: { | ||
## On Hackage, awaiting for import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be easier to use self.blaze-markup_0_8_2_0
? The same applies to virtually all those overrides that update a package to the latest version. We have the latest version in Nixpkgs, and using those names has the advantage that evaluation will break every time these receive an update, which gives us a nudge to re-evaluate the situation and follow the update (or drop the overrive).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's also automatable to a sufficient extent -- will do!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peti, I'm trying to replace the src-based override with these "shadow" attributes:
hspec-core = overrideCabal super.hspec-core_2_4_7 (drv: {
editedCabalFile = null;
});
..and I'm getting:
FATAL: failed to instantiate text-lens: nix-instantiate packages.nix -A text-lens --argstr compiler ghc841 --show-trace
error: while evaluating the attribute ‘propagatedBuildInputs’ of the derivation ‘text-lens-0.1.1’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘propagatedBuildInputs’ of the derivation ‘lens-4.15.4’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildInputs’ of the derivation ‘base-orphans-0.6’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘propagatedBuildInputs’ of the derivation ‘hspec-2.4.7’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildInputs’ of the derivation ‘hspec-core-2.4.7’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildInputs’ of the derivation ‘silently-1.2.5’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildInputs’ of the derivation ‘temporary-1.2.1.1’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildInputs’ of the derivation ‘base-compat-0.9.3’ at /home/deepfire/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
infinite recursion encountered, at undefined position
Am I doing something obviously wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that overrideCabal
cannot be used for those shadow attributes for some reason.. although I'm somewhat surprised, given how they are defined (same as normal, non-version-suffixed ones).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a bit more context -- the construction I'm using is:
ghcOrig.override (oldArgs: {
overrides = self: super:
with haskellLib; with self; {
...
hspec-core = overrideCabal super.hspec-core_2_4_7 (drv: {
editedCabalFile = null;
});
...
};
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hspec
packages are tricky because some of their dependencies depend on hspec
for testing --- which causes infinite loops. The easiest way to avoid that issue is to disable the check phase of those packages, like I did in https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-ghc-8.4.x.nix#L46.
A better albeit more involved solution is to figure out which package is causing the recursion and to pass a dont-check-variant of that particular package to hspec
during testing, like we do at https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-common.nix#L51-L52. We have those overrides for the default versions, but apparently we don't have them for the latest versions, which makes sense, I guess.
BTW, I'm wondering why you set
editedCabalFile = null;
in your override. That doesn't seem necessary to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The editedCabalFile
is coming from a pre-auto-trim state of the override set, but after I have promoted the package from github-overridden (where the editedCabalFile negation is necessary) to "hackaged" -- basically intermediate state, that's not intended as a final result.
Investigating now how to deal with the loops -- mainly how many instances of the problem can be dealt with doCheck = false
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done -- the use of versioned attributes is now automatic.
## from the context: (Monad m, Monoid a) | ||
src = pkgs.fetchgit { | ||
url = "https://github.com/ekmett/free"; | ||
rev = "fcefc71ed302f2eaf60f020046bad392338b3109"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this override be updated when a new release version of free
comes out that supersedes this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! -- I've added automation to the audit script to catch the override version lagging behind upstream to the update script. I'll update the override set tonight.
So the full answer is -- there are scripts that:
- automatically generate set trimming proposals, and
- audit the current override set for various invariants, like:
- Nixpkgs-supplied packages lagging behind the Hackage-based overrides
- Upstreamed-overridden version not lagging behind upstream
master
, in terms of Cabal version number - User-overridden version having a PR supplied and the PR not being merged
- User-overridden version having the same Cabal version as upstream
master
When I run the audit script and see any warnings, that means actions need to be taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, if you've automated these things, then that's a pretty good solution. :-) It would be great if you could provide a brief step-by-step write-up of how to run those scripts of yours so that I know how to run them, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern them being such a mess, I'm somewhat ashamed to bring them to light -- this is truly a case of exploratory chaos -- in bash..
That said, I'll close my eyes and still do this -- just give me a bit more time..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've mostly refactored the thing into a tolerable shape.
I guess a small test suite is what remains.
## • Could not deduce (Semigroup (IterT m a)) | ||
## arising from the superclasses of an instance declaration | ||
## from the context: (Monad m, Monoid a) | ||
src = pkgs.fetchgit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to use fetchGitHub
instead of fetchgit
? It's a minor optimization, granted, but fetchGitHub
downloads a single tarball rather than fetching each file individually and is therefore more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I'd be happy to merge this PR. Let me know when all pending stages are pushed, please.
2897a7f
to
ae1e9fb
Compare
@peti, I believe I have addressed your suggestions. I can't vouch 100% on the necessity of these overrides, since they are auto-generated, and there's lots of things to keep in mind -- heuristics can only go so far. |
Motivation for this change
Supply a set of fixes to make more packages buildable with GHC 8.4-alpha2.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)