2020-05-07 02:16:38 +03:00
final : prev :
2019-12-13 04:44:01 +03:00
let
2021-03-18 09:54:46 +03:00
installDeps = targetPrefix :
# First checks that ghc-pkg runs first with `--version` as failures in the `for` and
# `if` statements will be masked.
''
$ out/bin / $ { targetPrefix } ghc-pkg - - version
2019-12-19 02:42:23 +03:00
for P in $ ( $ out/bin / $ { targetPrefix } ghc-pkg list - - simple-output | sed ' s/- [ 0 -9 ] [ 0 -9 . ] * // g' ) ; do
mkdir - p $ out/exactDeps / $ P
touch $ out/exactDeps / $ P/configure-flags
touch $ out/exactDeps / $ P/cabal.config
if id = $ ( $ out/bin / $ { targetPrefix } ghc-pkg field $ P id - - simple-output ) ; then
echo " - - d e p e n d e n c y = $ P = $ i d " > > $ out/exactDeps / $ P/configure-flags
elif id = $ ( $ out/bin / $ { targetPrefix } ghc-pkg field " z - $ P - z - * " id - - simple-output ) ; then
name = $ ( $ out/bin / $ { targetPrefix } ghc-pkg field " z - $ P - z - * " name - - simple-output )
2019-12-13 04:44:01 +03:00
# so we are dealing with a sublib. As we build sublibs separately, the above
# query should be safe.
2019-12-19 02:42:23 +03:00
echo " - - d e p e n d e n c y = ' ' ${ name #z-$P-z-}=$id" >> $out/exactDeps/$P/configure-flags
2019-12-13 04:44:01 +03:00
fi
2019-12-19 02:42:23 +03:00
if ver = $ ( $ out/bin / $ { targetPrefix } ghc-pkg field $ P version - - simple-output ) ; then
echo " c o n s t r a i n t : $ P = = $ v e r " > > $ out/exactDeps / $ P/cabal.config
echo " c o n s t r a i n t : $ P i n s t a l l e d " > > $ out/exactDeps / $ P/cabal.config
2019-12-13 04:44:01 +03:00
fi
done
2019-12-19 02:42:23 +03:00
mkdir - p $ out/evalDeps
2020-05-11 14:58:42 +03:00
for P in $ ( $ out/bin / $ { targetPrefix } ghc-pkg list - - simple-output | sed ' s/- [ 0 -9 ] [ 0 -9 . ] * // g' ) ; do
2019-12-19 02:42:23 +03:00
touch $ out/evalDeps / $ P
if id = $ ( $ out/bin / $ { targetPrefix } ghc-pkg field $ P id - - simple-output ) ; then
echo " p a c k a g e - i d $ i d " > > $ out/evalDeps / $ P
2019-12-13 04:44:01 +03:00
fi
done
'' ;
2020-07-08 13:54:01 +03:00
# For each architecture, what GHC version we should use for bootstrapping.
2020-06-04 15:29:50 +03:00
buildBootstrapper =
2020-06-06 04:32:09 +03:00
if final . targetPlatform . isAarch64 && final . buildPlatform . isAarch64
2020-06-04 15:29:50 +03:00
then {
2020-06-06 04:32:09 +03:00
compilerNixName = " g h c 8 8 2 " ;
2020-06-04 15:29:50 +03:00
}
else {
2020-06-06 04:32:09 +03:00
compilerNixName = " g h c 8 4 4 " ;
2020-06-04 15:29:50 +03:00
} ;
2021-02-09 04:30:32 +03:00
latestVer = {
" 8 . 6 " = " 8 . 6 . 5 " ;
" 8 . 8 " = " 8 . 8 . 4 " ;
" 8 . 1 0 " = " 8 . 1 0 . 4 " ;
} ;
traceWarnOld = v : x : __trace
" W A R N I N G : ${ x . src-spec . version } i s o u t o f d a t e , c o n s i d e r u s i n g ${ latestVer . ${ v } } . " x ;
2019-12-13 04:44:01 +03:00
in {
2020-05-07 02:16:38 +03:00
haskell-nix = prev . haskell-nix // {
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
# Use this to disable the existing haskell infra structure for testing purposes
2019-11-05 02:50:50 +03:00
compiler =
2020-05-07 02:16:38 +03:00
let bootPkgs = with final . buildPackages ; {
2020-06-06 04:32:09 +03:00
ghc = final . buildPackages . buildPackages . haskell-nix . bootstrap . compiler . " ${ buildBootstrapper . compilerNixName } " ;
2020-07-08 13:54:01 +03:00
alex = final . haskell-nix . bootstrap . packages . alex-unchecked ;
happy = final . haskell-nix . bootstrap . packages . happy-unchecked ;
hscolour = final . haskell-nix . bootstrap . packages . hscolour-unchecked ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
} ;
2020-05-07 02:16:38 +03:00
sphinx = with final . buildPackages ; ( python3Packages . sphinx_1_7_9 or python3Packages . sphinx ) ;
hsc2hs-align-conditionals-patch = final . fetchpatch {
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
url = " h t t p s : / / g i t . h a s k e l l . o r g / h s c 2 h s . g i t / p a t c h / 7 3 8 f 3 6 6 6 c 8 7 8 e e 9 e 7 9 c 3 d 5 e 8 1 9 e f 8 b 3 4 6 0 2 8 8 e d f " ;
sha256 = " 0 p l z s b f a q 6 v b 1 0 2 3 l s a r r j g l w g r 9 c h l d 4 q 3 m 9 9 r c f z x 0 y x 5 m i b p 3 " ;
extraPrefix = " u t i l s / h s c 2 h s / " ;
stripLen = 1 ;
} ;
2020-05-07 02:16:38 +03:00
D5123-patch = final . fetchpatch rec { # https://phabricator.haskell.org/D5123
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
url = " h t t p : / / t a r b a l l s . n i x o s . o r g / s h a 2 5 6 / ${ sha256 } " ;
name = " D 5 1 2 3 . d i f f " ;
sha256 = " 0 n h q w d a m f 2 y 4 g b w q x c g j x s 0 k q x 2 3 w 9 g v 5 k j 0 z v 6 4 5 0 d q 1 9 r j i 8 2 n " ;
} ;
2020-05-07 02:16:38 +03:00
haddock-900-patch = final . fetchpatch rec { # https://github.com/haskell/haddock/issues/900
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
url = " h t t p s : / / p a t c h - d i f f . g i t h u b u s e r c o n t e n t . c o m / r a w / h a s k e l l / h a d d o c k / p u l l / 9 8 3 . d i f f " ;
name = " l o a d p l u g i n s i n m o d u l e s . d i f f " ;
sha256 = " 0 b v v v 0 z s f q 2 5 8 1 z s i r 9 7 z f k g g c 1 k k i r c b b a j c 2 f z 3 b 1 6 9 y c p b h a 1 " ;
extraPrefix = " u t i l s / h a d d o c k / " ;
stripLen = 1 ;
} ;
ghc-patches = version : let
# Returns true iff this derivation's version is strictly older than ver.
2020-02-04 10:19:37 +03:00
versionLessThan = ver : builtins . compareVersions ver version == 1 ;
2020-08-31 02:08:25 +03:00
# Returns true iff this derivation's version is greater than or equal to ver.
2020-02-04 10:19:37 +03:00
versionAtLeast = ver : ! versionLessThan ver ;
2020-05-07 02:16:38 +03:00
from = start : final . lib . optional ( versionAtLeast start ) ;
fromUntil = start : end : final . lib . optional ( versionAtLeast start && versionLessThan end ) ;
until = end : final . lib . optional ( versionLessThan end ) ;
always = final . lib . optional true ;
2020-02-04 10:19:37 +03:00
# Try to avoid reordering the patches unless a patch is added or changed that
# will be applied to most versions of the GHC anyway (reordering the patches
# results in rebuilds of GHC and reduces sharing in /nix/store).
in fromUntil " 8 . 4 . 4 " " 8 . 6 " ./patches/ghc/ghc-8.4.4-reinstallable-lib-ghc.patch
Cleanup iserv patches (#439)
This commit cleans up iserv-related patches, especially for GHC 8.4, by
making sure they are exactly changes made upstream (only with merge
conflicts resolved).
Overall, there are three groups of patches now:
1. move-iserv is merely an upstream change that was merged between 8.4
and 8.6. The previous patch was probably some development version,
now it is the same as upstream.
2. iserv-autoconf was merged upstream between 8.6 and 8.8. The patch
consists entirely of replacing version numbers with variables,
therefore applying the same patch to 8.4 and 8.6 causes conflicts, so
we have two versions of the same patch for simplicity. Additionally,
the 8.6 is different from the upstream one in that it does not remove
the .cabal files, see the commit description in the patch for details.
3. iserv-cleanup was merged between 8.8 and 8.10. It applies cleanly to
8.8 and 8.6, however there is conflict in one line when applying it
to 8.4. As a workaround, when applying this patch to 8.4 we first
prepare the source to avoid the conflict, and then undo this change.
This allows us to use the same main patch for 8.4 as for 8.6 and 8.8.
Also, in all patches changes to .gitignore were manually removed, as
this file does not exist in the Nix checkout of src and this causes
the patches to fail.
2020-02-11 04:32:53 +03:00
++ until " 8 . 6 " ./patches/ghc/iserv-move-8.4.1.patch # 6fbe5f274ba84181f5db50901639ae382ef68c4b -- merged; ghc-8.6.1
2020-02-04 10:19:37 +03:00
++ until " 8 . 6 " ./patches/ghc/hsc2hs-8.4.2.patch
++ until " 8 . 6 " ./patches/ghc/various-8.4.2.patch
++ until " 8 . 6 " ./patches/ghc/lowercase-8.4.2.patch
++ until " 8 . 6 " ./patches/ghc/cabal-exe-ext-8.4.2.patch
++ until " 8 . 6 " ./patches/ghc/ghc-8.4.3-Cabal2201-SMP-test-fix.patch
++ until " 8 . 6 " ./patches/ghc/outputtable-assert-8.4.patch
++ fromUntil " 8 . 6 " " 8 . 6 . 4 " ./patches/ghc/MR148--T16104-GhcPlugins.patch
++ until " 8 . 6 . 4 " ./patches/ghc/MR95--ghc-pkg-deadlock-fix.patch
Cleanup iserv patches (#439)
This commit cleans up iserv-related patches, especially for GHC 8.4, by
making sure they are exactly changes made upstream (only with merge
conflicts resolved).
Overall, there are three groups of patches now:
1. move-iserv is merely an upstream change that was merged between 8.4
and 8.6. The previous patch was probably some development version,
now it is the same as upstream.
2. iserv-autoconf was merged upstream between 8.6 and 8.8. The patch
consists entirely of replacing version numbers with variables,
therefore applying the same patch to 8.4 and 8.6 causes conflicts, so
we have two versions of the same patch for simplicity. Additionally,
the 8.6 is different from the upstream one in that it does not remove
the .cabal files, see the commit description in the patch for details.
3. iserv-cleanup was merged between 8.8 and 8.10. It applies cleanly to
8.8 and 8.6, however there is conflict in one line when applying it
to 8.4. As a workaround, when applying this patch to 8.4 we first
prepare the source to avoid the conflict, and then undo this change.
This allows us to use the same main patch for 8.4 as for 8.6 and 8.8.
Also, in all patches changes to .gitignore were manually removed, as
this file does not exist in the Nix checkout of src and this causes
the patches to fail.
2020-02-11 04:32:53 +03:00
++ fromUntil " 8 . 4 " " 8 . 6 " ./patches/ghc/iserv-autoconf-8.4.1.patch # (same as below, but based on 8.4)
++ fromUntil " 8 . 6 " " 8 . 8 " ./patches/ghc/iserv-autoconf-8.6.1.patch # 8f9f52d8e421ce544d5437a93117545d52d0eabd -- merged; ghc-8.8.1
++ fromUntil " 8 . 4 " " 8 . 6 " ./patches/ghc/iserv-cleanup-8.8.1-prepare-8.4.1.patch # (prepare for below; see patch for details)
++ until " 8 . 1 0 " ./patches/ghc/iserv-cleanup-8.8.1.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/250 -- merged; ghc-8.10.1
++ fromUntil " 8 . 4 " " 8 . 6 " ./patches/ghc/iserv-cleanup-8.8.1-revert-8.4.1.patch # (revert prepare)
2020-02-04 10:19:37 +03:00
++ fromUntil " 8 . 2 " " 8 . 8 " ./patches/ghc/MR545--ghc-pkg-databases.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/545 -- merged; ghc-8.8.1
++ fromUntil " 8 . 6 " " 8 . 8 " ./patches/ghc/outputtable-assert-8.6.patch
++ fromUntil " 8 . 6 . 4 " " 8 . 8 " ./patches/ghc/ghc-8.6.4-reenable-th-qq-in-stage1.patch
++ until " 8 . 8 " ./patches/ghc/0001-Stop-the-linker-panic.patch # https://phabricator.haskell.org/D5012 -- merged; ghc-8.8.1
++ until " 8 . 8 " ./patches/ghc/ghc-8.4.3-Cabal2201-allow-test-wrapper.patch # https://github.com/haskell/cabal/pulls/5995 -- merged; cabal-3.0.0 (ghc-8.8.1)
++ until " 8 . 8 " ./patches/ghc/ghc-8.4.3-Cabal2201-response-file-support.patch # https://github.com/haskell/cabal/pulls/5996 -- merged; cabal-3.0.0 (ghc-8.8.1)
++ until " 8 . 8 " ./patches/ghc/ghc-8.6-Cabal-fix-datadir.patch # https://github.com/haskell/cabal/issues/5862
++ until " 8 . 8 " ./patches/ghc/MR196--ghc-pkg-shut-up.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/196 -- merged; ghc-8.8.1
2020-06-07 06:05:44 +03:00
++ fromUntil " 8 . 6 " " 8 . 1 0 " ./patches/ghc/mistuke-ghc-err_clean_up_error_handler-8ab1a89af89848f1713e6849f189de66c0ed7898.diff # this is part of Phyx- revamped io-manager.
++ until " 8 . 1 0 " ./patches/ghc/ghc-add-keepCAFs-to-rts.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/950 -- open
++ until " 8 . 1 0 " ./patches/ghc/lowercase-8.6.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- merged; ghc-8.8.1
2020-02-04 10:19:37 +03:00
++ always ./patches/ghc/dll-loader-8.4.2.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- open
++ always ./patches/ghc/ghc-8.4.3-Cabal2201-no-hackage-tests.patch # ?
2020-06-07 06:05:44 +03:00
++ until " 8 . 1 0 " ./patches/ghc/MR948--32bit-cross-th.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/948 -- open
2020-02-04 10:19:37 +03:00
++ from " 8 . 8 " ./patches/ghc/cabal-host.patch # https://github.com/haskell/cabal/issues/5887
++ fromUntil " 8 . 6 . 4 " " 8 . 8 " ./patches/ghc/ghc-8.6.4-prim-no-arm-atomics.patch
++ fromUntil " 8 . 6 . 4 " " 8 . 8 " ./patches/ghc/global-offset-table.patch
++ fromUntil " 8 . 6 . 4 " " 8 . 8 " ./patches/ghc/global-offset-table-2.patch
2021-03-28 11:03:20 +03:00
++ until " 9 . 0 " ./patches/ghc/respect-ar-path.patch
2020-06-07 06:05:44 +03:00
++ until " 8 . 1 0 " ./patches/ghc/MR2537-use-one-shot-kqueue-on-macos.patch
2020-05-07 02:16:38 +03:00
++ final . lib . optional ( version == " 8 . 6 . 3 " ) ./patches/ghc/T16057--ghci-doa-on-windows.patch
++ final . lib . optional ( version == " 8 . 6 . 3 " ) ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch
++ final . lib . optional ( version == " 8 . 6 . 4 " ) ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch
++ final . lib . optional ( version == " 8 . 6 . 5 " ) ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch
2020-10-14 15:57:45 +03:00
++ fromUntil " 8 . 6 . 5 " " 8 . 9 " ./patches/ghc/ghc-8.6.5-atomic-arm-arch.patch
2020-05-09 02:04:50 +03:00
++ final . lib . optional ( version == " 8 . 6 . 5 " ) ./patches/ghc/MR3214-writable-rel-ro-data.patch
2020-05-07 02:16:38 +03:00
++ final . lib . optional ( version == " 8 . 8 . 1 " ) ./patches/ghc/ghc-8.8.1-reinstallable-lib-ghc.patch
2020-03-20 01:12:03 +03:00
++ fromUntil " 8 . 8 . 2 " " 8 . 9 " ./patches/ghc/ghc-8.8.2-reinstallable-lib-ghc.patch
2020-05-07 02:16:38 +03:00
++ final . lib . optional ( version == " 8 . 6 . 4 " ) ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch
2021-03-28 11:03:20 +03:00
++ final . lib . optional ( versionAtLeast " 8 . 6 . 4 " && versionLessThan " 9 . 0 " && final . stdenv . isDarwin ) ./patches/ghc/ghc-macOS-loadArchive-fix.patch
2020-06-07 06:05:44 +03:00
++ final . lib . optional ( versionAtLeast " 8 . 4 . 4 " && versionLessThan " 8 . 1 0 " && final . stdenv . isDarwin ) ./patches/ghc/ghc-darwin-gcc-version-fix.patch
++ final . lib . optional ( versionAtLeast " 8 . 1 0 . 1 " && final . stdenv . isDarwin ) ./patches/ghc/ghc-8.10-darwin-gcc-version-fix.patch
2020-06-22 03:03:57 +03:00
# backport of https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3227
# the first one is a prerequisite.
# both are trimmed to only include the make build system part and not the
# hadrian one.
2020-08-11 05:26:50 +03:00
++ fromUntil " 8 . 8 " " 8 . 1 0 . 2 " ./patches/ghc/bec76733b818b0489ffea0834ab6b1560207577c.patch
2020-07-21 05:10:23 +03:00
++ fromUntil " 8 . 8 " " 8 . 8 . 4 " ./patches/ghc/67738db10010fd28a8e997b5c8f83ea591b88a0e.patch
2020-08-11 05:26:50 +03:00
++ fromUntil " 8 . 1 0 " " 8 . 1 0 . 2 " ./patches/ghc/67738db10010fd28a8e997b5c8f83ea591b88a0e.patch
2020-06-23 04:45:22 +03:00
++ final . lib . optional ( versionAtLeast " 8 . 6 . 4 " && versionLessThan " 8 . 8 " ) ./patches/ghc/ghc-no-system-linker.patch
2020-08-11 05:26:50 +03:00
2021-01-11 08:47:56 +03:00
++ fromUntil " 8 . 1 0 . 2 " " 8 . 1 0 . 3 " ./patches/ghc/MR3714-backported-to-8.10.2.patch
2021-02-12 13:06:08 +03:00
# See https://github.com/input-output-hk/haskell.nix/issues/1027
++ final . lib . optional ( versionAtLeast " 8 . 1 0 . 3 " && final . targetPlatform . isAarch64 ) ./patches/ghc/3434.patch
2020-10-09 04:18:02 +03:00
++ from " 8 . 1 0 . 1 " ./patches/ghc/ghc-acrt-iob-func.patch
2020-10-14 02:21:30 +03:00
2021-01-11 08:47:56 +03:00
++ fromUntil " 8 . 1 0 . 1 " " 8 . 1 0 . 3 " ./patches/ghc/ghc-8.10-ubxt.patch
++ fromUntil " 8 . 1 0 . 3 " " 8 . 1 1 " ./patches/ghc/ghc-8.10.3-ubxt.patch
2020-11-05 08:43:25 +03:00
++ final . lib . optional ( versionAtLeast " 8 . 6 . 4 " ) ./patches/ghc/Cabal-3886.patch
2021-03-19 07:01:45 +03:00
++ fromUntil " 8 . 1 0 . 3 " " 8 . 1 0 . 5 " ./patches/ghc/ghc-8.10.3-rts-make-markLiveObject-thread-safe.patch
2021-04-30 00:33:21 +03:00
++ final . lib . optional ( versionAtLeast " 8 . 1 0 . 4 " && final . targetPlatform . isWindows ) ./patches/ghc/ghc-8.10-z-drive-fix.patch
2021-05-21 21:54:19 +03:00
++ final . lib . optional ( versionAtLeast " 8 . 6 . 5 " ) ./patches/ghc/ghc-8.10-windows-add-dependent-file.patch
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
;
in ( {
2020-05-07 02:16:38 +03:00
ghc844 = final . callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc844 ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-07-08 13:54:01 +03:00
inherit sphinx installDeps ;
bootPkgs = bootPkgs // {
# GHC 8.6.5 and earlier need happy 1.19.11
happy = final . haskell-nix . bootstrap . packages . happy-old-unchecked ;
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_5 ;
llvmPackages = final . llvmPackages_5 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
src-spec = rec {
version = " 8 . 4 . 4 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 1 c h 4 j 2 a s g 7 p r 5 2 a i 1 h w z y k x y j 5 5 3 w n d g 7 w q 9 3 i 4 7 q l 4 f l l s p f 4 8 i " ;
} ;
ghc-patches = ghc-patches " 8 . 4 . 4 "
++ [ hsc2hs-align-conditionals-patch D5123-patch ]
2020-05-07 02:16:38 +03:00
++ final . lib . optional final . stdenv . isDarwin ./patches/ghc/ghc-8.4.4-backport-dylib-command-size-limit.patch ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
} ;
2021-02-09 04:30:32 +03:00
ghc861 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 6 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc861 ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-07-08 13:54:01 +03:00
inherit sphinx installDeps ;
bootPkgs = bootPkgs // {
# GHC 8.6.5 and earlier need happy 1.19.11
happy = final . haskell-nix . bootstrap . packages . happy-old-unchecked ;
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_6 ;
llvmPackages = final . llvmPackages_6 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
src-spec = rec {
version = " 8 . 6 . 1 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 d k h 7 i d g r q r 5 6 7 f q 9 4 a 0 f 5 x 3 w 0 r 4 c m 2 y d n 5 1 n b 5 w f i s w 3 r n w 4 9 9 c " ;
} ;
ghc-patches = [ D5123-patch ] ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc862 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 6 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc862 ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-07-08 13:54:01 +03:00
inherit sphinx installDeps ;
bootPkgs = bootPkgs // {
# GHC 8.6.5 and earlier need happy 1.19.11
happy = final . haskell-nix . bootstrap . packages . happy-old-unchecked ;
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_6 ;
llvmPackages = final . llvmPackages_6 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
src-spec = rec {
version = " 8 . 6 . 2 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 1 m b n 3 n 2 y n m p f p b 7 j f n h p z z l i 3 1 q q x q y i 8 w s 7 1 b l w s 3 i 8 4 6 f q 3 a n a " ;
} ;
ghc-patches = ghc-patches " 8 . 6 . 2 "
++ [ D5123-patch ] ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc863 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 6 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc863 ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-07-08 13:54:01 +03:00
inherit sphinx installDeps ;
bootPkgs = bootPkgs // {
# GHC 8.6.5 and earlier need happy 1.19.11
happy = final . haskell-nix . bootstrap . packages . happy-old-unchecked ;
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_6 ;
llvmPackages = final . llvmPackages_6 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
src-spec = rec {
version = " 8 . 6 . 3 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 8 v z q 0 d p g 4 a 3 9 b s 6 1 j 6 r q 4 z 0 n 7 j b y 5 m c 6 9 h 4 m 2 5 x h d 8 r j y v k g 7 l z " ;
} ;
ghc-patches = ghc-patches " 8 . 6 . 3 "
++ [ D5123-patch ] ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc864 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 6 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc864 ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-07-08 13:54:01 +03:00
inherit sphinx installDeps ;
bootPkgs = bootPkgs // {
# GHC 8.6.5 and earlier need happy 1.19.11
happy = final . haskell-nix . bootstrap . packages . happy-old-unchecked ;
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_6 ;
llvmPackages = final . llvmPackages_6 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
src-spec = rec {
version = " 8 . 6 . 4 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 f i h s 1 s r 0 h p k 6 7 d n 9 c m r s a v 1 3 k k c p 9 h z 8 g g d q c r s 8 0 r j 8 v j 0 f p a v " ;
} ;
ghc-patches = ghc-patches " 8 . 6 . 4 "
++ [ D5123-patch ] ;
2021-02-09 04:30:32 +03:00
} ) ;
2020-05-07 02:16:38 +03:00
ghc865 = final . callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc865 ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-07-08 13:54:01 +03:00
inherit sphinx installDeps ;
bootPkgs = bootPkgs // {
# GHC 8.6.5 and earlier need happy 1.19.11
happy = final . haskell-nix . bootstrap . packages . happy-old-unchecked ;
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_6 ;
llvmPackages = final . llvmPackages_6 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
src-spec = rec {
version = " 8 . 6 . 5 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 q g 3 z s m b k 4 r k w k c 3 j p a s 3 z s 7 4 q a x m w 4 s p 4 v 1 m h s b j 0 a 0 d z l s 2 j j d " ;
} ;
ghc-patches = ghc-patches " 8 . 6 . 5 "
++ [ D5123-patch haddock-900-patch ] ;
} ;
2021-02-09 04:30:32 +03:00
ghc881 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 8 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc881 ; } ;
2020-02-04 10:19:37 +03:00
inherit bootPkgs sphinx installDeps ;
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_7 ;
llvmPackages = final . llvmPackages_7 ;
2020-02-04 10:19:37 +03:00
src-spec = rec {
version = " 8 . 8 . 1 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 6 k j 4 f h v i j i n j a f i y 4 s 8 7 3 n 6 0 q l y 3 2 3 r d l z 9 b m c 7 9 n h l p 3 c q 7 2 l h " ;
} ;
ghc-patches = ghc-patches " 8 . 8 . 1 " ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc882 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 8 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc882 ; } ;
2020-02-04 10:19:37 +03:00
inherit bootPkgs sphinx installDeps ;
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_7 ;
llvmPackages = final . llvmPackages_7 ;
2020-02-04 10:19:37 +03:00
src-spec = rec {
version = " 8 . 8 . 2 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 2 q a 6 w g j p x g a k g 7 h v 4 z f d l r x 9 k 7 z x a 5 i 0 2 w n r 6 y 9 f s v 8 j 1 6 s b k h 1 " ;
} ;
ghc-patches = ghc-patches " 8 . 8 . 2 " ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc883 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 8 " {
2020-05-07 02:16:38 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc883 ; } ;
2020-03-04 06:07:01 +03:00
inherit bootPkgs sphinx installDeps ;
2020-05-07 02:16:38 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_7 ;
llvmPackages = final . llvmPackages_7 ;
2020-03-04 06:07:01 +03:00
src-spec = rec {
version = " 8 . 8 . 3 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 1 2 8 g 9 3 2 i 3 w i x 6 i c 0 3 v 0 4 n h 5 7 5 5 v y j i i d z r i 9 i y b w a d 7 2 y f m c 1 p 7 0 " ;
} ;
ghc-patches = ghc-patches " 8 . 8 . 3 " ;
2021-02-09 04:30:32 +03:00
} ) ;
2020-07-21 05:10:23 +03:00
ghc884 = final . callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc884 ; } ;
inherit bootPkgs sphinx installDeps ;
buildLlvmPackages = final . buildPackages . llvmPackages_7 ;
llvmPackages = final . llvmPackages_7 ;
src-spec = rec {
version = " 8 . 8 . 4 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 b g w b x x v d n 5 6 l 9 1 b p 9 p 5 d 0 8 3 g z c f d i 6 z 8 l 8 b 1 7 q z j p r 3 n 8 w 5 w l 7 h " ;
} ;
ghc-patches = ghc-patches " 8 . 8 . 4 " ;
} ;
2021-02-09 04:30:32 +03:00
ghc8101 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 1 0 " {
2020-06-07 06:05:44 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc8101 ; } ;
bootPkgs = bootPkgs // {
2020-10-07 05:42:32 +03:00
# Not using 8.8 due to https://gitlab.haskell.org/ghc/ghc/-/issues/18143
ghc = final . buildPackages . buildPackages . haskell-nix . compiler . ghc865 ;
2020-06-07 06:05:44 +03:00
} ;
inherit sphinx installDeps ;
2020-07-21 05:10:23 +03:00
buildLlvmPackages = final . buildPackages . llvmPackages_9 ;
llvmPackages = final . llvmPackages_9 ;
2020-06-07 06:05:44 +03:00
src-spec = rec {
version = " 8 . 1 0 . 1 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 1 x g d l 6 i g 5 j z l i 3 b g 0 5 4 v f r y f k g 0 y 6 w g g f 6 8 g 6 6 c 3 2 s r 6 7 b w 0 f f s f " ;
} ;
ghc-patches = ghc-patches " 8 . 1 0 . 1 " ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc8102 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 1 0 " {
2020-08-11 05:26:50 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc8102 ; } ;
bootPkgs = bootPkgs // {
2020-10-07 05:42:32 +03:00
# Not using 8.8 due to https://gitlab.haskell.org/ghc/ghc/-/issues/18143
ghc = final . buildPackages . buildPackages . haskell-nix . compiler . ghc865 ;
2020-08-11 05:26:50 +03:00
} ;
inherit sphinx installDeps ;
buildLlvmPackages = final . buildPackages . llvmPackages_9 ;
llvmPackages = final . llvmPackages_9 ;
src-spec = rec {
version = " 8 . 1 0 . 2 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 2 w 8 n 0 8 5 b w 3 8 v y p 6 9 4 j 0 l f k 5 w c n w k d a j 7 h h p 0 s a j 7 1 x 7 4 5 3 3 l m w w " ;
} ;
ghc-patches = ghc-patches " 8 . 1 0 . 2 " ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc8103 = final . callPackage ../compiler/ghc ( traceWarnOld " 8 . 1 0 " {
2021-01-11 08:47:56 +03:00
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc8103 ; } ;
bootPkgs = bootPkgs // {
# Not using 8.8 due to https://gitlab.haskell.org/ghc/ghc/-/issues/18143
ghc = final . buildPackages . buildPackages . haskell-nix . compiler . ghc865 ;
} ;
inherit sphinx installDeps ;
buildLlvmPackages = final . buildPackages . llvmPackages_9 ;
llvmPackages = final . llvmPackages_9 ;
src-spec = rec {
version = " 8 . 1 0 . 3 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 c d r d v s 5 q n q r 9 3 c r 9 z v r l f j v 2 x r 6 7 1 k j j g h n s w 4 a f a 4 h a h c q 7 p 6 c " ;
} ;
ghc-patches = ghc-patches " 8 . 1 0 . 3 " ;
2021-02-09 04:30:32 +03:00
} ) ;
ghc8104 = final . callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc8104 ; } ;
bootPkgs = bootPkgs // {
# Not using 8.8 due to https://gitlab.haskell.org/ghc/ghc/-/issues/18143
ghc = final . buildPackages . buildPackages . haskell-nix . compiler . ghc865 ;
} ;
inherit sphinx installDeps ;
buildLlvmPackages = final . buildPackages . llvmPackages_9 ;
llvmPackages = final . llvmPackages_9 ;
src-spec = rec {
version = " 8 . 1 0 . 4 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 0 3 l i 4 k 1 0 h x g y x c d y y z 2 0 9 2 w x 0 9 s p r 1 5 9 9 h i 0 s x b h 4 m 8 8 9 q d q g b s j " ;
} ;
ghc-patches = ghc-patches " 8 . 1 0 . 4 " ;
2021-01-11 08:47:56 +03:00
} ;
2021-03-28 11:03:20 +03:00
ghc901 = final . callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc901 ; } ;
bootPkgs = bootPkgs // {
ghc = final . buildPackages . buildPackages . haskell-nix . compiler . ghc884 ;
} ;
inherit sphinx installDeps ;
buildLlvmPackages = final . buildPackages . llvmPackages_9 ;
llvmPackages = final . llvmPackages_9 ;
src-spec = rec {
version = " 9 . 0 . 1 " ;
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
sha256 = " 1 y 9 m i 9 b q 7 6 z 0 4 h m g g a v r n 8 j w i 1 g x 9 2 b m 3 z h x 6 z 6 9 y p q 6 w h a 0 6 8 x 5 " ;
} ;
ghc-patches = ghc-patches " 9 . 0 . 1 " ;
} ;
2021-02-16 13:15:55 +03:00
# ghc 8.10.4 with patches needed by plutus
ghc810420210212 = final . callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final . buildPackages . haskell-nix . compiler . ghc810420210212 ; } ;
2020-10-21 07:04:47 +03:00
bootPkgs = bootPkgs // {
2020-10-21 16:59:10 +03:00
# Not using 8.8 due to https://gitlab.haskell.org/ghc/ghc/-/issues/18143
ghc = final . buildPackages . buildPackages . haskell-nix . compiler . ghc865 ;
2020-10-21 07:04:47 +03:00
} ;
inherit sphinx installDeps ;
buildLlvmPackages = final . buildPackages . llvmPackages_9 ;
llvmPackages = final . llvmPackages_9 ;
src-spec = rec {
2021-02-16 13:15:55 +03:00
version = " 8 . 1 0 . 4 " ;
2020-10-21 07:04:47 +03:00
url = " h t t p s : / / d o w n l o a d s . h a s k e l l . o r g / ~ g h c / ${ version } / g h c - ${ version } - s r c . t a r . x z " ;
2021-02-16 13:15:55 +03:00
sha256 = " 0 3 l i 4 k 1 0 h x g y x c d y y z 2 0 9 2 w x 0 9 s p r 1 5 9 9 h i 0 s x b h 4 m 8 8 9 q d q g b s j " ;
2020-10-21 07:04:47 +03:00
} ;
2021-02-16 13:15:55 +03:00
ghc-patches = ghc-patches " 8 . 1 0 . 4 "
2020-10-21 07:04:47 +03:00
++ [ ./patches/ghc/core-field.patch ] ;
2020-12-07 07:19:39 +03:00
2021-02-16 13:15:55 +03:00
# Avoid clashes with normal ghc8104
ghc-version = " 8 . 1 0 . 4 . 2 0 2 1 0 2 1 2 " ;
2020-10-21 07:04:47 +03:00
} ;
2020-11-17 12:22:53 +03:00
} // final . lib . optionalAttrs ( final . targetPlatform . isGhcjs or false ) (
if final . hostPlatform . isGhcjs
then throw " A n a t t e m p t w a s m a d e t o b u i l d g h c j s w i t h g h c j s ( p e r h a p s u s e ` b u i l d P a c k a g e s ` w h e n r e f e r i n g t o g h c ) "
else
2020-02-09 15:03:22 +03:00
# This will inject `exactDeps` and `envDeps` into the ghcjs
# compiler defined below. This is crucial to build packages
# with the current use of env and exact Deps.
( builtins . mapAttrs
( _ : v : v // {
2020-11-05 08:43:38 +03:00
useLLVM = false ;
2020-02-09 15:03:22 +03:00
isHaskellNixBootCompiler = true ;
} )
( {
2020-05-07 02:16:38 +03:00
ghc865 = let buildGHC = final . buildPackages . haskell-nix . compiler . ghc865 ;
in let ghcjs865 = final . callPackage ../compiler/ghcjs/ghcjs.nix {
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
ghcjsSrcJson = ../compiler/ghcjs/ghcjs-src.json ;
2021-03-12 02:21:07 +03:00
ghcjsVersion = " 8 . 6 . 0 . 0 . 1 0 " ;
2020-02-09 15:03:22 +03:00
ghc = buildGHC ;
2020-05-07 02:16:38 +03:00
} ; in let targetPrefix = " j s - u n k n o w n - g h c j s - " ; in final . runCommand " ${ targetPrefix } g h c - 8 . 6 . 5 " {
2021-03-12 02:21:07 +03:00
nativeBuildInputs = [ final . xorg . lndir ] ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
passthru = {
inherit targetPrefix ;
version = " 8 . 6 . 5 " ;
2020-02-09 15:03:22 +03:00
isHaskellNixCompiler = true ;
2020-11-17 12:22:53 +03:00
enableShared = false ;
inherit ( ghcjs865 ) configured-src bundled-ghcjs project ;
2020-02-09 15:03:22 +03:00
inherit buildGHC ;
extraConfigureFlags = [
" - - g h c j s "
" - - w i t h - g h c j s = ${ targetPrefix } g h c " " - - w i t h - g h c j s - p k g = ${ targetPrefix } g h c - p k g "
2021-03-12 02:21:07 +03:00
" - - w i t h - g c c = ${ final . buildPackages . emscripten } / b i n / e m c c "
2020-02-09 15:03:22 +03:00
] ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
} ;
2020-02-09 15:03:22 +03:00
# note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
} ( ''
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
mkdir - p $ out/bin
cd $ out/bin
ln - s $ { ghcjs865 } /bin/ghcjs $ { targetPrefix } ghc
ln - s $ { ghcjs865 } /bin/ghcjs-pkg $ { targetPrefix } ghc-pkg
2020-02-09 15:03:22 +03:00
ln - s $ { buildGHC } /bin/hsc2hs $ { targetPrefix } hsc2hs
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
cd . .
2021-03-12 02:21:07 +03:00
mkdir - p lib / $ { targetPrefix } ghc-8 .6 .5
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
cd lib
2021-03-12 02:21:07 +03:00
lndir $ { ghcjs865 } /lib $ { targetPrefix } ghc-8 .6 .5
2020-02-09 15:03:22 +03:00
'' + i n s t a l l D e p s t a r g e t P r e f i x ) ;
2020-11-17 12:22:53 +03:00
ghc883 = let buildGHC = final . buildPackages . haskell-nix . compiler . ghc883 ;
in let ghcjs883 = final . callPackage ../compiler/ghcjs/ghcjs.nix {
ghcjsSrcJson = ../compiler/ghcjs/ghcjs88-src.json ;
ghcjsVersion = " 8 . 8 . 0 . 0 . 1 " ;
ghc = buildGHC ;
ghcVersion = " 8 . 8 . 3 " ;
compiler-nix-name = " g h c 8 8 3 " ;
} ; in let targetPrefix = " j s - u n k n o w n - g h c j s - " ; in final . runCommand " ${ targetPrefix } g h c - 8 . 8 . 3 " {
2021-03-12 02:21:07 +03:00
nativeBuildInputs = [ final . xorg . lndir ] ;
2020-11-17 12:22:53 +03:00
passthru = {
inherit targetPrefix ;
version = " 8 . 8 . 3 " ;
isHaskellNixCompiler = true ;
enableShared = false ;
inherit ( ghcjs883 ) configured-src bundled-ghcjs project ;
inherit buildGHC ;
extraConfigureFlags = [
" - - g h c j s "
" - - w i t h - g h c j s = ${ targetPrefix } g h c " " - - w i t h - g h c j s - p k g = ${ targetPrefix } g h c - p k g "
2021-03-12 02:21:07 +03:00
" - - w i t h - g c c = ${ final . buildPackages . emscripten } / b i n / e m c c "
2020-11-17 12:22:53 +03:00
] ;
} ;
# note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
} ( ''
mkdir - p $ out/bin
cd $ out/bin
ln - s $ { ghcjs883 } /bin/ghcjs $ { targetPrefix } ghc
ln - s $ { ghcjs883 } /bin/ghcjs-pkg $ { targetPrefix } ghc-pkg
ln - s $ { buildGHC } /bin/hsc2hs $ { targetPrefix } hsc2hs
cd . .
2021-03-12 02:21:07 +03:00
mkdir - p lib / $ { targetPrefix } ghc-8 .8 .3
2020-11-17 12:22:53 +03:00
cd lib
2021-03-12 02:21:07 +03:00
lndir $ { ghcjs883 } /lib $ { targetPrefix } ghc-8 .8 .3
2020-11-17 12:22:53 +03:00
'' + i n s t a l l D e p s t a r g e t P r e f i x ) ;
ghc884 = let buildGHC = final . buildPackages . haskell-nix . compiler . ghc884 ;
in let ghcjs884 = final . callPackage ../compiler/ghcjs/ghcjs.nix {
ghcjsSrcJson = ../compiler/ghcjs/ghcjs88-src.json ;
ghcjsVersion = " 8 . 8 . 0 . 0 . 1 " ;
ghc = buildGHC ;
ghcVersion = " 8 . 8 . 4 " ;
compiler-nix-name = " g h c 8 8 4 " ;
} ; in let targetPrefix = " j s - u n k n o w n - g h c j s - " ; in final . runCommand " ${ targetPrefix } g h c - 8 . 8 . 4 " {
2021-03-12 02:21:07 +03:00
nativeBuildInputs = [ final . xorg . lndir ] ;
2020-11-17 12:22:53 +03:00
passthru = {
inherit targetPrefix ;
version = " 8 . 8 . 4 " ;
isHaskellNixCompiler = true ;
enableShared = false ;
inherit ( ghcjs884 ) configured-src bundled-ghcjs project ;
inherit buildGHC ;
extraConfigureFlags = [
" - - g h c j s "
" - - w i t h - g h c j s = ${ targetPrefix } g h c " " - - w i t h - g h c j s - p k g = ${ targetPrefix } g h c - p k g "
2021-03-12 02:21:07 +03:00
" - - w i t h - g c c = ${ final . buildPackages . emscripten } / b i n / e m c c "
2020-11-17 12:22:53 +03:00
] ;
} ;
# note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
} ( ''
mkdir - p $ out/bin
cd $ out/bin
ln - s $ { ghcjs884 } /bin/ghcjs $ { targetPrefix } ghc
ln - s $ { ghcjs884 } /bin/ghcjs-pkg $ { targetPrefix } ghc-pkg
ln - s $ { buildGHC } /bin/hsc2hs $ { targetPrefix } hsc2hs
cd . .
2021-03-12 02:21:07 +03:00
mkdir - p lib / $ { targetPrefix } ghc-8 .8 .4
2020-11-17 12:22:53 +03:00
cd lib
2021-03-12 02:21:07 +03:00
lndir $ { ghcjs884 } /lib $ { targetPrefix } ghc-8 .8 .4
2020-11-17 12:22:53 +03:00
'' + i n s t a l l D e p s t a r g e t P r e f i x ) ;
2021-03-29 12:36:47 +03:00
ghc8104 = let buildGHC = final . buildPackages . haskell-nix . compiler . ghc8104 ;
in let ghcjs8104 = final . callPackage ../compiler/ghcjs/ghcjs.nix {
ghcjsSrcJson = ../compiler/ghcjs/ghcjs810-src.json ;
ghcjsVersion = " 8 . 1 0 . 2 " ;
ghc = buildGHC ;
ghcVersion = " 8 . 1 0 . 4 " ;
compiler-nix-name = " g h c 8 1 0 4 " ;
} ; in let targetPrefix = " j s - u n k n o w n - g h c j s - " ; in final . runCommand " ${ targetPrefix } g h c - 8 . 1 0 . 4 " {
nativeBuildInputs = [ final . xorg . lndir ] ;
passthru = {
inherit targetPrefix ;
version = " 8 . 1 0 . 4 " ;
isHaskellNixCompiler = true ;
enableShared = false ;
inherit ( ghcjs8104 ) configured-src bundled-ghcjs project ;
inherit buildGHC ;
extraConfigureFlags = [
" - - g h c j s "
" - - w i t h - g h c j s = ${ targetPrefix } g h c " " - - w i t h - g h c j s - p k g = ${ targetPrefix } g h c - p k g "
" - - w i t h - g c c = ${ final . buildPackages . emscripten } / b i n / e m c c "
] ;
} ;
# note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
} ( ''
mkdir - p $ out/bin
cd $ out/bin
ln - s $ { ghcjs8104 } /bin/ghcjs $ { targetPrefix } ghc
ln - s $ { ghcjs8104 } /bin/ghcjs-pkg $ { targetPrefix } ghc-pkg
ln - s $ { buildGHC } /bin/hsc2hs $ { targetPrefix } hsc2hs
cd . .
mkdir - p lib / $ { targetPrefix } ghc-8 .10 .4
cd lib
lndir $ { ghcjs8104 } /lib $ { targetPrefix } ghc-8 .10 .4
'' + i n s t a l l D e p s t a r g e t P r e f i x ) ;
2020-11-17 12:22:53 +03:00
} ) ) ) ) ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
2020-05-21 02:31:26 +03:00
# Both `cabal-install` and `nix-tools` are needed for `cabalProject`
# to check materialized results. We need to take care that when
# it is doing this we do not check the materialization of the
# tools used or there will be infinite recursion.
# always has `checkMaterialization = false` to avoid infinite
# recursion.
2020-07-08 13:54:01 +03:00
cabal-install-tool = { compiler-nix-name , . . . } @ args :
( final . haskell-nix . hackage-package ( {
name = " c a b a l - i n s t a l l " ;
2021-03-01 05:42:23 +03:00
version = " 3 . 4 . 0 . 0 " ;
2020-06-07 06:05:44 +03:00
index-state = final . haskell-nix . internalHackageIndexState ;
materialized = ../materialized + " / ${ compiler-nix-name } / c a b a l - i n s t a l l " ;
2021-03-04 10:10:58 +03:00
} // args ) ) . getComponent " e x e : c a b a l " ;
2020-07-08 13:54:01 +03:00
nix-tools-set = { compiler-nix-name , . . . } @ args :
2020-05-21 02:31:26 +03:00
let
2021-03-28 11:03:20 +03:00
# Until all the dependencies build with 9.0.1 we will have to avoid
# building & testing nix-tools with 9.0.1
compiler-nix-name =
if args . compiler-nix-name == " g h c 9 0 1 "
then " g h c 8 1 0 4 "
else args . compiler-nix-name ;
2020-07-08 13:54:01 +03:00
project =
final . haskell-nix . cabalProject ( {
2021-04-08 03:06:26 +03:00
caller = " n i x - t o o l s - s e t " ;
2020-05-21 02:31:26 +03:00
name = " n i x - t o o l s " ;
2020-06-15 05:36:05 +03:00
src = final . haskell-nix . sources . nix-tools ;
2021-02-18 14:38:36 +03:00
# This is a handy way to use a local git clone of nix-tools when developing
# src = final.haskell-nix.haskellLib.cleanGit { name = "nix-tools"; src = ../../nix-tools; };
2020-05-21 02:31:26 +03:00
index-state = final . haskell-nix . internalHackageIndexState ;
2020-06-07 06:05:44 +03:00
cabalProjectLocal = ''
allow-newer : Cabal:base, cryptohash-sha512:base, haskeline:base
index-state : $ { final . haskell-nix . internalHackageIndexState }
'' ;
2020-07-08 13:54:01 +03:00
materialized = ../materialized + " / ${ compiler-nix-name } / n i x - t o o l s " ;
2020-05-21 02:31:26 +03:00
modules = [ {
packages . transformers-compat . components . library . doExactConfig = true ;
packages . time-compat . components . library . doExactConfig = true ;
packages . time-locale-compat . components . library . doExactConfig = true ;
# Make Cabal reinstallable
nonReinstallablePkgs =
[ " r t s " " g h c - h e a p " " g h c - p r i m " " i n t e g e r - g m p " " i n t e g e r - s i m p l e " " b a s e "
" d e e p s e q " " a r r a y " " g h c - b o o t - t h " " p r e t t y " " t e m p l a t e - h a s k e l l "
" g h c - b o o t "
" g h c " " W i n 3 2 " " a r r a y " " b i n a r y " " b y t e s t r i n g " " c o n t a i n e r s "
" d i r e c t o r y " " f i l e p a t h " " g h c - b o o t " " g h c - c o m p a c t " " g h c - p r i m "
" h p c "
" m t l " " p a r s e c " " p r o c e s s " " t e x t " " t i m e " " t r a n s f o r m e r s "
" u n i x " " x h t m l "
] ;
} ] ;
2021-03-28 11:03:20 +03:00
} // args // { inherit compiler-nix-name ; } ) ;
2021-03-04 10:10:58 +03:00
exes =
let
package = project . getPackage " n i x - t o o l s " ;
in ( builtins . map ( name : package . getComponent " e x e : ${ name } " ) [
" c a b a l - t o - n i x "
" h a s h e s - t o - n i x "
" p l a n - t o - n i x "
" h a c k a g e - t o - n i x "
" l t s - t o - n i x "
" s t a c k - t o - n i x "
" t r u n c a t e - i n d e x "
" s t a c k - r e p o s "
" c a b a l - n a m e "
] ) ++ [
( project . getComponent " h p a c k : e x e : h p a c k " )
] ;
2020-06-07 06:05:44 +03:00
tools = [
final . buildPackages . nix
# Double buildPackages is intentional, see comment in lib/default.nix for details.
final . buildPackages . buildPackages . gitMinimal
final . buildPackages . buildPackages . nix-prefetch-git ] ;
2020-05-21 02:31:26 +03:00
in
final . symlinkJoin {
name = " n i x - t o o l s " ;
2021-03-04 10:10:58 +03:00
paths = exes ;
2020-05-21 02:31:26 +03:00
buildInputs = [ final . makeWrapper ] ;
meta . platforms = final . lib . platforms . all ;
# We wrap the -to-nix executables with the executables from `tools` (e.g. nix-prefetch-git)
# so that consumers of `nix-tools` won't have to provide those tools.
postBuild = ''
for prog in stack-to-nix cabal-to-nix plan-to-nix ; do
wrapProgram " $ o u t / b i n / $ p r o g " - - prefix PATH : " ${ final . lib . makeBinPath tools } "
done
'' ;
} ;
2020-07-08 13:54:01 +03:00
# Memoize the cabal-install and nix-tools derivations by adding:
# haskell-nix.cabal-install.ghcXXX
# haskell-nix.cabal-install-unchecked.ghcXXX
# haskell-nix.nix-tools.ghcXXX
# haskell-nix.nix-tools-unchecked.ghcXXX
2020-08-31 02:08:25 +03:00
# Using these avoids unnecessary calls to mkDerivation.
2020-07-08 13:54:01 +03:00
# For cabal projects we match the versions used to the compiler
# selected for the project to avoid the chance of a dependency
# another GHC version (particularly useful on macOS where
# executables are dynamically linked to GHC itself, which means
# that if you use a tool built with a different GHC you will get
# that GHC itself in your closure).
cabal-install = final . lib . mapAttrs ( compiler-nix-name : _ :
final . haskell-nix . cabal-install-tool { inherit compiler-nix-name ; } ) final . haskell-nix . compiler ;
cabal-install-unchecked = final . lib . mapAttrs ( compiler-nix-name : _ :
2020-07-21 05:10:23 +03:00
final . haskell-nix . cabal-install-tool {
compiler-nix-name =
# If there is no materialized version for this GHC version fall back on
# a version of GHC for which there will be.
if __pathExists ( ../materialized + " / ${ compiler-nix-name } / c a b a l - i n s t a l l / d e f a u l t . n i x " )
then compiler-nix-name
2021-03-01 05:42:23 +03:00
else " g h c 8 1 0 4 " ;
2020-07-21 05:10:23 +03:00
checkMaterialization = false ;
} ) final . haskell-nix . compiler ;
2020-07-08 13:54:01 +03:00
nix-tools = final . lib . mapAttrs ( compiler-nix-name : _ :
final . haskell-nix . nix-tools-set { inherit compiler-nix-name ; } ) final . haskell-nix . compiler ;
nix-tools-unchecked = final . lib . mapAttrs ( compiler-nix-name : _ :
2020-07-21 05:10:23 +03:00
final . haskell-nix . nix-tools-set {
compiler-nix-name =
# If there is no materialized version for this GHC version fall back on
# a version of GHC for which there will be.
if __pathExists ( ../materialized + " / ${ compiler-nix-name } / n i x - t o o l s / d e f a u l t . n i x " )
then compiler-nix-name
2021-03-01 05:42:23 +03:00
else " g h c 8 1 0 4 " ;
2020-07-21 05:10:23 +03:00
checkMaterialization = false ;
} ) final . haskell-nix . compiler ;
2020-07-08 13:54:01 +03:00
# These `internal` versions are used for:
# * `nix-tools` for stack projects (since we use `nix-tools` to process
# the `stack.yaml` file we cannot match the ghc of the project the
# way we do for cabal projects).
# * Scripts are used to update stackage and hackage
# Updating the version of GHC selected here should be fairly safe as
# there should be no difference in the behaviour of these tools.
# (stack projects on macOS may see a significant change in the
# closure size of their build dependencies due to dynamic linking).
2021-06-02 05:40:24 +03:00
internal-cabal-install = final . haskell-nix . cabal-install . ghc8104 ;
internal-nix-tools = final . haskell-nix . nix-tools . ghc8104 ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
# WARN: The `import ../. {}` will prevent
# any cross to work, as we will loose
# the `config` value.
2020-08-31 02:08:25 +03:00
# As such the following sadly won't work :(
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
# haskellPackages = with import ../. {}; {
# hpack = null;
# hello = (hackage-package {
2020-05-07 02:16:38 +03:00
# inherit (final) cabal-install;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
# name = "hello"; version = "1.0.0.2";
# }).components.exes.hello;
# };
# NOTE: 8.6.5 prebuilt binaries on macOS, will yield:
#
# > Linking dist/build/cabal/cabal ...
# > Undefined symbols for architecture x86_64:
# > "_utimensat", referenced from:
# > _cazW_info in libHSdirectory-1.3.3.0.a(Posix.o)
# > ld: symbol(s) not found for architecture x86_64
# > clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
# > `clang' failed in phase `Linker'. (Exit code: 1)
#
# hence we'll use 844 for bootstrapping for now.
# the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
2020-06-06 04:32:09 +03:00
bootstrap = with final . haskell-nix ;
2020-07-08 13:54:01 +03:00
let
# This compiler-nix-name will only be used to build nix-tools and cabal-install
# when checking materialization of alex, happy and hscolour.
compiler-nix-name = " g h c 8 6 5 " ;
nix-tools = final . evalPackages . haskell-nix . nix-tools . ${ compiler-nix-name } ;
cabal-install = final . evalPackages . haskell-nix . cabal-install . ${ compiler-nix-name } ;
# The ghc boot compiler to use to compile alex, happy and hscolour
ghc = final . buildPackages . haskell-nix . bootstrap . compiler . " ${ buildBootstrapper . compilerNixName } " ;
ghcOverride = ghc // { isHaskellNixCompiler = ghc . isHaskellNixBootCompiler ; } ;
index-state = final . haskell-nix . internalHackageIndexState ;
2020-06-06 04:32:09 +03:00
in {
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
# XXX: import ../. will throw away all other overlays, config values, ...
# this is not ideal!
2019-11-05 02:50:50 +03:00
# get binary compilers for bootstrapping. We'll put the eventual proper
# compilers into the same place where nix expects them.
2019-11-10 15:01:30 +03:00
# We mark these compilers as boot compilers to make sure they are only used
# where a boot compiler is expected.
2019-12-13 04:44:01 +03:00
compiler = builtins . mapAttrs ( _ : v :
2019-12-19 02:42:23 +03:00
v . overrideAttrs ( drv : {
postInstall = ( drv . postInstall or " " ) + installDeps " " ;
} ) // {
2020-11-05 08:43:38 +03:00
useLLVM = false ;
2019-12-13 04:44:01 +03:00
isHaskellNixBootCompiler = true ;
}
)
2021-02-10 15:07:16 +03:00
( import sources . old-ghc-nix { pkgs = final ; } ) ;
2019-11-05 02:50:50 +03:00
packages = {
# now that we have nix-tools and hpack, we can just
# use `hackage-package` to build any package from
# hackage with haskell.nix. For alex and happy we
# need to use the boot strap compiler as we need them
# to build ghcs from source.
2020-05-21 02:31:26 +03:00
# guardMaterializationChecks is used here so we
# can turn off materialization checks when
# building ghc itself (since GHC is a dependency
# of the materialization check it would cause
2020-08-31 02:08:25 +03:00
# infinite recursion).
2020-07-08 13:54:01 +03:00
alex-tool = args : tool buildBootstrapper . compilerNixName " a l e x " ( {
2020-05-21 02:31:26 +03:00
version = " 3 . 2 . 4 " ;
2020-07-08 13:54:01 +03:00
inherit ghcOverride nix-tools cabal-install index-state ;
2020-06-06 04:32:09 +03:00
materialized = ../materialized/bootstrap + " / ${ buildBootstrapper . compilerNixName } / a l e x " ;
2020-05-21 02:31:26 +03:00
} // args ) ;
alex = bootstrap . packages . alex-tool { } ;
2020-07-08 13:54:01 +03:00
alex-unchecked = bootstrap . packages . alex-tool { checkMaterialization = false ; } ;
happy-tool = { version ? " 1 . 1 9 . 1 2 " , . . . } @ args : tool buildBootstrapper . compilerNixName " h a p p y " ( {
inherit version ghcOverride nix-tools cabal-install index-state ;
materialized = ../materialized/bootstrap + " / ${ buildBootstrapper . compilerNixName } / h a p p y - ${ version } " ;
2020-05-21 02:31:26 +03:00
} // args ) ;
happy = bootstrap . packages . happy-tool { } ;
2020-07-08 13:54:01 +03:00
happy-unchecked = bootstrap . packages . happy-tool { checkMaterialization = false ; } ;
# Older version needed when building ghc 8.6.5
happy-old = bootstrap . packages . happy-tool { version = " 1 . 1 9 . 1 1 " ; } ;
happy-old-unchecked = bootstrap . packages . happy-tool { version = " 1 . 1 9 . 1 1 " ; checkMaterialization = false ; } ;
2020-05-21 02:31:26 +03:00
hscolour-tool = args : ( hackage-package ( {
2020-07-08 13:54:01 +03:00
compiler-nix-name = buildBootstrapper . compilerNixName ;
2020-05-21 02:31:26 +03:00
name = " h s c o l o u r " ;
version = " 1 . 2 4 . 4 " ;
2020-07-08 13:54:01 +03:00
inherit ghcOverride nix-tools cabal-install index-state ;
2020-06-06 04:32:09 +03:00
materialized = ../materialized/bootstrap + " / ${ buildBootstrapper . compilerNixName } / h s c o l o u r " ;
2021-03-04 10:10:58 +03:00
} // args ) ) . getComponent " e x e : H s C o l o u r " ;
2020-05-21 02:31:26 +03:00
hscolour = bootstrap . packages . hscolour-tool { } ;
2020-07-08 13:54:01 +03:00
hscolour-unchecked = bootstrap . packages . hscolour-tool { checkMaterialization = false ; } ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
} ;
} ;
2019-11-05 02:50:50 +03:00
} ;
Overlays (#261)
The Overlays branch
This is a major reorganization in how haskell.nix is used, and marks our 1.0 release.
The branch doesn't build due to numerous issues that we believe to be with the CI
and not this branch. We expect only very minor adjustments prior to calling this the
official 1.0 release.
* Move iohk-nix patches into haskell.nix
This moves the customizations we did in iohk-nix
into haskell.nix via overlays and config.
Add bootPkgs logic
this moves the nuking of bootPkgs where it belongs. This should eventually still be
removed and replaced by a proper solution, that doesn't require the nuking of
bootPkgs.
Allow us to bootstrap binary ghcs and a cabal-install
With this we can do the following:
```
$ nix repl compiler/old-ghc-nix
nix-repl> :b (let pkgs = import <nixpkgs> {}; in with import ./. {}; import ./compiler/bootstrap/cabal-install.nix { inherit (pkgs) fetchurl stdenv zlib; inherit hackage
; ghc = ghc844; src = pkgs.fetchurl { url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz"; sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm6
5lbnx33"; }; })
```
which wile it may look daunting, will allow us to bootstrap a
cabal-install with a ghc. From that point onwards, we should be able to
build any hackage package via haskell.nix.
Pass through cabal-install version
Better threading of arguments.
Add bootstrap overlay
Allow alex + happy to be built
This still has a wart: we need nix-tools, and for that we use the ghc865 from
nixpkgs. Ideally we'd build nix-tools against a specific ghc, but then
we'd need a build expression for that.
Make ghcjs work
Building something like this:
```
nix build '(with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; }; (haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; })).components.exes.hello'
```
will now work. Assuming `nixpkgs` has been appropriately patched to support the `js-unknown-ghcjs` triple.
Also: this will need an additional `Cabal` patch, to make `Cabal` understand what it needs to do with: `dist/build/hello/hello: copyFile: does not exist (No such file or directory)`
It needs to learn that `dist/build/hello/hello.jsexe` is what it wants to copy and that that is a directory. Luckily we do have some code in Cabal already that does this for `.exe` on windows.
Build `js-unknown-ghcjs` packages with haskell.nix
Using the following expression:
```
with import ./. { nixpkgs = ../nixpkgs; nixpkgsArgs = { crossSystem = { config = "js-unknown-ghcjs"; }; }; };
let Cabal = buildPackages.haskell-nix.hackage-package {
name = "Cabal"; version = "2.4.1.0";
modules = [
{ packages.Cabal.patches = [ ./Cabal-install-folder.diff ]; }
];
}; in
(haskell-nix.hackage-package {
name = "hello"; version = "1.0.0.2";
modules = [
({config, ... }:{ packages.hello.package.setup-depends = [ Cabal ]; })
];}).components.exes.hello
```
in a `test.nix` file. And running
```
nix build -f ./test.nix
```
on it, will produce
```
./result
├── bin
│ └── hello.jsexe
│ ├── all.js
│ ├── all.js.externs
│ ├── index.html
│ ├── lib.js
│ ├── manifest.webapp
│ ├── out.frefs.js
│ ├── out.frefs.json
│ ├── out.js
│ ├── out.stats
│ ├── rts.js
│ └── runmain.js
└── share
└── doc
└── x86_64-linux-ghc-8.6.5
└── hello-1.0.0.2
└── LICENSE
6 directories, 12 files
```
2019-10-21 15:07:58 +03:00
}