Skip to content

Commit

Permalink
Update static Nix build (#2001)
Browse files Browse the repository at this point in the history
This is a revamp of our use of
[fully static Haskell executables](NixOS/nixpkgs#43795).
The main changes are:

* We can now use a newer revision of Nixpkgs

  The current revision we're using corresponds to Nixpkgs 20.03

* We can now more easily update Nixpkgs

  The logic in this repository more closely tracks how `static-haskell-nix`
  works, so whenever that repository updates Nixpkgs we can pick up the change
  here, too.

  Note that we cannot currently use Nixpkgs `master` due to
  [this issue](NixOS/nixpkgs#85924), but once that is
  fixed when we can track Nixpkgs `master` more freely.

* We no longer need to keep track of separate Nixpkgs revisions for
  static vs. non-static builds

  The two builds can also share dependencies, too.  Only the top-level
  derivations differ now.

The reason that this doesn't use `static-haskell-nix` directly is because of
[`cabal2nix` evaluation failures](nh2/static-haskell-nix#73),
so this change works by lifting just the minimum logic that we need from
the `static-haskell-nix` repository until we can finally use that
repository (or Nixpkgs directly when it's upstreamed).
  • Loading branch information
Gabriella439 authored Aug 22, 2020
1 parent 48fcd20 commit 4fcc8cb
Show file tree
Hide file tree
Showing 88 changed files with 126 additions and 1,680 deletions.
2 changes: 1 addition & 1 deletion dhall/benchmark/deep-nested-large-record/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module Main (main) where

import Data.Void (Void)
import Gauge (defaultMain)
import Gauge (defaultMain)

import qualified Data.Sequence as Seq
import qualified Dhall.Core as Core
Expand Down
5 changes: 2 additions & 3 deletions dhall/benchmark/parser/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import Control.Exception (throw)
import Control.Monad (forM)
import Data.Map (Map, foldrWithKey, singleton, unions)
import Data.Void (Void)
import Gauge (bench, bgroup, defaultMain, env, nf, nfIO, whnf)
import Gauge (bench, bgroup, defaultMain, env, nf, whnf)

import System.Directory

import qualified Codec.Serialise
import qualified Data.ByteString.Lazy
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
Expand Down Expand Up @@ -50,7 +49,7 @@ benchExprFromText name expr =

benchExprFromBytes
:: String -> Data.ByteString.Lazy.ByteString -> Gauge.Benchmark
benchExprFromBytes name bytes = bench name (nf f bytes)
benchExprFromBytes name bs = bench name (nf f bs)
where
f bytes =
case Dhall.Binary.decodeExpression bytes of
Expand Down
4 changes: 2 additions & 2 deletions dhall/dhall.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,11 @@ Benchmark dhall-parser
dhall ,
directory ,
gauge >= 0.2.3 && < 0.3,
serialise ,
text >= 0.11.1.0 && < 1.3
Default-Language: Haskell2010
Other-Extensions:
TypeApplications
ghc-options: -rtsopts
ghc-options: -rtsopts -Wall

Benchmark deep-nested-large-record
Type: exitcode-stdio-1.0
Expand All @@ -719,3 +718,4 @@ Benchmark deep-nested-large-record
dhall ,
gauge >= 0.2.3 && < 0.3
Default-Language: Haskell2010
ghc-options: -Wall
19 changes: 0 additions & 19 deletions nix/packages/HaXml.nix

This file was deleted.

14 changes: 0 additions & 14 deletions nix/packages/HsYAML-aeson.nix

This file was deleted.

20 changes: 0 additions & 20 deletions nix/packages/HsYAML.nix

This file was deleted.

20 changes: 0 additions & 20 deletions nix/packages/ListLike.nix

This file was deleted.

18 changes: 0 additions & 18 deletions nix/packages/QuickCheck.nix

This file was deleted.

10 changes: 0 additions & 10 deletions nix/packages/StateVar.nix

This file was deleted.

31 changes: 0 additions & 31 deletions nix/packages/aeson.nix

This file was deleted.

9 changes: 0 additions & 9 deletions nix/packages/assoc.nix

This file was deleted.

17 changes: 0 additions & 17 deletions nix/packages/atomic-write.nix

This file was deleted.

9 changes: 0 additions & 9 deletions nix/packages/base-compat.nix

This file was deleted.

14 changes: 0 additions & 14 deletions nix/packages/base-orphans.nix

This file was deleted.

21 changes: 0 additions & 21 deletions nix/packages/bifunctors.nix

This file was deleted.

12 changes: 0 additions & 12 deletions nix/packages/cabal-doctest.nix

This file was deleted.

20 changes: 0 additions & 20 deletions nix/packages/cborg-json.nix

This file was deleted.

21 changes: 0 additions & 21 deletions nix/packages/cborg.nix

This file was deleted.

16 changes: 0 additions & 16 deletions nix/packages/charset.nix

This file was deleted.

10 changes: 0 additions & 10 deletions nix/packages/contravariant.nix

This file was deleted.

22 changes: 0 additions & 22 deletions nix/packages/deriving-compat.nix

This file was deleted.

28 changes: 0 additions & 28 deletions nix/packages/doctest.nix

This file was deleted.

Loading

0 comments on commit 4fcc8cb

Please sign in to comment.