Adds a fix for this error when regenerating files with `stack-to-nix`:
```
stack-to-nix: .stack-to-nix.cache: openFile: resource busy (file is locked)
```
The idea is to keep 8.10.4 in CI while 8.10.5 is still neither in
- a (non-nightly) Stackage LTS resolver
- upstream Nixpkgs-unstable
Hopefully it isn't long before 8.10.5 is more standard and we can remove
8.10.4 from the IOHK build.
This commit also updates documentation (which seems to have fallen out
of date), with some changes and additions to hopefully make things
easier on first-time readers.
* 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 updates to the latest `nix-tools` to get the following fixes (there are 3 PRs in nix-tools, but just the one in haskell.nix to avoid having to update the materialized files multiple times):
## Better support for source repository packages
* https://github.com/input-output-hk/nix-tools/pull/107
Currently these are replaced by the `cabalProject` functions with regular `packages:` before running cabal configure. Cabal does not treat these the same (the setting of `tests:` and `benchmarks:` in the `cabal.project` file):
* The plan found by `cabalProject` may not match the one used when running `cabal`.
* The performance of the solver may not be consistent with running `cabal`.
This change replaces `source-repository-package` with another `source-repository-package` pointing at a minimal git repo.
## Only include planned components
* https://github.com/input-output-hk/nix-tools/pull/108
Only the components in the `plan.json` are now included in the haskell.nix cabal projects. This avoids missing dependencies attempting to build components that were not in the plan. Should fix#993.
## Pick latest packages
* https://github.com/input-output-hk/nix-tools/pull/109
When the same package occurs more than once in a `plan.json` file (perhaps because it is needed both by the project itself and by one of the `setup` dependencies or `build-tool-dependencies` of the project) the latest version will now be the one picked by haskell.nix. This is a work around for a common issue with `cabal-doctest` when cross compiling to windows (an old version of Win32 is used even if a newer one was required by the projects `constraints`).
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).
Had a strange issue where eval of #955 and it might have been caused
by a the nix-tools library seeming to have no `.conf` files.
Since it seemed to go away by itself I think this was a nix GC issue
or something. Here is some code we could add to the builders to
double check the files are created if it turns out that is not the
case.
Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
* factor out isSelectedComponent
* Optimise `flatLibDepends`
We no longer force the `outPath` attribute to avoid instantiating the
derivation, which is expensive