Code Monkey home page Code Monkey logo

Comments (11)

phadej avatar phadej commented on July 30, 2024

Do you have a (public) package where this is a problem.

Is it correct that GHC invokes hsc2hs for hsc files, or is it cabal which knows how to preprocess them. What's about .chs and .c2hs?

If cabal does the preprocessing, than I hope this isn't hard (but not easy either) to fix in cabal-doctest.

from cabal-doctest.

RyanGlScott avatar RyanGlScott commented on July 30, 2024

I originally encountered this in quine, which had a Setup.hs shim for doctests and a .hsc file at the same time. It turned out that quine doesn't even use doctests at all internally, so I eventually decided to just remove the custom Setup.hs script, but if quine had been using doctests, we'd have been in trouble.

GHC has no knowledge of hsc2hs or c2hs whatsoever—it's Cabal that invokes those preprocessors on .hsc or .chs files before compiling them.

from cabal-doctest.

phadej avatar phadej commented on July 30, 2024

Ok, then maybe Cabal already does preprocessing, and I just have to find where the results are. I'll check next week. Today I'll try to not to do anything, especially fool myself :)

from cabal-doctest.

peti avatar peti commented on July 30, 2024

I have run into the same issue. I wanted to use this library precisely because I was having trouble doctesting my hsc2hs-base code. It would be really great if you could add support for that use case.

from cabal-doctest.

phadej avatar phadej commented on July 30, 2024

@peti do you have a public repository, where I could test that cabal-doctest actually works with real world package?

from cabal-doctest.

phadej avatar phadej commented on July 30, 2024

@peti, are you using stack, could you test a branch in #14 if it works for you?

from cabal-doctest.

peti avatar peti commented on July 30, 2024

@phadej, I created https://github.com/peti/hsyslog/tree/t/cabal-doctest-support in my hsyslog project to hsc2hs support. I run the build with cabal-install. I usually don't use stack.

from cabal-doctest.

peti avatar peti commented on July 30, 2024

I tried #14 with cabal-install and it works fine!

from cabal-doctest.

phadej avatar phadej commented on July 30, 2024

@peti Great, I'll cut new release shortly.

from cabal-doctest.

phadej avatar phadej commented on July 30, 2024

https://hackage.haskell.org/package/cabal-doctest-1.0.2 on Hackage.

from cabal-doctest.

peti avatar peti commented on July 30, 2024

Thank you very much for you efforts!

from cabal-doctest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.