* 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>
This reverts commit 9ccc486b9ff51e7f69c6420ded742a597be041fb.
Unfortunately our hydra is built against an old version of nix
which does not support this attribute.
* 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
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
* 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>
* Remove flake specific sourceOverride that mess-up caching.
* Reduce evalPackages discrepency between flake/non-flake.
* Remove dependency on <nixpkgs> when importing sources.nix
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).
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.
* 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>
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.
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
```
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
```
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.
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).