commercialhaskell / lts-haskell

LTS Haskell build plans
http://www.stackage.org/
159 stars 15 forks source link

LTS-12 should add text-1.2.3.0 to GHC core-packages #158

Closed 4e6 closed 6 years ago

4e6 commented 6 years ago

Multiple text-1.2.3.0 library (included in GHC core-packages and Stackage LTS) causes build failures in nix.

Example of building http-types from nixpkgs-stackage overlay:

$ nix-build -E '(import <nixpkgs> { overlays = [ (import (builtins.fetchTarball https://github.com/typeable/nixpkgs-stackage/archive/e6168cfc0339a4186008ab87c35e8e5d685ed5c4.tar.gz)) ]; })' -A haskell.packages.stackage.lts-120.http-types

...
Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package http-types (http-types-0.12.1) requires text-1.2.3.0
      package uuid-types (uuid-types-1.0.3-DoG2VMSRCZc2xYnz9Ty0t1) requires text-1.2.3.0-AYH1KcMLBWRTmytkzQ4Wc
      package scientific (scientific-0.3.6.2-9xH2ZaXomHRBoCxsQXjL9e) requires text-1.2.3.0-AYH1KcMLBWRTmytkzQ4Wc
      package quickcheck-instances (quickcheck-instances-0.3.18-6PdMwGqXED9A1buwoV6pzb) requires text-1.2.3.0-AYH1KcMLBWRTmytkzQ4Wc
      package hashable (hashable-1.2.7.0-8eHtWdj9qj7ej7O0FoKgf) requires text-1.2.3.0-AYH1KcMLBWRTmytkzQ4Wc
      package case-insensitive (case-insensitive-1.2.0.11-2hxe1lYp3jvAfEULLCuXqw) requires text-1.2.3.0-AYH1KcMLBWRTmytkzQ4Wc
...
*** abort because of serious configure-time warning from Cabal
snoyberg commented 6 years ago

text is definitely a reinstallable package, and we've needed to install new versions of it in an LTS or Nightly release in the past. This sounds like a bug in the Nix build scripts, it is working as expected in Stackage.

4e6 commented 6 years ago

I'm ok with the text library in LTS.

I would like to see text: 1.2.3.0 in the core-packages section of Stackage build plan.

 grep -A25 'system-info:' lts-12.0.yaml
system-info:
  core-packages:
    ghc: '8.4.3'
    bytestring: '0.10.8.2'
    unix: '2.7.2.2'
    base: '4.11.1.0'
    time: '1.8.0.2'
    hpc: '0.6.0.3'
    filepath: '1.4.2'
    process: '1.6.3.0'
    array: '0.5.2.0'
    integer-gmp: '1.0.2.0'
    containers: '0.5.11.0'
    ghc-boot: '8.4.3'
    binary: '0.8.5.1'
    ghc-prim: '0.5.2.0'
    ghci: '8.4.3'
    rts: '1.0'
    terminfo: '0.4.1.1'
    transformers: '0.5.5.0'
    deepseq: '1.4.3.0'
    ghc-boot-th: '8.4.3'
    pretty: '1.1.3.6'
    template-haskell: '2.13.0.0'
    directory: '1.3.1.5'
  ghc-version: '8.4.3'

I thouthg that it is a list of libraries that were used to build GHC.

I guess I can deal with it in nix, but since I saw that the core-packages list is incomplete, I decided that it is an issue with the LTS yaml definition.

bergmark commented 6 years ago

Cabal >= 2.2 depends on text, would a new text release cause issues without this?

snoyberg commented 6 years ago

The core-packages list is kept slim intentionally, to avoid having packages get pinned down. We could theoretically consider modifying the Stackage build process to allow more packages to stay unpinned when possible, but such an overhaul would need to go into the new tool.

4e6 commented 6 years ago

In nix, we are marking the libraries which come with the GHC. In stackage overlay this list is generated from core-packages:

https://github.com/typeable/nixpkgs-stackage/blob/d7e07f56b9292d232c13e78566e238512fae7219/stackage/lts-12.0/configuration-packages.nix#L6-L29

Otherwise, we can get into the situation described above when Cabal detects two versions of the same package in the database:

This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.

I didn't expect that adding new packages to core-packages will disrupt the Stackage build process. I will be ok with the manual override for now.