mirrored from https://gitlab.haskell.org/ghc/ghc.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
4499b29 Follow GHC changes 8fd6818 Add ways to build hadrian using nix e5c7a29 Do not depend on the in-tree filepath library 9dd7ad2 Fix dependencies 4971843 Bring mtl dependency back 6c5f5c9 Minor clean up of Hadrian dependencies 9aff81d Fix Windows build fa95caa Unbreak `cabal new-build` git-subtree-dir: hadrian git-subtree-split: 4499b29
- Loading branch information
Showing
12 changed files
with
135 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env nix-shell | ||
#! nix-shell -i bash shell.nix | ||
|
||
# This script sets up the build environment by invoking nix-shell shell.nix | ||
# and then runs the hadrian executable. | ||
|
||
function rl { | ||
TARGET_FILE="$1" | ||
|
||
cd "$(dirname "$TARGET_FILE")" | ||
TARGET_FILE="$(basename "$TARGET_FILE")" | ||
|
||
# Iterate down a (possible) chain of symlinks | ||
while [ -L "$TARGET_FILE" ] | ||
do | ||
TARGET_FILE="$(readlink "$TARGET_FILE")" | ||
cd "$(dirname "$TARGET_FILE")" | ||
TARGET_FILE="$(basename "$TARGET_FILE")" | ||
done | ||
|
||
# Compute the canonicalized name by finding the physical path | ||
# for the directory we're in and appending the target file. | ||
PHYS_DIR="$(pwd -P)" | ||
RESULT="$PHYS_DIR/$TARGET_FILE" | ||
echo "$RESULT" | ||
} | ||
|
||
absoluteRoot="$(dirname "$(rl "$0")")" | ||
echo $absoluteRoot | ||
cd "$absoluteRoot" | ||
|
||
hadrian \ | ||
--lint \ | ||
--directory="$absoluteRoot/.." \ | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
packages: ./ | ||
../libraries/Cabal/Cabal/ | ||
../libraries/filepath/ | ||
../libraries/text/ | ||
../libraries/hpc/ | ||
../libraries/parsec/ | ||
../libraries/text/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Invoking nix-shell sets up an environment where we can build ghc | ||
# by only invoking hadrian. | ||
|
||
|
||
{ nixpkgs ? import <nixpkgs> {} }: | ||
|
||
let | ||
haskellPackages = nixpkgs.haskell.packages.ghc821; | ||
|
||
removeBuild = path: type: | ||
let baseName = baseNameOf (toString path); | ||
in | ||
! (baseName == "_build" | ||
|| baseName == "dist" | ||
|| baseName == "dist-newstyle" | ||
|| baseName == ".stack-work" | ||
|| baseName == "config.log" | ||
|| baseName == "config.status" | ||
|| nixpkgs.lib.hasSuffix ".sh" baseName | ||
|| !(nixpkgs.lib.cleanSourceFilter path type)) ; | ||
|
||
filterSrc = path: builtins.filterSource removeBuild path; | ||
|
||
|
||
hadrianPackages = nixpkgs.haskell.packages.ghc821.override { | ||
overrides = self: super: let | ||
localPackage = name: path: self.callCabal2nix name (filterSrc path) {}; | ||
in { | ||
hadrian = localPackage "hadrian" ./. ; | ||
shake = self.callHackage "shake" "0.16" {}; | ||
Cabal = localPackage "Cabal" ./../libraries/Cabal/Cabal ; | ||
filepath = localPackage "filepath" ./../libraries/filepath ; | ||
text = localPackage "text" ./../libraries/text ; | ||
hpc = localPackage"hpc" ./../libraries/hpc ; | ||
parsec = localPackage "parsec" ./../libraries/parsec ; | ||
HUnit = nixpkgs.haskell.lib.dontCheck (self.callHackage "HUnit" "1.3.1.2" {}); | ||
process = localPackage "process" ./../libraries/process ; | ||
directory = localPackage "directory" ./../libraries/directory ; | ||
}; }; | ||
|
||
in | ||
|
||
nixpkgs.stdenv.mkDerivation { | ||
name = "ghc-dev"; | ||
buildInputs = [ | ||
hadrianPackages.hadrian | ||
nixpkgs.haskell.compiler.ghc821 | ||
haskellPackages.alex | ||
haskellPackages.happy | ||
nixpkgs.python3 | ||
nixpkgs.git | ||
nixpkgs.autoconf | ||
nixpkgs.automake | ||
nixpkgs.perl | ||
nixpkgs.gcc | ||
nixpkgs.python3Packages.sphinx | ||
nixpkgs.ncurses | ||
nixpkgs.m4 | ||
nixpkgs.gmp | ||
nixpkgs.file ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters