Giter Site home page Giter Site logo

Comments (8)

swsnr avatar swsnr commented on June 17, 2024

@slpopejoy I'm normally using stack and am not following Haskell development closely, so I'd appreciate a bit of background information. I've got no idea what "Cabal new-build" is, how it's different, and why and how that affects flycheck-haskell, and I'm not sure what you're referring to with "we would want to discover the package-db invocations.".

/cc @flycheck/haskell

from flycheck-haskell.

sirlensalot avatar sirlensalot commented on June 17, 2024

Cabal new-build is great new work on cabal that eliminates the need for sandboxes in most cases, effortlessly handles different GHC versions, etc. There's a ton of work under the hood going on. See http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ for an intro.

My backstory: I recently upgraded some libraries on hackage, and the docs failed to build b/c hackage uses GHC 8x for doc build. I asked on #haskell-infrastructure what was the best way forward -- I was dreading having two cabal sandboxes for 8x and 7.10.x -- and they pointed me at new-build. I'm happy to say the hype is real :) and it all works beautifully, I had my libs compiling with both GHCs very quickly.

Anyway, all was well except for emacs :) . I haven't found any indication of work being done on this in haskell-mode or flycheck, maybe I've missed something. I was able to get things working in both, however, so I thought I'd open issues to document what I've done and start a discussion how to best support these. Sorry for the mess!

Apparently, soon new-build will be the preferred way to use cabal (I'm certainly not going back, also see haskell/cabal#3852) so one discussion item is whether emacs tools can simply cut over, or at what point etc. Clearly, not having to support both would make things considerably simpler.

Specifics thus far:

  1. The change to get-cabal-configuration.hs works, but might need to provide more info (ie package-db stuff).
  2. As indicated above, I had to get the checker to add three -package-db entries to the command line, which I did via customization for now. This might be something get-cabal-configuration.hs should do.
  3. None of this info is in Cabal-the-library yet, would be nice to get info from the source clearly.

from flycheck-haskell.

swsnr avatar swsnr commented on June 17, 2024

That sounds very promising, for sure, and I'm all for burning bridges and move to the new style Cabal support without any concerns for backwards compatibility, but I'm not yet sure whether I see a clear path forward.

For one, it seems that "new build" itself still seems to be a bit unstable—why wouldn't it be the default otherwise. And then I'd love to see the new-build behaviour being exposed through Cabal-the-library, for directly accessing the .store package DB in ~/.cabal feels, well, hacky. Ideally we'd have any API that allows to get a list of all package databases required for compilation.

That didn't exist for sandboxes, which was not too nice, but sandboxes are somewhat simple, whereas new-build seems to be more involved, which would open up for subtle differences between the ways flycheck checks and cabal builds unless we're really sure to check the same, i.e. because we get all the information through the API.

from flycheck-haskell.

sirlensalot avatar sirlensalot commented on June 17, 2024

Agreed on all points. I'm happy to maintain a fork or something as this develops.

from flycheck-haskell.

mrkkrp avatar mrkkrp commented on June 17, 2024

Nothing new here?

from flycheck-haskell.

sergv avatar sergv commented on June 17, 2024

As before, it seems very desirable to have some kind of API exposed by Cabal package that would return all packge dbs necessary for compiling current project. Are aware of such thing being exposed?

from flycheck-haskell.

Rizary avatar Rizary commented on June 17, 2024

cabal new-build will soon become build

reference: https://github.com/haskell/cabal/projects/6

from flycheck-haskell.

sergv avatar sergv commented on June 17, 2024

from flycheck-haskell.

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.