-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Cross-compilation broken by custom Setup.hs used for doctests #82
Comments
Hmm, yeah, I would like to get away from using a custom setup if it's at all possible. There are a lot of issues around them, and this isn't the kind of library that justifies it. The I'm sure there was talk at some point of a proper |
Running @vmchale How are you getting this to work? |
I put them in my
(perhaps you've run into another cabal bug 😬 ) |
It doesn't seem to make a difference how I specify the flag (file vs. command line), which to be honest is a good thing... I'm not very familiar with FWIW, I'm using |
My workflow is
For whatever reason (I think |
Aha, you're right! I'd missed that subtlety. |
The problem with
I don't want to move away from However, as you've seen, the custom If you wanted to make this process a little easier, please feel free to send a PR putting the doctests under a flag that you can easily disable. |
Worth keeping an eye on: https://mail.haskell.org/pipermail/haskell-cafe/2020-August/132570.html |
BTW, lens did a similar update recently. (An older version of |
Thanks @dpwiz, that link is very handy. Looking at the cabal-docspec manual, I think that could be the perfect solution. |
Having just tried this, simply changing the one line to |
There's a long thread on the Cabal issue tracker about doctests: haskell/cabal#4500 Recently sol commented about using I'd be interested to see a comparison between |
Looks like there is one more doctest contender in the mix, doctest-parallel:
One feature of It would be great add a comparison to |
…rpreter`) As it stands, we also need changes to `entropy`, but I'll manage that separately. Hopefully by reviving haskell#78. Note that the custom setup is only used for `cabal-doctest`, so we really can just safely remove it. This is essentially the same issue as cdepillabout/pretty-simple#82. Seeing as all the TH is just for `makeLenses`, in an ideal world we really ought to just be able to run on the host: see ghc-proposals/ghc-proposals#243. The changes to the two `.hs` files are from dumping the TH splices (and manually (well, with _some_ help from HLS) adding a load of qualified imports). The splices can be found in `dist-newstyle` after adding this to `cabal.project`: ``` package wreq ghc-options: -ddump-splices -dth-dec-file ```
…rpreter`) As it stands, we also need changes to `entropy`, but I'll manage that separately. Hopefully by reviving haskell/entropy#20. Note that the custom setup is only used for `cabal-doctest`, so we really can just safely remove it. This is essentially the same issue as cdepillabout/pretty-simple#82. Seeing as all the TH is just for `makeLenses`, in an ideal world we really ought to just be able to run on the host: see ghc-proposals/ghc-proposals#243. The changes to the two `.hs` files are from dumping the TH splices (and manually (well, with _some_ help from HLS) adding a load of qualified imports). The splices can be found in `dist-newstyle` after adding this to `cabal.project`: ``` package wreq ghc-options: -ddump-splices -dth-dec-file ```
There has apparently recently been a PR to cabal that adds a new doctest-related feature:
I haven't looked at this thoroughly, but this might be the best option so far, since it will officially be supported by edit: This has been released in Cabal-3.8.1.0: https://discourse.haskell.org/t/just-released-cabal-3-8-1-0/4920 |
In #129 (comment), @andreabedini gave a link to haskell/cabal#9551, which may provide a better way to run doctests. |
Although it might be years before we're willing to drop support for all Cabal versions which don't support it! |
@cdepillabout |
I'd love to see it removed, especially with the new JS/WASM backends being about to make cross-compilation a lot more common. I believe @cdepillabout is keen in principle, modulo the concerns in #82 (comment). To be clear, are you talking about this new experimental approach? I've found it difficult to keep up with progress on doctest support, especially as someone whose interest is limited entirely to being a co-maintainer of this particular library. |
Yes I am talking about it. It's labelled as experimental because it is fresh, but I have not found bugs when using it. |
@Kleidukos I wrote a little more about what I'd like in #129 (comment). Is there some easy way to have the doctests run when you run On the other other hand, I realize that |
@cdepillabout I understand what you mean. If you can't move right away from the Custom setup, could you then perhaps bump the version bound of the Cabal library used in pretty-simple, so that users may use the package alongside |
I'm not quite sure what you mean by this. |
Okay then it's my fault, it must be the cabal bound determined by my GHC version. :) |
Currently, the custom Setup.hs used for doctests causes cross-compilation to fail due to a loingstanding cabal bug.
I set
write-ghc-environment-files
toalways
in mycabal.project
and then just rundoctest
from the command-line as a workaround.The text was updated successfully, but these errors were encountered: