Commit af0aa4ec authored by Ben Gamari's avatar Ben Gamari 🐢

Refactor GHC sources

parent cf2bacd8
Pipeline #9226 failed with stage
in 2 minutes
dist-newstyle
packages
cabal.project.local
\ No newline at end of file
cabal.project.local
result*
......@@ -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;
......
# 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;
};
})
# 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;
})
......@@ -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 ../. {
......
{ 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment