New versions of `srcOnly` pass the `prePatch` hook in and we `cd` into the sub directory for the package in that hook. This means that the output includes only the package subdirectory.
We worked around this, but the work around breaks for older nixpkgs where `prePatch` is not passed.
This change replaces the use of `srcOnly` and instead uses the same trick as source so that the `buildPhase` is replaced and runs in the expected source directory (including and it should still include any sibling directories that have not been filtered).
This adds a way to specify the `evalSystem` or `evalPackages` explicitly when calling the `project` functions.
Currently if we want to make a `flake` that supports multiple systems we have few options:
* Require builders for all the supported systems (even just for `nix flake show`).
* Pass `--impure` so that haskell.nix can see `builtins.currentSystem` to set up `pkgs.evalPackages` to use that. Unfortunately this prevents nix from caching some of the work it does and often results in it recalculating for each supported system when it would otherwise be cached and take no time at all.
* Add an overlay to replace `evalPackages`. This works, but it is not straight forward.
* Materialize the nix files for the project.
This change allows `evalSystem = "x86_64-linux";` to be passed telling `haskell.nix` to run `cabal` and `nix-tools` on that system. The user will have to have a builder for that system, but does not need to have builders for the others (unless building outputs for them).
* Provide an empty coverage report when package has no coverage
- When covering a project with multiple packages, the project coverage report
will produce a table of individual coverage reports for each package. The
links in this table don't go anywhere when a package is uncovered (they are
broken links).
- By producing an empty coverage report when a package has no coverage, we fix
the broken links, and provide a tad more information about the coverage
state of that package.
* Improve project coverage report index page
- Provide a link to the union/all coverage report.
- Format the reports as a list instead of a table of one column.
- Provide better explanation of what each report means.
* Add warning explaining modules with no coverage
- Modules that have no coverage at all are simply not included in the HTML
reports generated by HPC.
- Add a warning to the project coverage report index page so users are aware of
this limitation of HPC.
* Simplify interface of coverageReport
- Remove the concept of "package boundaries" from the "coverageReport" function.
- The "coverageReport" is now a function of:
- arbitrary checks generating tix files
- arbitrary mix modules
- This more closely reflects the usage of hpc, which doesn't care about package
boundaries.
- Use this new "coverageReport" function to simplify the "projectCoverageReport"
implementation. A project coverage report now simply:
- copies out constituent coverage reports.
- writes out an "all coverage report" using all checks in the project and all
mix modules..
- writes out a summary index page.
since it needs custom shell setup and knowledge not wanted/necessary for
many project. cabalWrapper can still be used from iohk-nix, until
underlying issue is handled natively by cabal.
Also remove packagesExes materialization attributes,
not really useful anymore, given faster evaluation of recent haskell.nix
- This allows nix run to work correctly, so that it knows the correct
name of the executable, as it would otherwise attempt to execute an
executable named "project-name-exe-exeName", for example.
- See #1231.