-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run docspec in CI #53
Conversation
.github/workflows/ci.yml
Outdated
- name: Fetch cabal-docspec | ||
run: | | ||
wget https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz && | ||
unxz cabal-docspec-0.0.0.20210111.xz && mv cabal-docspec-0.0.0.20210111 cabal-docspec | ||
chmod +x cabal-docspec | ||
- name: Run cabal-docspec | ||
run: ./cabal-docspec --check-properties --timeout=30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this basically how people are recommended to run cabal-docspec
locally as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much, since it's not on Hackage (cf #52 (comment)).
9cc77be
to
63be475
Compare
, template-haskell | ||
default-language: | ||
Haskell2010 | ||
x-docspec-extra-packages: QuickCheck quickcheck-instances password password-types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how cabal-docspec
is able to find these libraries? Does it call Cabal under the hood to install the necessary libraries listed here?
Also, does cabal-docspec
work when building with stack
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how cabal-docspec is able to find these libraries? Does it call Cabal under the hood to install the necessary libraries listed here?
The package must exist in the plan.json
. It is explained here
Also, does cabal-docspec work when building with stack?
cabal-docspec
is looking for a cabal-install
plan.json, I don't think stack
provides such a thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not being able to run doctests with stack or Nix seems pretty unfortunate. I'm not sure if I want to give that up.
I'll have to take a good look at the documentation you've linked to and think about how I feel about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cdepillabout On my personal CI I use cabal-docspec
the same way I use hlint
, and I don't expect the results to diverge if Nix or stack is used. If you want I can create a third set of steps that is independent of cabal / stack.
Regarding Nix it's of course a bit more tricky since you need to patch the ELF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchoutri Ah, sorry, maybe I don't quite understand because I haven't yet read the cabal-docspec
manual.
I was assuming that since cabal-docspec
reads the plan.json
, and stack
doesn't output a plan.json
, that people using stack
for development can't easily run cabal-docspec
. (Same thing with Nix, or, for example, building password
in Nixpkgs.)
I don't want to give up easy support for running doctests in stack
and Nix. Although, like you say on the issue, if cabal-doctest
is no longer being maintained, then maybe I have no choice here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cdepillabout Okay I was wrong, you indeed need to build with cabal-install
(which is the thing that provides plan.json
, not necessarily the Cabal
library).
I don't want to give up easy support for running doctests in stack and Nix. Although, like you say on the issue, if cabal-doctest is no longer being maintained, then maybe I have no choice here...
Unfortunately as you say, this easy support might disappear one day. :/
The best path forward from here is to team up with the Cabal team so that the library provides enough features that stack
and cabal-install
can implement lightweight runners on top of it and reach feature parity. I don't know much about how cabal2nix
would do it though.
63be475
to
d895393
Compare
There was a recent release of |
This PR removes the dependency on
cabal-doctest
in favour ofcabal-docspec
.Fix #52