Comments (8)
@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.
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:
- The change to
get-cabal-configuration.hs
works, but might need to provide more info (ie package-db stuff). - 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 somethingget-cabal-configuration.hs
should do. - None of this info is in Cabal-the-library yet, would be nice to get info from the source clearly.
from flycheck-haskell.
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.
Agreed on all points. I'm happy to maintain a fork or something as this develops.
from flycheck-haskell.
Nothing new here?
from flycheck-haskell.
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.
cabal new-build
will soon become build
reference: https://github.com/haskell/cabal/projects/6
from flycheck-haskell.
from flycheck-haskell.
Related Issues (20)
- flycheck-disable-checked not disabling haskell-stack-ghci HOT 6
- `flycheck-haskell-setup` signals error on Windows HOT 4
- Support for Haskell scripts made with Stack HOT 1
- Using flycheck in a docker-based stack project? HOT 1
- Bug in get-cabal-configuration.hs HOT 2
- call to stack / get-cabal-configuration delays editing file HOT 2
- IO mzero error when reading cabal configuration HOT 2
- cabal new-style builds HOT 1
- running hlint when installed using --copy-compiler-bins HOT 2
- Module ‘Distribution.PackageDescription.Parsec’ does not export ‘readGenericPackageDescription’
- Very bad performance HOT 4
- no errors HOT 7
- Paths_* modules cannot be found HOT 11
- Support hpack files directly HOT 3
- Flycheck with nix: Could not find module HOT 4
- Flycheck-haskell hangs indefinitely on NixOS HOT 6
- weird output from haskell-hlint checker HOT 2
- Support for cabal.project? HOT 1
- flycheck-haskell is very slow when stack.yaml is not pressent HOT 10
- Reference to Distribution.Parsec.Common needs to be updated for Cabal-3.0.0.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flycheck-haskell.