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

haskellPackages: GHC 9.10 fix, infrastructure improvements #315167

Merged
merged 41 commits into from
Jun 8, 2024

Commits on May 26, 2024

  1. Configuration menu
    Copy the full SHA
    8be5345 View commit details
    Browse the repository at this point in the history
  2. haskellPackages.mkDerivation: limit GHC_PACKAGE_PATH to test suite

    Previously, we would set GHC_PACKAGE_PATH after configure, the reasons
    being that
    
    1. Setup.hs configure forbids this from being set since it can make a
       build fail that would otherwise succeed (since it influences how
       GHC behaves when invoked by Cabal).
    2. Setting GHC_PACKAGE_PATH being set is sound in our case, since
       we set it precisely to the packages available to Cabal at configure
       time, so there should be no room for a mismatch.
    3. Some test suites require GHC_PACKAGE_PATH or GHC_ENVIRONMENT to be
       set, so they can invoke GHC(i) with build dependencies available.
       Cabal >= 3.12 forbids GHC_PACKAGE_PATH from being set after
       <haskell/cabal@d6e38041a7c778fadf8f416>.
       Setting GHC_ENVIRONMENT would be possible, but is cumbersome without
       cabal-install (which has the handy cabal exec command which takes
       care of that). Additionally, it is not clear if it'll remain possible
       to do that: <haskell/cabal#7792>.
    
    Our solution to Cabal 3.12's change is to be more targeted about setting
    GHC_PACKAGE_PATH: We _just_ set it for the actual test suite executable.
    This can be achieved by using --test-wrapper which when given is invoked
    by Cabal to run the test suite. Here we can set any environment
    variables after Cabal has already done its environment checks. As long
    as we don't do anything stupid, this should be unproblematic.
    
    Users can also arbitrarily influence what GHC_PACKAGE_PATH will contain
    using the NIX_GHC_PACKAGE_PATH_FOR_TEST environment variable. This is
    un(der)documented for now, since I want to keep some wiggle room for
    changing stuff in the coming weeks. Also it's rarely necessary to
    actually touch this variable.
    sternenseemann committed May 26, 2024
    Configuration menu
    Copy the full SHA
    120f242 View commit details
    Browse the repository at this point in the history
  3. haskell.compiler.ghc9{6,8}: fix elfutils splicing

    elfutils is used in the RTS (rts/Libdw.c), i.e. it will be used on the
    target platform.
    
    Tested via pkgsCross.gnu32.haskellPackages.ghc [1], though #304605 needs
    to be cherry-picked for elfutils to build.
    
    [1]: nix-shell -E 'with import ./. { crossSystem = "i686-linux"; };
           mkShell { nativeBuildInputs = [haskellPackages.ghc ]; }'
    sternenseemann committed May 26, 2024
    Configuration menu
    Copy the full SHA
    69bdf62 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2024

  1. Configuration menu
    Copy the full SHA
    29eb2c0 View commit details
    Browse the repository at this point in the history
  2. elmPackages.elm: fix build failure on darwin

    Patches `crypton-x509-system` to use the full path to the `security`
    binary.
    sandydoo committed May 27, 2024
    Configuration menu
    Copy the full SHA
    9dd7a82 View commit details
    Browse the repository at this point in the history
  3. haskell.lib.compose.justStaticExecutables: Forbid references to GHC

    This makes `justStaticExecutables` error if the produced store path
    contains references to GHC. This is almost always erroneous and due to
    the generated `Paths_*` module being imported. This helps prevent
    `justStaticExecutables` from producing binaries with closure sizes in
    the gigabytes.
    
    See: #164630
    
    Co-authored-by: sternenseemann <[email protected]>
    9999years and sternenseemann committed May 27, 2024
    Configuration menu
    Copy the full SHA
    d261882 View commit details
    Browse the repository at this point in the history
  4. haskellPackages.mkDerivation: no rebuild w/o disallowedRequisites

    This change ensures that packages won't be rebuild compared to before
    the introduction of disallowedRequisites/disallowGhcReference unless
    they use one of those arguments.
    
    It may be nice to revert this in the future (via staging) for greater
    simplicity, but will help with initial regression testing.
    sternenseemann committed May 27, 2024
    Configuration menu
    Copy the full SHA
    0454f7b View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. Configuration menu
    Copy the full SHA
    0cad2ef View commit details
    Browse the repository at this point in the history
  2. git-annex: pass setup package db to GHC used for building installer

    After 120f242, GHC_PACKAGE_PATH isn't
    set implicitly in installPhase anymore. Instead we achieve the same by
    telling the Makefile the exact ghc command line to use.
    
    As a benefit, we can now cleanly separate build and host in this case:
    We used to (implicitly) reuse the host package db. Now we can explicitly
    request the package db also used for building Setup.hs.
    sternenseemann committed May 28, 2024
    Configuration menu
    Copy the full SHA
    482ab92 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Configuration menu
    Copy the full SHA
    a3713f0 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2024

  1. Configuration menu
    Copy the full SHA
    7476d0d View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. haskellPackages.ad: disable problematic test on x86_64-darwin

    It is somewhat curious that it behaves differently exclusively here, but
    I don't think it is necessary to stop shipping a package due to floating
    point arithmetic error—it would be unreasonable to assume there were
    none…
    
    See ekmett/ad#113.
    sternenseemann committed May 31, 2024
    Configuration menu
    Copy the full SHA
    d902325 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c2b4890 View commit details
    Browse the repository at this point in the history
  3. haskell.packages.ghc910: work around aarch64-darwin output cycles

    This ports our infamous patch for Cabal that prevents certain parts of
    the Paths_* module from being generated in order to prevent unnecessary
    references on aarch64-darwin, to GHC >= 9.10.
    
    See also:
    
    - Original issues: #140774
    - Patches
      - Original patch for GHC >= 8.10 && < 9.2 / Cabal >= 3.2 && < 3.6:
        b0dcd7f
      - Patch for GHC >= 9.2 && < 9.10 / Cabal >= 3.6 && < 3.12: #216857,
        f6f780f129f50df536fb30,
        …
    sternenseemann committed May 31, 2024
    Configuration menu
    Copy the full SHA
    fc1e809 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2024

  1. Configuration menu
    Copy the full SHA
    26c4820 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2024

  1. Configuration menu
    Copy the full SHA
    d865fb6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e26e621 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2024

  1. Configuration menu
    Copy the full SHA
    ac1903e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2d2e0b1 View commit details
    Browse the repository at this point in the history
  3. cabal2nix: Fix for justStaticExecutables

    Remove references to `hpack` and `distribution-nixpkgs` paths so that
    `cabal2nix` can build on macOS.
    
    See: #304352
    9999years authored and sternenseemann committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    2901eb8 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

  1. Configuration menu
    Copy the full SHA
    14af822 View commit details
    Browse the repository at this point in the history
  2. haskell.packages.ghc98.ghc-lib: downgrade to match ghc-lib-parser*

    I suspect that we'll be able to upgrade to 9.10.* for all three packages
    after the next haskell-language-server update. I'll leave that to
    maralorn.
    sternenseemann committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    b30eb6f View commit details
    Browse the repository at this point in the history
  3. emanote: drop justStaticExecutables

    Since emanote incurs a reference on GHC on all platforms this override
    is all but uselless.
    sternenseemann committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    4def049 View commit details
    Browse the repository at this point in the history
  4. haskell.packages.ghc90.ghc-lib*: use 9.2.* versions

    This matches what we do for GHC 8.10.7 where we also can't build the 9.6
    versions.
    sternenseemann committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    8ff463e View commit details
    Browse the repository at this point in the history
  5. haskell.packages.*.ghc-tags: unbreak

    This just requires picking the right version of the package for all
    compiler versions.
    sternenseemann committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    bd69426 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Configuration menu
    Copy the full SHA
    daadd0b View commit details
    Browse the repository at this point in the history
  2. Merge pull request #315141 from sandydoo/fix-elm

    elmPackages.elm: fix build failure on darwin
    turboMaCk authored Jun 5, 2024
    Configuration menu
    Copy the full SHA
    6f29411 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2024

  1. Configuration menu
    Copy the full SHA
    bd4363d View commit details
    Browse the repository at this point in the history
  2. cabal-install: Fix for justStaticExecutables

    Fixes `cabal-install` to remove references to GHC, mostly through other
    libraries that are included in the binary.
    
    See: #304352
    
    Co-authored-by: sternenseemann <[email protected]>
    9999years and sternenseemann committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    caa1c96 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f166c77 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2024

  1. Configuration menu
    Copy the full SHA
    a5d1b90 View commit details
    Browse the repository at this point in the history
  2. gitit: drop reference prevention code

    All these references would (indirectly) incur a GHC requisite which is
    prevented by #304352 via justStaticExecutables. Consequently, we can
    stop setting disallowedReferences.
    
    As it turns out the references we were removing aren't currently
    created, so our life gets even easier.
    sternenseemann committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    1285457 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    59b26ed View commit details
    Browse the repository at this point in the history
  4. gitit: fix build with plugin support

    Since it incurs a GHC reference anyways, we have to disable
    justStaticExecutables!
    sternenseemann committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    2810884 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8aae50a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    46638ff View commit details
    Browse the repository at this point in the history
  7. top-level/release-haskell.nix: update list of Haskell executables

    - Address some removals.
    - Add all missing packages that use justStaticExecutables.
    sternenseemann committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    3b45526 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2024

  1. Configuration menu
    Copy the full SHA
    26e3a02 View commit details
    Browse the repository at this point in the history
  2. treewide: no justStaticExecutables on aarch64-darwin for bogus refs

    This commit disables justStaticExecutables for packages on
    aarch64-darwin that incur a (usually incorrect) reference on GHC.
    justStaticExecutables now fails when a GHC reference remains in the
    output (#304352). Due to this reference justStaticExecutables (before
    these changes) would only marginally reduce closure size.
    
    In the future, we'll be able to re-introduce justStaticExecutables
    after (manually) removing the incorrect references stemming from the use
    of Paths_* modules. Tracking Issue: #318013
    sternenseemann committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    d785f11 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1a818e3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    50848d1 View commit details
    Browse the repository at this point in the history