on master help sign in
Merge pull request #4357 from qrilka/curator-stack-build

Stackage builds with new curator/Stack/Nix

commit5517c611e198c10107d38856eaa8ebb8c16d64aa authorMichael Snoyman <michael@snoyman.com> dateWed 27 Feb 2019, 11:35 (8 years ago) parent93c7d435f1fbe0
6 files changed+157
automated/nix-build/README.md+5 automated/nix-build/build.sh+12 automated/nix-build/fetch-nixpkgs.nix+23 automated/nix-build/nixpkgs-src.json+6 automated/nix-build/snapshot-fixed.nix+41 build-constraints.yaml+70
automated/nix-build/README.mdnew file+5
@@ -0,0 +1,5 @@
1+# Building Stackage with Nix
2+
3+The script `build.sh` is supposed to be run in a directory where `curator unpack`
4+was run - it assumes existence of `unpack-dir` directory with a Stackage
5+snapshot `stack.yaml` and unpacked packages in it.
automated/nix-build/build.shnew file+12
@@ -0,0 +1,12 @@
1+#!/usr/bin/env bash
2+
3+set -eu +x
4+
5+NIX_VERSION="2.0.4"
6+curl https://nixos.org/releases/nix/nix-$NIX_VERSION/install | sh
7+
8+# no code to install stack2nix yet
9+
10+stack2nix --cabal2nix-args="--no-hpack" unpack-dir > snapshot.nix
11+
12+nix build -f snapshot-fixed.nix
automated/nix-build/fetch-nixpkgs.nixnew file+23
@@ -0,0 +1,23 @@
1+let
2+ spec = builtins.fromJSON (builtins.readFile ./nixpkgs-src.json);
3+ src = import <nix/fetchurl.nix> {
4+ url = "https://github.com/${spec.owner}/${spec.repo}/archive/${spec.rev}.tar.gz";
5+ inherit (spec) sha256;
6+ };
7+ nixcfg = import <nix/config.nix>;
8+in builtins.derivation {
9+ system = builtins.currentSystem;
10+ name = "${src.name}-unpacked";
11+ builder = builtins.storePath nixcfg.shell;
12+ inherit src;
13+ args = [
14+ (builtins.toFile "builder" ''
15+ $coreutils/mkdir $out
16+ cd $out
17+ $gzip -d < $src | $tar -x --strip-components=1
18+ '')
19+ ];
20+ coreutils = builtins.storePath nixcfg.coreutils;
21+ tar = builtins.storePath nixcfg.tar;
22+ gzip = builtins.storePath nixcfg.gzip;
23+}
automated/nix-build/nixpkgs-src.jsonnew file+6
@@ -0,0 +1,6 @@
1+{
2+ "owner": "NixOS",
3+ "repo": "nixpkgs",
4+ "rev": "c2950341d038995bf46a7b72db961bb3d3e9ac12",
5+ "sha256": "0ghirjm6xvsihci3fladrn4nrnh2yr529v7c406hmw0yp25kv0i4"
6+}
automated/nix-build/snapshot-fixed.nixnew file+41
@@ -0,0 +1,41 @@
1+{ pkgs ? import (import ./fetch-nixpkgs.nix) {}
2+, compiler ? pkgs.haskell.packages.ghc863
3+}:
4+let
5+ snapshot = import ./snapshot.nix { pkgs = pkgs; compiler = compiler; };
6+in
7+ snapshot.override (with pkgs.haskell.lib; {
8+ overrides = self: super: {
9+ # disabling packages from non-hackage-packages.nix
10+ futhark = null;
11+ multi-ghc-travis = null;
12+ vaultenv = null;
13+ # native deps
14+ check-email = super.check-email.override { resolv = null; };
15+ flac = super.flac.override { FLAC = pkgs.flac; };
16+ freenect = super.freenect.override { freenect_sync = null; libfreenect = null; };
17+ haskell-gi = super.haskell-gi.override { gobject-introspection = pkgs.gnome3.gobjectIntrospection; };
18+ HDBC-mysql = super.HDBC-mysql.override { mysqlclient = pkgs.mysql;};
19+ libffi = super.libffi.override { ffi = null; };
20+ # fixes
21+ blas-ffi = overrideCabal super.blas-ffi (
22+ old: { libraryPkgconfigDepends = old.libraryPkgconfigDepends ++ [ pkgs.openblasCompat ]; }
23+ );
24+ odbc = overrideCabal super.odbc (
25+ old: { librarySystemDepends = old.librarySystemDepends ++ [ pkgs.freetds ]; }
26+ );
27+ html-entities = null; # https://github.com/nikita-volkov/html-entities/issues/8
28+ category = null; # conflict in Prelude.hs
29+ constraint = null; # because of category
30+ lame = null; # fails with 'Total ticks: 451489'
31+ proto-lens-protobuf-types = overrideCabal super.proto-lens-protobuf-types (
32+ old: { libraryToolDepends = old.libraryToolDepends ++ [ pkgs.protobuf ]; }
33+ );
34+ # libraft = null; # xxx/postgres/entries.sql: openFile: does not exist (No such file or directory) in libraft-0.2.0.0
35+ xmlbf-xeno = null; # because of html-entities
36+ xmonad = null; # xmonad requires extra patches for Nix
37+ xmonad-contrib = null;
38+ xmonad-extras = null;
39+ hlibgit2 = disableHardening super.hlibgit2 [ "format" ];
40+ };
41+ })
build-constraints.yaml+70
@@ -4875,6 +4875,21 @@ skipped-tests:
48754875 # Uses Cabal's "library internal" stanza feature
48764876 - s3-signer
48774877
4878+ # Due to cycles, which are actually just limitations in Stack right now.
4879+ - call-stack
4880+ - HUnit
4881+ - criterion
4882+ - hspec
4883+ - foundation
4884+ - attoparsec
4885+ - case-insensitive
4886+ - nanospec
4887+ - scientific
4888+ - vector-binary-instances
4889+ - clock
4890+ - js-flot
4891+ - js-jquery
4892+
48784893 # Requires filesystem access
48794894 - json-autotype # https://github.com/commercialhaskell/stackage/issues/4185
48804895
@@ -5132,6 +5147,51 @@ expected-test-failures:
51325147 # https://github.com/commercialhaskell/stackage/issues/4294
51335148 - asif
51345149
5150+ # to get fixed in version after 0.3.2 https://github.com/snoyberg/tar-conduit/issues/28
5151+ - tar-conduit
5152+
5153+ # https://github.com/cchalmers/pcg-random/pull/7
5154+ - pcg-random
5155+
5156+ # https://github.com/snoyberg/conduit/issues/385
5157+ - conduit-extra
5158+
5159+ # Stack builds test and benchmarks in one pass so benchmark could prevent tests from getting built
5160+ - cryptohash
5161+
5162+ # https://github.com/basvandijk/threads/issues/10
5163+ - threads
5164+
5165+ # https://github.com/alphaHeavy/lzma-conduit/issues/19
5166+ - lzma-conduit
5167+
5168+ # https://github.com/blamario/monoid-subclasses/issues/18
5169+ - monoid-subclasses
5170+
5171+ # https://github.com/takenobu-hs/ghci-hexcalc/issues/1
5172+ - ghci-hexcalc
5173+
5174+ # https://github.com/Bodigrim/exp-pairs/issues/16
5175+ - exp-pairs
5176+
5177+ # doctests for the following packages fail because of ambiguous module
5178+ # names, to be fixed in https://github.com/sol/doctest/pull/218
5179+ - blaze-colonnade
5180+ - co-log-core
5181+ - colonnade
5182+ - control-dsl
5183+ - dhall
5184+ - greskell-core
5185+ - jose-jwt
5186+ - jwt
5187+ - language-nix
5188+ - lens-regex
5189+ - pcre-heavy
5190+ - servant-checked-exceptions-core
5191+ - servant-rawm
5192+ - vinyl
5193+ - world-peace
5194+
51355195# end of expected-test-failures
51365196
51375197# Benchmarks which are known not to build. Note that, currently we do not run
@@ -5418,6 +5478,16 @@ skipped-benchmarks:
54185478 # See: https://github.com/fpco/stackage-curator/issues/68
54195479 - tomland
54205480
5481+ # Due to cycles, which are actually just limitations in Stack right now.
5482+ - criterion
5483+ - foundation
5484+ - hspec
5485+ - attoparsec
5486+ - case-insensitive
5487+ - nanospec
5488+ - scientific
5489+ - vector-binary-instances
5490+
54215491# end of skipped-benchmarks
54225492
54235493