diff --git a/.gitignore b/.gitignore index 99763a9ec59cfc4eeeef3772d0609d9ba904c6c6..4c63cd4d6c43127c17deff6eca36b053de2329c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ dist-newstyle packages -cabal.project.local \ No newline at end of file +cabal.project.local +result* diff --git a/default.nix b/default.nix index 1a6a0ee4da75fbc7a7098f6881afc2e8e2ae4194..9759f6f3ba58afa603e31e404048353a67ef2266 100644 --- a/default.nix +++ b/default.nix @@ -18,7 +18,7 @@ let in # ghc: path to a GHC source tree -{ ghc ? import ./ghc-prerelease.nix +{ ghc ? (import scripts/ghc-from.nix { pkgs = import "${baseNixpkgs}" {}; }).latest , haskellOverrides ? (self: super: {}) }: @@ -39,7 +39,7 @@ let in fetch versions; # Should this be self? - ghcHEAD = ghc super; + ghcHEAD = ghc; bootstrapHaskellPackages = self.haskell.packages.ghc865; diff --git a/ghc-from-source.nix b/ghc-from-source.nix deleted file mode 100644 index 608c7b3101bc380abb59476aea244ca6e3c7cfd6..0000000000000000000000000000000000000000 --- a/ghc-from-source.nix +++ /dev/null @@ -1,22 +0,0 @@ -# Build a compiler from a GHC source tree. -# - -# ghcTree: path to a GHC source tree -{ ghcTree }: pkgs: - -let - base = pkgs.callPackage "${pkgs.path}/pkgs/development/compilers/ghc/head.nix" rec { - bootPkgs = pkgs.haskell.packages.ghc843; - inherit (bootPkgs) alex happy hscolour; - buildLlvmPackages = pkgs.buildPackages.llvmPackages_6; - llvmPackages = pkgs.llvmPackages_6; - version = "8.6.0"; - }; -in base.overrideAttrs (oldAttrs: { - src = with pkgs.lib; cleanSourceWith { - src = ghcTree; - filter = name: type: cleanSourceFilter name type - && ! hasSuffix "are-validating.mk" name - && ! hasSuffix "_build" name; - }; -}) diff --git a/ghc-prerelease.nix b/ghc-prerelease.nix deleted file mode 100644 index 8df1cc8a91addcda2b36779fbd1025bc8bebab3a..0000000000000000000000000000000000000000 --- a/ghc-prerelease.nix +++ /dev/null @@ -1,21 +0,0 @@ -# Specify the precise commit of GHC that we are going to use by default -nixpkgs: -let spec = - { - version = "8.6.1.20180716"; - src = - nixpkgs.fetchgit { - url = "git://git.haskell.org/ghc.git"; - rev = "ghc-8.6.1-alpha2"; - sha256 = "03y824yfy1xh2cznq5q75sql8pb0lxyw9ry82jgms9jampky98x6"; - }; - }; -in - -(nixpkgs.haskell.compiler.ghcHEAD.override { - version = spec.version; - bootPkgs = nixpkgs.haskell.packages.ghc865; -}).overrideAttrs(oldAttrs: { - src = spec.src; -}) - diff --git a/scripts/build-all.nix b/scripts/build-all.nix index 344bd3c3aa2e9389f7f604c6fb535a2e9191e018..7f9d87716edb6a4cfc6e30a6c2e788c1341a33f7 100644 --- a/scripts/build-all.nix +++ b/scripts/build-all.nix @@ -9,21 +9,10 @@ }: let + ghc-from = import ./ghc-from.nix { pkgs = nixpkgs; }; + # GHC from the given bindist. - ghc = - let - commit = "027df18eb894ef622f67b2f487a851dc534403e3"; - src = fetchTarball { - url = "https://github.com/bgamari/ghc-artefact-nix/archive/${commit}.tar.gz"; - sha256 = "0ijdpqsg8b7hz89hpgmpzfvg70y6yfq4wrqgngvqlfri5hy9fmg3"; - }; - in nixpkgs.callPackage "${src}/artifact.nix" {} { - ncursesVersion = "6"; - bindistTarball = - if builtins.typeOf bindistTarball == "path" - then bindistTarball - else builtins.fetchurl bindistTarball; - }; + ghc = ghc-from.bindist { inherit bindistTarball; }; # Build configuration. nixpkgs = import ../. { diff --git a/scripts/ghc-from.nix b/scripts/ghc-from.nix new file mode 100644 index 0000000000000000000000000000000000000000..f3e0973545ded67305a4ba3ee5633d12357a20f8 --- /dev/null +++ b/scripts/ghc-from.nix @@ -0,0 +1,57 @@ +{ pkgs }: + +rec { + # Use GHC from a fedora27 binary distribution tarball via ghc-artefact-nix. + bindist = { bindistTarball }: + let + commit = "027df18eb894ef622f67b2f487a851dc534403e3"; + src = fetchTarball { + url = "https://github.com/bgamari/ghc-artefact-nix/archive/${commit}.tar.gz"; + sha256 = "0ijdpqsg8b7hz89hpgmpzfvg70y6yfq4wrqgngvqlfri5hy9fmg3"; + }; + in pkgs.callPackage "${src}/artifact.nix" {} { + ncursesVersion = "6"; + inherit bindistTarball; + }; + + # Use GHC built from a local GHC source tree. + # + # ghcTree: path to a GHC source tree + source = { ghcTree }: + let + base = pkgs.callPackage "${pkgs.path}/pkgs/development/compilers/ghc/head.nix" rec { + bootPkgs = pkgs.haskell.packages.ghc843; + inherit (bootPkgs) alex happy hscolour; + buildLlvmPackages = pkgs.buildPackages.llvmPackages_6; + llvmPackages = pkgs.llvmPackages_6; + version = "8.6.0"; + }; + in base.overrideAttrs (oldAttrs: { + src = with pkgs.lib; cleanSourceWith { + src = ghcTree; + filter = name: type: cleanSourceFilter name type + && ! hasSuffix "are-validating.mk" name + && ! hasSuffix "_build" name; + }; + }); + + # Use GHC from a released binary distribution on downloads.haskell.org + release = { tarballPath, sha256 }: + bindist { + bindistTarball = pkgs.fetchurl { + url = "https://downloads.haskell.org/ghc/${tarballPath}"; + inherit sha256; + }; + }; + + ############################### + # Official Releases + ############################### + + v8_8_1-rc1 = release { + tarballPath = "8.8.1-rc1/ghc-8.8.0.20190721-x86_64-fedora27-linux.tar.xz"; + sha256 = "0hvclcplv7j8g4634cm61qgw4a23kk2njp7fpm5rbzhd8px2fdc7"; + }; + + latest = v8_8_1-rc1; +}