GithubHelp home page GithubHelp logo

Comments (10)

mohanzhang avatar mohanzhang commented on June 2, 2024 2

@drwebb Ok, so if I understand you correctly, you are saying that there is a fundamental reason why dash-haskell can't work with stack, and that this reason is because cabal doesn't like the way stack selects its pkgdb? I took this interpretation and ended up using https://github.com/philopon/haddocset instead.

For anyone reading this, don't let your Dash dreams be... dashed! :) haddocset works great, but operates on a slightly different model. The idea is that you create a basic docset generated from your global pkgdb. If you are using stack, this should be a very small set of docs (for me it was 25 packages). You also have to build your application with haddocks in order for the packages to have documentation. The end result is something like:

# in your app's directory, e.g. your yesod app
mkdir dash
stack exec -- haddocset -t dash/output create
# ... looks a lot like the README for haddocset, so far so good
stack build --haddock
# ... takes a while to build all the docs, then
stack exec -- haddocset -t dash/output add /Users/mohanzhang/.stack/snapshots/x86_64-osx/lts-3.2/7.10.2/pkgdb/*.conf
# figure out your pkgdb path with `stack path`
# ... takes a while, and you can get errors for missing docs, but that's ok,
# because not everything inside your stack pkgdb has docs (only those that
# you built with stack haddock at some point or other)

You can then add the docset in Dash preferences. You may also want to edit dash/output.docset/Contents/Info.plist so that it has a nicer bundle name, like "My App's Docs" or something.

/cc @philopon Did I get this right? I seem to have a pretty nice docset in my Dash right now as a result, but haven't had time to check it fully. Thanks to you and @jfeltz for making these solutions. Way way better than googling for docs on hackage.

from dash-haskell.

jfeltz avatar jfeltz commented on June 2, 2024

It shouldn't require a sandbox to function. This is a huge bug. Thanks for reporting.

from dash-haskell.

jfeltz avatar jfeltz commented on June 2, 2024

Let me know if the latest commit works for you.

from dash-haskell.

bts avatar bts commented on June 2, 2024

Thanks John!

I'm using the 2015-07-19 stackage nightly, so I think I am using the latest commit when I now get the following error:

% stack exec -- dash-haskell -c foo.cabal --db /Users/bts/.stack/snapshots/x86_64-osx/nightly-2015-07-19/7.10.1/pkgdb
using package db stack:
 > ghc distribution (global db)
 > system user
 > db directory: /Users/bts/.stack/snapshots/x86_64-osx/nightly-2015-07-19/7.10.1/pkgdb

dash-haskell: user error (Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. Use the flag --package-db to specify a package database (it can be used multiple times).)

FWIW I don't have the environment variable GHC_PACKAGE_PATH set.

I've tried playing around with the --ordering flag to get it to only use the supplied package DB (without a global or user DB), but I'm not having much luck.

Thanks again!
Brian

from dash-haskell.

bts avatar bts commented on June 2, 2024

Ah it seems like stack exec is probably setting GHC_PACKAGE_PATH?

from dash-haskell.

jfeltz avatar jfeltz commented on June 2, 2024

Possibly. Right now dash-haskell uses cabal as its back-end for looking up databases, and I'm now considering putting in a fallback to a custom indexer similar to that used in 1.0.0.5. Try also dash-haskell-1.0.0.5 where this is the case (it doesn't use cabal).

from dash-haskell.

mohanzhang avatar mohanzhang commented on June 2, 2024

@bts Were you ever able to get it working?

from dash-haskell.

drwebb avatar drwebb commented on June 2, 2024

@mohazhang The current behavior is unchanged, if dash-haskell is still using cabal as a backend GHC_PACKAGE_PATH cannot be set, which is how stack selects its pkgdb for a build.

from dash-haskell.

olivierverdier avatar olivierverdier commented on June 2, 2024

@mohanzhang amazing 😲 This should really be part of the readme of haddocset.

EDIT: (well, nevermind, it is already part of the readme of haddocset...)

from dash-haskell.

adamczykm avatar adamczykm commented on June 2, 2024

Each time I'm calling stack exec wtih haddock I get a following error:
haddock: internal error: /usr/lib/ghc-8.2.2/package.conf.d/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)
Do you know how can I resolve it? Thanks!

from dash-haskell.

Related Issues (14)

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.