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

haskell.packages.ghc822/844: Fix configuration and build of GHC822/844 #55703

Closed
wants to merge 6 commits into from

Conversation

artempyanykh
Copy link
Contributor

@artempyanykh artempyanykh commented Feb 13, 2019

Motivation for this change

nix-env -qaP -A haskell.packages.ghc8xx for GHC822 and 844 fails with:

nix called without required argument 'ghc-heap'

Adding ghc-heap = null to respective configuration files leads to further failures due to missing attributes (specific version of haskell packages).
Furthermore, when all configuration problems are resolved the ghc build itself fails due to sphinx.

I'm new to nix, so if there's a way to avoid copy-paste or version-pinning, please let me know!

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Manjaro Linux 18.0.2
  • 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.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

Please don't edit pkgs/development/haskell-modules/hackage-packages.nix. Please see the comment at the very top.

8.4.4 requires < 1.8 sphinx, otherwise build fails on haddock with:
Extension error: The 'ghc-flag' directive is already registered to domain std
@artempyanykh
Copy link
Contributor Author

@peti thanks, I see from @dotlambda 's suggestion how to change version/sha256 without creating new attributes in hackage-packages. I'll make the change.

Co-Authored-By: artempyanykh <artem.pyanykh@gmail.com>
@artempyanykh
Copy link
Contributor Author

artempyanykh commented Feb 13, 2019

@peti looks like after all I haven't completely figured it out. A couple things:

  1. Unfortunately, I couldn't figure out how to call overrideAttrs within configuration-ghc-xx, so I just moved relevant definitions to respective configuration files out of hackage-packages. Even then, it's not particularly clear why we need some special version-pinned packages in a specific ghc configuration (for instance yaml_0_11_.. is no longer a thing in 844 config) or if overrideAttrs is any clearer than just dropping a full derivation.
  2. Cabal_1_24_2_0 in 822 compiles with one more patch for dependency constraint.
  3. hackage-db-2_0_1 fails during compilation --- for some reason aeson doesn't have a dependency on contravarian in hackage-packages which it should have.
  4. stack and hpack_0_31_1 in 844 (after removing non-working yaml dep) started to compile... and still are compiling after several hours. Will update later.

UPD: hpack_0_31_1 builds fine, but stack fails due to build failure of one of its dependencies:

These modules are needed for compilation but not listed in your .cabal file's other-modules:
Data.Algorithm.Diff
Data.Algorithm.DiffOutput

Cabal_1_24_2_0 = overrideCabal super.Cabal_1_24_2_0 (drv: {
prePatch = "sed -i -e 's/process.*< 1.5,/process,/g' Cabal.cabal";
});
Cabal_1_24_2_0 = self.callPackage
Copy link
Member

Choose a reason for hiding this comment

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

What is the point of that change? I don't see what this is supposed to accomplish?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@peti super.Cabal_1_24_2_0 is not a thing anymore (I guess it was in hackage_packages sometime ago, but not now). Without this change nix-env -qaP haskell.packages.ghc822 fails.

I'd simply remove this derivation, but

  1. the comment above says "# Make sure we can still build Cabal 1.x." 🤷‍♂️
  2. removing this derivation is a breaking change if someone depends on it and\or cares.

So, I fixed this super.Cabal_1_24_2_0 issue and adjusted prePatch section so that Cabal successfully builds.

Does this answer your question?

P.S. If no one cares about pkgname_{version} derivations in ghc_8.x configurations, I can just remove them.

Copy link
Member

Choose a reason for hiding this comment

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

Just drop the override. It's been broken for a long time and doubt anyone cares about Cabal 1.x any more.

Cabal_1_24_2_0 = overrideCabal super.Cabal_1_24_2_0 (drv: {
prePatch = "sed -i -e 's/process.*< 1.5,/process,/g' Cabal.cabal";
});
Cabal_1_24_2_0 = self.callPackage
Copy link
Member

Choose a reason for hiding this comment

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

Just drop the override. It's been broken for a long time and doubt anyone cares about Cabal 1.x any more.

@@ -89,7 +116,24 @@ self: super: {
cabal2nix = super.cabal2nix.overrideScope (self: super: { Cabal = self.Cabal_2_2_0_1; });
cabal2spec = super.cabal2spec.overrideScope (self: super: { Cabal = self.Cabal_2_2_0_1; });
distribution-nixpkgs = super.distribution-nixpkgs.overrideScope (self: super: { Cabal = self.Cabal_2_2_0_1; });
hackage-db_2_0_1 = super.hackage-db_2_0_1.overrideScope (self: super: { Cabal = self.Cabal_2_2_0_1; });
hackage-db_2_0_1 = (self.callPackage
Copy link
Member

Choose a reason for hiding this comment

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

Why did you add this Nix build into the overrides file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IDK what's the policy regarding keeping old version pinned derivations (and whether it's important to preserve them).

I assume that according to your comment about Cabal_1_x, no one cares about these, so I just removed them. Let me know if something other is desired.

hpack_0_31_1 = super.hpack_0_31_1.override {
yaml = self.yaml_0_11_0_0;
};
hpack_0_31_1 = self.callPackage
Copy link
Member

Choose a reason for hiding this comment

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

Same here. Why did you add that build expression into the overrides file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@@ -55,7 +55,13 @@ in {
};
ghc844 = callPackage ../development/compilers/ghc/8.4.4.nix {
bootPkgs = packages.ghc822Binary;
inherit (buildPackages.python3Packages) sphinx;
sphinx = buildPackages.python3Packages.sphinx.overridePythonAttrs (oldAttrs: rec {
Copy link
Member

Choose a reason for hiding this comment

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

Please add a sphinx_1_7_9 attribute into python-packages.nix instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@artempyanykh
Copy link
Contributor Author

artempyanykh commented Feb 21, 2019

  • nix-env -qaP -A haskell.packages.ghc8xx works.
  • ghc844 builds just fine.
  • sphinx_1_7_9 moved under pyhon_packages.
  • Old version-pinned derivations in 822/844 configurations are removed.

@peti looks good?

peti pushed a commit that referenced this pull request Feb 27, 2019
ghc-8.4.4 requires sphinx < 1.8, otherwise build fails on haddock with:

    Extension error: The 'ghc-flag' directive is already registered to domain std

Also fixed evaluation errors in configurations of ghc-8.2.x and ghc-8.4.x.

Closes #55703.
@peti
Copy link
Member

peti commented Feb 27, 2019

Merged to haskell-updates as a251d91. I'll merge to master once the test builds at https://hydra.nixos.org/jobset/nixpkgs/haskell-updates have come back successfully.

@peti peti closed this in f7003e5 Feb 27, 2019
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