Skip to content
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

Allow "--ghc-options -hpcdir" to be selectively disabled via CLI #997

Closed
adinapoli opened this issue Sep 16, 2015 · 4 comments
Closed

Allow "--ghc-options -hpcdir" to be selectively disabled via CLI #997

adinapoli opened this issue Sep 16, 2015 · 4 comments
Milestone

Comments

@adinapoli
Copy link
Contributor

Hello folks,

first of all I'm not expecting this to be considered a stack issue, as I'm not sure it is. I'm writing this down as this project is highly maintained and having this kind of reports might help others in the future. I have ported a snap project I have at work to use stack. So far so good, pretty much smooth sailing. If you are not familiar with snap it supports automatic recompilation leveraging hint. I have therefore enabled the "dev" mode calling:

stack install --flag chronos:development

Which built just fine. Upon startup though, I realised that hint was trying to look for packages in my global package index and, unable to find my deps, was failing. This is similar to an issue someone reported here:

http://hub.darcs.net/jcpetruzza/hint/issue/5

Dutifully, I tried something like this:

GHC_PACKAGE_PATH=$(stack path --local-pkg-db) chronos

Which generated:

o port specified, defaulting to port 8000
Listening on http://0.0.0.0:8000/
chronos: Unknown interpreter error:

flags: '-hpcdir .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/hpc/.hpc/' not recognized

And this is because - I suspect - stack is passing such flag dowstream and Hint's interpreter code is choking on it. Is Hint right here?

The project seems quite abandoned (but I might be totally wrong!) and unless someone knows better than me Snap's plan for 1.0 release, they seems to still leverage hint for automatic recompilation. This means this problem will hinder Stack's adoption for people using Snap.

Of course if I have missed something completely trivial and/or Snap is ditching hint in 1.0 I guess this issue is moot, but I thought would have been useful to share anyway!

Alfredo

@snoyberg
Copy link
Contributor

I wouldn't see a problem with modifying stack such that it only sets that flag when actually doing coverage builds, but I could be mistaken (@mgsloan, could you weigh in?).

@adinapoli would you be up for sending a PR to make that change?

@snoyberg snoyberg added this to the P2: Should milestone Sep 16, 2015
@adinapoli
Copy link
Contributor Author

@snoyberg Happy to do that, if @mgsloan says 👍

@snoyberg
Copy link
Contributor

As a side note, it may be interesting to see if Snap applications work with https://github.com/urbanslug/wai-devel

@mgsloan
Copy link
Contributor

mgsloan commented Sep 17, 2015

Sounds good to me! You'll probably want to pass in BuildOpts to extraBuildOptions. Then, toCoverage (boptsTestOpts bopts) tells you if coverage is enabled.

mgsloan added a commit that referenced this issue Sep 17, 2015
Fix #997 (pass --ghc-options -hpcdir) only on --coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants