Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Add a check for shelltest flag #912

Merged
merged 1 commit into from
Oct 16, 2017
Merged

Conversation

basile-henry
Copy link
Contributor

Without this additional flag check the shelltest build tool is always a dependency.
This was an issue for me when using nix to build ghc-mod via the cabal2nix utility as it then depends on shelltest regardless of the value of the flag.

Without this additional flag check the `shelltest` build tool is always a dependency.
This was an issue for me when using `nix` to build `ghc-mod` via the `cabal2nix` utility as it then depends on `shelltest` regardless of the value of the flag.
@DanielG
Copy link
Owner

DanielG commented Oct 11, 2017

LGTM. Just curious -- why is it a problem if it depends on shelltest?

@basile-henry
Copy link
Contributor Author

I think the main issue with nix and the build-tools field is that nix has no idea how to build shelltest as a dependency. My understanding is that it is an executable provided by the shelltestrunner package. Maybe nix would work as expected if the build-tools field was set to shelltestrunner instead of shelltest. I have not tried this.

I am not really familiar with the build-tools field in cabal and I am fairly new to the nix ecosystem. Since you already had a flag choosing whether the shelltest target was buildable or not I thought it made sense to disable shelltest as dependency as well.

I have just had a quick look at what is expected from the build-tools field. From issue haskell/cabal#3708 I think a better way to add the dependency might be:

tool-depends: shelltestrunner:shelltest

Just tested this new field quickly, I don't think cabal2nix supports it. 😞

@DanielG DanielG merged commit 06515c4 into DanielG:master Oct 16, 2017
@DanielG
Copy link
Owner

DanielG commented Oct 16, 2017

build-tool-depends was only added in Cabal-2 so that would be too recent anyways.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants