Commit Graph

218 Commits

Author SHA1 Message Date
Hamish Mackenzie
64cd5f70ce
Fix for emscripten (#1294) 2021-11-17 11:19:52 +13:00
Moritz Angermann
59ad2995cc
Update ghcjs810-src.json (#1291)
* Update ghcjs810-src.json

* Update ghcjs-project.nix

* Update ghcjs.nix

Use nodejs-12_x, to allow larger strings to be loaded. See https://github.com/nodejs/node/issues/33960

* Update comp-builder.nix

Allow large strings, see https://github.com/nodejs/node/issues/33960

* Update cabal-os-arch-comp.nix

* Update ghcjs-src

* Update ghcjs ref

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-11-17 02:17:02 +13:00
Teo Camarasu
8ed2bf2cdb
add patches with non-moving gc fixes for 8.10 (#1290) 2021-11-14 08:15:03 +08:00
Hamish Mackenzie
24b421cbfc
Add ghc 9.2.1 and update internal cabal to 3.6.2 (#1286) 2021-11-13 12:43:04 +13:00
Ross MacLeod
aaf4e230c6
patch out calls to mprotect with len=0 to stop qemu 6.0.0 from signalling ENOMEM (#1289)
* patch out calls to mprotect with len=0 to stop qemu 6.0.0 from signalling ENOMEM

* widen scope of mprotect len=0 patch back to 8.10.1, when the mprotect call was introduced

Co-authored-by: Ross MacLeod <ross@vitalbio.com>
2021-11-12 15:30:01 +08:00
Jean-Baptiste Giraudeau
13164ac0d8
Revert "Use builtins.fetchGit{allRefs=true;} if no ref provided." (#1274)
This reverts commit 9ccc486b9ff51e7f69c6420ded742a597be041fb.

Unfortunately our hydra is built against an old version of nix
which does not support this attribute.
2021-10-22 18:27:20 +02:00
Hamish Mackenzie
a32cbbd188
s/benchmarks/bench/ consistent with ctype from cabal (#1273) 2021-10-22 14:35:00 +13:00
Jean-Baptiste Giraudeau
1205c42154
Some smalls improvements (#1271)
* Use builtins.fetchGit{allRefs=true;} if no ref provided.

 this allows to not being explicit about non-default branches.

* Pass buildProject as arg to first level project modules,

so that it can be used in, eg., shell definition.

* Add hsPkgs to projects modules config.

* Add benchmarks to generated project.flake packages
2021-10-22 14:23:48 +13:00
toonn
cd9beb4ef5
haskell.nix: Improve compiler version mismatch error (#1269)
Nix's assert statements reproduce the assertion almost verbatim in an
error message, this makes for fairly inscrutable errors. I've tried here
to improve the error message by introducing local names (these could
create some confusion because of shadowing if similar names are
introduced in another scope later) and adding a trace messages using
`lib.assertMsg`.

Fixes #1249
2021-10-18 14:06:31 +13:00
JackKelly-Bellroy
2b2745b9b0
musl: override zstd to link statically (#1267) 2021-10-12 13:53:11 +01:00
Hamish Mackenzie
f8d4795cfe
Update ghcjsVersion to match cabal file (#1266)
* Update ghcjsVersion to match cabal file

* Update materialized files

* Update materialized files
2021-10-12 13:28:42 +13:00
Hamish Mackenzie
2b5ad5aced
Add project.buildProject (#1265)
* Add project.buildProject

This exposes the project used by `buildModules`.

* Update overlays/haskell.nix

Co-authored-by: Jean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>

* Update overlays/haskell.nix

Co-authored-by: Jean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>

* Fix syntax error

Co-authored-by: Jean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>
2021-10-11 23:38:09 +13:00
Jean-Baptiste Giraudeau
56f22053e6
Flake: add checks for crossPlatforms. (#1259) 2021-10-06 00:58:31 +13:00
Jean-Baptiste Giraudeau
280ec975e1
Eval pkg-set with a correct buildModules arg (#1258)
issued from from top-level modules evaluation.
 Otherwise `buildModules` can be wrong, failing to correctly evaluate
 modules that can change pkg-set, like:
 ```
{pkgs, ... }: {
  cabalProjectLocal = optionalString pkgs.stdenv.hostPlatform.isWindows ''
    constraints: Win32 ==2.6.1.0, mintty ==0.1.2
  '';
}
```
2021-10-05 23:53:47 +13:00
Hamish Mackenzie
4e8acd3400
Fix issue when mfpr is not in nixpkgs (#1253) 2021-09-28 22:36:02 +13:00
Jean-Baptiste Giraudeau
749a7dc068
Add appendModule function to projects. (#1240)
Allow re-eval of the project with an extra module (or module list).
2021-09-18 14:43:46 +12:00
Hamish Mackenzie
ae5ff8525f
Remove workaround for hls (#1237)
Not needed now ghc-api-compat has been updated in hackage
2021-09-14 15:54:36 +12:00
Hamish Mackenzie
e2f77a9873
Fix evalPackages for flakes that are cross compiling (#1234) 2021-09-10 16:40:37 +12:00
Hamish Mackenzie
f3b109b2fb
Add aarch64-darwin support (#1230) 2021-09-07 22:22:01 +12:00
Hamish Mackenzie
c0b2ad7292
Remove work around for hlint issue (#1221)
See https://github.com/ndmitchell/hlint/issues/1287
2021-09-02 18:00:28 +12:00
Hamish Mackenzie
1f4c2c9b08
Add GHC 8.10.7 (#1220) 2021-09-01 22:43:31 +12:00
Hamish Mackenzie
58dff9550b
Update some older GHC materialization files (#1222) 2021-09-01 20:21:30 +12:00
Teo Camarasu
f624ca5662
Add GHC-8.10.6 (#1214)
Add GHC-8.10.6

Co-authored-by: Peter Becich <peter@simspace.com>
Co-authored-by: Teo Camarasu <teofilcamarasu@gmail.com>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-08-31 04:19:40 +12:00
Hamish Mackenzie
4006fac382
Remove lsp-types workaround add hlint one (#1194) 2021-08-30 16:56:19 +12:00
Travis Whitaker
5d279ecc8b
Fix aarch64 bootstrapping GHC selection. (#1218) 2021-08-29 15:52:50 +12:00
Travis Whitaker
fe0ece2551
Fix eval on aarch64. (#1168)
* Don't use ghc865 for bootstrapping, since it's broken on aarch64.

* Use ghc884 to bootstrap 8.10.x on aarch64
2021-08-28 14:22:29 +12:00
Peter Becich
62f8632b32
old GHC warning for 8.10.4, consistent with other old GHC warnings (#1209) 2021-08-24 20:04:21 +12:00
Hamish Mackenzie
f8a0b92bc3
Add patches speeding up cabal build-tool-depends (#1200)
* Add patches speeding up cabal build-tool-depends

* Add missing brackets and fix paths

* Fix up patches for 3.4

* Fix missing file from patch

* Add comments
2021-08-14 12:05:58 +12:00
Hamish Mackenzie
d5d304d5b5
Flakify all inputs (#1180)
* Include dependencies of haskell.nix that were tracked in `nix/sources.json`
  as flake inputs (`flake.lock` replaces `nix/sources.json`).
* Use `flake-compat` to continue to provide a compatible interface for non
  flake projects.

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
Co-authored-by: Shea Levy <shea@shealevy.com>
2021-08-06 15:54:39 +12:00
Hamish Mackenzie
9ea0e6d8d7
Work around hls issue (#1191)
See https://github.com/haskell/lsp/issues/349
2021-08-06 12:03:53 +12:00
Jean-Baptiste Giraudeau
531c9f4cac
Remove some flake specifics that can mess-up caching. (#1176)
* Remove flake specific sourceOverride that mess-up caching.

* Reduce evalPackages discrepency between flake/non-flake.

* Remove dependency on <nixpkgs> when importing sources.nix
2021-07-28 12:38:03 +12:00
Rodney Lorrimar
4af96f5d1b
overlays/windows.nix: Workaround for remote-iserv libsodium.dll (#1171)
This will use libsodium-vrf if it exists, otherwise libsodium.

See: https://github.com/input-output-hk/iohk-nix/pull/488
2021-07-23 15:46:04 +12:00
Hamish Mackenzie
61e89b7df5
Simplify the way evalPackages works (#1162)
This change uses the same overlay for both flakes and non flake projects.  It chooses where evalPackages should run based on `builtins ? currentSystem` (`currentSystem` will not exist when building flake).

This will be needed to make sure the `evalPackages` still works correctly in #1151 (otherwise the use of `flake-compat` will cause eval-on-build to be used).
2021-07-07 22:43:19 +12:00
Kirill Kuznetsov
d8f6361282
Fix building sphinx documentation with latest nixpkgs-unstable (#1154) (#1160) 2021-07-06 13:23:35 +12:00
Lupino
ccb0050e70
Postgresql static compile set gssSupport false (#1152)
when i compile with musl and postgresql with the follow error

```
fe-connect.c:445:0: error:
     error: undefined reference to 'gss_delete_sec_context'

fe-connect.c:447:0: error:
     error: undefined reference to 'gss_release_name'

fe-auth.c:76:0: error:
     error: undefined reference to 'gss_display_status'

fe-auth.c:79:0: error:
     error: undefined reference to 'gss_release_buffer'

fe-auth.c:142:0: error:
     error: undefined reference to 'gss_init_sec_context'

fe-auth.c:173:0: error:
     error: undefined reference to 'gss_release_buffer'

fe-auth.c:169:0: error:
     error: undefined reference to 'gss_release_buffer'

fe-auth.c:187:0: error:
     error: undefined reference to 'gss_release_name'

fe-auth.c:180:0: error:
     error: undefined reference to 'gss_release_name'

fe-auth.c:182:0: error:
     error: undefined reference to 'gss_delete_sec_context'

fe-auth.c:234:0: error:
     error: undefined reference to 'GSS_C_NT_HOSTBASED_SERVICE'

fe-auth.c:234:0: error:
     error: undefined reference to 'GSS_C_NT_HOSTBASED_SERVICE'

fe-auth.c:234:0: error:
     error: undefined reference to 'gss_import_name'
```
2021-06-29 14:42:24 +12:00
Hamish Mackenzie
6b28399864
Add Hix wrappers for Nix tools (#1053)
The `hix` tools are wrappers for the various `nix` tools that
use `haskell.nix` without the need to add any `.nix` files.

This is useful for:

* A quick way to try out haskell.nix for new users.

* Using haskell.nix to work on projects that do not have
  `.nix` files.

* Testing to see if `haskell.nix` can build a project.

* Making `flake` and `non flake` configurations to check `haskell.nix`
  treats them the same.

The configuration arguments for `Hix` can be (from highest precedence to lowest):

* Passed on the command line with `--arg` (or `--argstr` for string args).

* Placed in `nix/hix.nix` file in the project dir.

* Placed in `~/.config/hix/hix.conf`

Boilerplate `default.nix`, `shell.nix` and `flake.nix` files can be added to a
a project with a `nix/hix.nix` file to make it work with the standard `Nix`
tools.
2021-06-26 17:58:06 +12:00
Moisés Ackerman
2b842f282c
Add nixpkgs-2105 (#1133)
* Add nixpkgs-2105

* [WIP] Drop nixpkgs-2003

* Update all the nixpkgs pins

* Default to nixpkgs-2009 for build.nix

* Update individual jobs to nixpkgs 2105

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-06-23 13:28:52 +12:00
Hamish Mackenzie
f279cdef5f
Update the project modules and fix missing args param (#1144)
There are now 4 project modules used to check the arguments passed to the various project functions:

* `project-common.nix` - Arguments used by all the project functions
* `stack-project.nix` - Used by the `stackProject` and `stackProject'` functions
* `cabal-project.nix` - Used by the `cabalProject` and `cabalProject'` functions
* `project.nix` - Just the `projectFileName` argument that is used by `project` and `project'` functions to determine whether to call `stackProject` or `cabalProject` function.

This also includes the `rawProject.args` that was mistakenly left out of #1141 causing #1142 and improvements for the docs for the use of the `shell` argument in `flake.nix` files.
2021-06-20 18:00:22 +12:00
Hamish Mackenzie
c3841b4208
Add cross compilation and devShell to project.flake (#1141)
The default shell `devShell` works by adding a default `shell` to all projects.  You can pass the shell arguments to the project function using the new `shell` argument:

```
let myProject = haskell-nix.project {
  src = ./.;
  shell.tools = { cabal = {}; };
  shell.crossPlatforms = p: [ p.cross ];
};
```

This will include js-unknown-ghcjs-cabal in the `devShell`.

To add cross compiled outputs to the flake pass `crossPlatforms` to the `flake` function.

```
myProject.flake { crossPlatforms = p: [ p.cross ]; }
```

To cross compile a component include the platforms `config` string to the output name like this

```
nix build .#js-unknown-ghcjs:pkg-name:lib:pkg-name
```
2021-06-17 19:07:37 +12:00
Hamish Mackenzie
90184a79f9
Better error message when building missing ghcjs (#1140)
Currently if you try to build a ghcjs version that does not exist
haskell.nix falls back on the GHC version.  Once ghcjs is in the
ghc tree this will work, but for now we should have an error
message that is more descriptive than attempting and failing to
build ghc for a js target.

New error looks like this:

```
$ nix-build -A pkgs-unstable.pkgsCross.ghcjs.buildPackages.haskell-nix.compiler.ghc861
error: ghcjs 8.6.1 is no longer supported by haskell.nix. Consider using 8.6.5
```
2021-06-17 11:57:21 +12:00
Hamish Mackenzie
f899936d1f
Update internalHackageIndexState (#1139)
The use of `sources.HTTP` to work around issues building GHC 9.0.1 causes a mismatch between `flake` based and non
 `flake` based derivations.

The fixed version of HTTP is now in hackage so updating the internal hackage index state used haskell.nix removes the need for the HTTP source override.
2021-06-16 22:10:42 +12:00
Hamish Mackenzie
0f568cbdf4
Fix haskell-language-server and ghc 8.10.5 (#1138)
Needs:

8fee87eac9

Which cannot be uploaded to hackage yet because of:

https://gitlab.haskell.org/haskell/ghc-api-compat/-/issues/1
2021-06-16 00:37:57 +12:00
Hamish Mackenzie
a5b74bf002
niv update nixpkgs-unstable and add ghc 8.10.5 (#1121) 2021-06-15 19:50:45 +12:00
Moritz Angermann
dd31db0a0a
Add enough logic to make plugins work conceptually. (#1131) 2021-06-07 12:07:56 +12:00
Hamish Mackenzie
532e71470b
Bump internal-* to ghc 8.10.4 (from 8.8.4) (#1129)
Anyone using `hpack` and/or `stack` will have a dependency on `internal-nix-tools` (built with a fixed version of ghc).  This is fine if your `nixpkgs` is one of the ones we cache, but if not we may have to wait for an extra ghc to build.  When this happens it would be nice if it is at least building a more recent version (rather than an older one).
2021-06-02 14:40:24 +12:00
Hamish Mackenzie
986a800713
Try to fix qAddDependentFile for windows (#1116)
Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
2021-05-22 06:54:19 +12:00
Hamish Mackenzie
74d51c1737
Patch th-utilities for windows cross compile (#1114) 2021-05-17 21:12:40 +12:00
Hamish Mackenzie
ae7be4559f
Fixes for windows cross compilation (#1103) 2021-05-03 19:14:19 +12:00
Hamish Mackenzie
5758f1c8b4
Fix windows cross compile issues with C++ code (#1100)
This fixes issues when using packages like `double-conversion` in TH code.
2021-04-30 09:33:21 +12:00
Hamish Mackenzie
04c5b1e566
Update unboxed tuple patch for ghc 8.10 (#1093) 2021-04-18 02:38:07 +12:00