I think this is more correct: other package that depend on the system
odbc package may not need freetds, the problem is that the Haskell odbc
package doesn't declare its dependency on freetds.
* Adding odbc alias to the unixODBC package
* Adding odbc alias to the unixODBC package
* Adding odbc alias to the unixODBC package
* Adding comments about odbc package dependencies
* Add parser combinators to parse SPDX license expressions
The most important parser is `compoundExpression` it parses any SPDX
license expression into a list of SPDX simple-expressions.
The rationale is Nixpkgs' license metadata isn't capable of
distinguishing between the AND and OR relationships.
License exceptions aren't currently taken into account.
* Add tests for the SPDX parser combinators
I simply added a file with expressions that are expected to fail to
parse or parse successfully.
* Add the SPDX license list
The SPDX license list as attrsets following the nixpkgs lib.licenses
convention.
This uses fetchurl which is not ideal because it's not available during
pure evaluation.
It does not yet include the SPDX exceptions list.
* Refactor cabal-licenses.nix to use spdx/licenses.nix
The handling of the generic licenses is undecided still. Some have been
removed because they have better official identifiers.
* Refactor license mapping in builders
The common code in the comp- and setup-builders has been extracted and
refactored to use the SPDX expression parser.
* Use spdx-license-list-data from nixpkgs
This conveniently solves the impurity problem with using fetchurl : )
I'm not sure threading `pkgs` through everything to get access to the
spdx license list package is the right way to go about this.
* hscolour to "LGPL-2.1-only" and remove "LGPL"
* Use evalPackages for spdx and move shim to overlay
* Better fix for LGPL packages.
Co-authored-by: Hamish Mackenzie <Hamish.Mackenzie@iohk.io>
* Adds support for cross package refs (with a project). Relative
directory references between packages within a project should now
work.
* Adds `includeSiblings` to `cleanSourceWith`. When `true` it
prevents the `subDir` arg from causing filtering of other directories.
* Adds `keepGitDir` to `cleanGit` to allow `.git` directory to be kept
(useful for components that use the `githash` package).
After investigating adding a project argument to override the
mapping of libs to packages we realised we could fix the X11
package by updating `modules/configuration-nix.nix`.
We also updated `system-nixpkgs-map.nix` to allow multiple
packages to be mapped for a single library (turned out not
to be necessary for X11).
Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
Co-authored-by: Hamish Mackenzie <Hamish.Mackenzie@iohk.io>
I'm wondering how/if this worked before, i couldn't find most xorg
packages on their previous path.
(Neither on the current version of nixpkgs nor on nixpkgs anno 2018)
* Coverage: allow projects with no libraries
- Prevent projects without a library from breaking the coverage report
generators.
- Added a test to ensure projects without libraries can build coverage
reports.
* Ensure the correct GHC version is used in project coverage reports
- Previously, when trying to determine the version of GHC to use for a
project coverage report, we would attempt to find the version of GHC
used in the constituent coverage reports, or default to the GHC that
is shipped with Nixpkgs. Using the GHC that ships with Nixpkgs is
problematic (specifically the coverage-no-libs tests fail to run on
Hydra), so we now ask the user to pass in the project to the
"projectCoverageReport" function so we can find the correct version of
GHC to use in a foolproof manner.
* Fix stack.yaml filtering when resolver file is in a subdirectory
`maybeCleanedSource` tries to include the resolver file into the cleaned
source, if a resolver is specified, but it was only working when the
file was in the root of the project, because all directories would be
filtered out.
* fixup! Fix stack.yaml filtering when resolver file is in a subdirectory
Fix calculating relPath for paths using subDir
* Add test case for local stack snapshot located in a subdirectory
* Remove unconditional trace for index-state
We already have messages for unusual cases (like using the latest
index-state). This message is unconditional, so quite noisy.
We include the actual index-state in the builer log so it's available if you
want to check it.
* Move source-cleaning warning to builder log
It's not *that* interesting, and someone who cares will likely check the
log.
* Move shellFor trace message to builder log
Not that interesting, really.
Co-authored-by: Hamish Mackenzie <Hamish.Mackenzie@iohk.io>
* Drop 19.09 support
This is a year old. NixOS doesn't even support the last stable release,
let alone the one before that.
Also cuts our CI size by a third, which is always nice.
* Remove 19.09 compatibility pieces
Fixes ghcjs 8.6.5 and 8.8.4.
Uses emscripten for ghcjs 8.8 and adds scripts for building ghcjs 8.8.
Many fixes for ghcjs test failures.
Includes relocatableConfigFiles for making relocatable ghcjs bundles.
* Do not use evalPackages to create sourceRepo for builds
but still use it when creating source repo for plan calculation.
This might be a way to fix#917
* Update unit tests
* Refactor this patch, and add some comments
this is much less convoluted. I moved the fetchgit invocation from
`cabal-project-parser.nix` to `call-cabal-project-to-nix` (which makes
sense in a way, if a parser should return parsed data, and not do
stuff), and then some simplifications could happen.
Also added some comments.
* Update unit tests
* Dead code
* Less repetition in tests
* Comment tweaks
Co-authored-by: Hamish Mackenzie <Hamish.Mackenzie@iohk.io>
- Added the ability to generate coverage reports for packages and
projects.
- Outputs mix and tix information, as well as a HTML report.
- Added the "doCoverage" module option that allows users to choose
packages to enable coverage for.
- Added a "doCoverage" flag to the component builder that outputs HPC
information when coverage is enabled.
- Added the "overrideModules" library function to make it more
ergonomic fo users to enable coverage on existing projects.
- Modified the "check" builder to also output ".tix" files (if they
exist). This information is required to generate the coverage
report.
- Added a test for coverage.
* Changes to allow opencv to be built
The opencv library needs:
1. pkgconfig for opencv should return OpenCV 3, not OpenCV 2 (which is
what pkgs.opencv is)
2. hardeningDisable = [ "bindnow" ] (as per
5ea490af76#)
This commit fixes (1) by adding an entry to lib/pkgconf-nixpkgs-map.nix,
and partially fixes (2) by adding a new `hardeningDisable` option to the
set of package options. The user will still need to specify:
packages.opencv.hardeningDisable = [ "bindnow" ];
I'm not sure if there's a place to specify this as default in haskell.nix.
* Update comp-builder.nix
Currently the `dummy-ghc-data`, `nix-tools` plan and `cabal-install`
plan must be materialized for the selected `ghc`. This change
relaxes that restriction and will instead use `nix-tools` and
`cabal-install` built with a fixed `ghc` version (currently `ghc865`)
and will calculate the `dummy-ghc-data` as an IFD.
It will `__trace` a warning of the form:
```
WARNING: No materialized dummy-ghc-data for ghc-8.6.4-x86_64-darwin.
```
It is now possible to specify multiple subdirs in a
`source-repository-package` block. This change fixes the parser
code in haskell.nix so that it understands.
```
cleanGit {
src = cleanSrcWith { ... }
}
```
Results in the full `src` being copied to the store before filtering
the files not in the git index.
This change uses `src.origSrcSubDir` if it exists to avoid this.
It causes a lot of issues. To make this work:
* `shellFor` is updated to use `getAllComponents` instead of `.all`.
* `getAllComponents` is updated to work on the package rather than
the package config.
* Tests updated to not use `.library` or `.exes.X` where appropriate.
* Documentation updated.
* Out of date examples removed.
As a bonus `shellFor` now takes a `components` argument that might be
useful for limiting the dependencies of the shell to just the ones
needed for the components you intend to work on.
Changes to the interface of haskell.nix (from the changelog.md file):
* Removed `sources.nixpkgs-default`, use `sources.nixpkgs` instead.
* Removed `./nixpkgs` directory, use `(import ./. {}).sources`
or `./nix/sources.nix` instead.
* Removes V1 interface for details on how to fix old code see:
https://github.com/input-output-hk/haskell.nix/issues/709
* Removed defaultCompilerNixName.
* cabalProject, cabalProject', hackage-project and hackage-package
now require a `compiler-nix-name` argument.
* `haskell-nix.tool` and `.tools` now require a `compiler-nix-name` argument.
New functions `p.tool` and `p.tools` (where p is a project) do not.
Like `shellFor { tools = ... }` they will use the compiler nix name
from the project (including stack projects where it is derived from
the resolver).
* `haskell-nix.alex` and `haskell-nix.happy` have been removed. Use
`p.tool "alex" "3.2.5"` or `shellFor { tools = { alex = "3.2.5"; } }`.
* `haskell-nix.nix-tools` -> `haskell-nix.nix-tools.ghc883` (it includes
the hpack exe now).
* `haskell-nix.cabal-install` ->
`p.tool "cabal" "3.2.0.0"` or `shellFor { tools = { cabal = "3.2.0.0"; } }`
* `haskell-nix.haskellNixRoots` -> `haskell-nix.roots ghc883` or `p.roots`
Other changes:
Adds hpack executable to the nix-tools derivations.
Adds a `cabal-hpack` test to make sure `hpack` works with
`cabalProject`.
Reduces the number of calls to `cabalProject` (particularly when
checking materialization), by giving internal tools a per-compiler
attribute.
Uses happy 1.19.12 when building newer ghc versions.
Updates cabal-install 3.2.0.0 to use the source from github that
is compatible with ghc 8.10.1.
Updates the docs for callCabalProjectToNix.
Adds a license mapping to fix a common warning.
This change allows a resolverSha256 to be passed to stackProject.
When provided the resolver found in the stack.yaml is fetched
using this sha256 and the uri string is replaced with the
path to the fetched version.
This is a simple way to specify the sha256 values for references
to git repositories that do not have a `--sha256:` comment in the
`cabal.project` file or a `# nix-sha256:` comment in the `stack.yaml`
file.
The tests demonstrate how to use `sha256map` with both
`cabalProject` and `stackProject` to build the
haskell-language-server from github with the sha256 hashes
needed to work with `--option restrict-eval true`.
Fixes#672 by using the first index-state that is > than desired
index state. It also passes `--index-state` to `cabal v2-cconfigre`
to make sure it cabal uses only the packages in the hackage
file that are before the specified date.
Fixes#540 by returning the `index-state` used back out of
`cabalProject` in the same way `plan-nix` is returned.