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

have stack ghci work more like cabal repl in terms of sandboxing .hi and .o files #529

Closed
wolftune opened this issue Jul 6, 2015 · 10 comments

Comments

@wolftune
Copy link
Contributor

wolftune commented Jul 6, 2015

After running stack ghci, all my .hs files have corresponding .hi and .o files. I don't like having those pollute my project directory, so I'm hoping there could be a way to run this where those are stored in some separate hidden or sandboxed place…

@pharpend
Copy link
Contributor

pharpend commented Jul 6, 2015

FWIW, I can reproduce this:

Edit well, I could reproduce it in my existing snowdrift tree, but not on a fresh one.

git clone git://github.com/snowdriftcoop/snowdrift.git
cd snowdrift
stack setup
stack build

Due to a GHC bug, this will probably fail a few times. Just keep running stack build until it succeeds.

Finally

stack test
stack ghci

I'm getting a segfault on stack test, which... I don't think I've ever seen Haskell code segfault before.

If you ever do get to 'stack ghci', there will be .hi and .o files littered throughout the source tree.

@DanBurton
Copy link
Contributor

+1

On Monday, July 6, 2015, Peter Harpending [email protected] wrote:

FWIW, I can reproduce this


Reply to this email directly or view it on GitHub
#529 (comment)
.

-- Dan Burton

@snoyberg snoyberg modified the milestone: GHCi Jul 13, 2015
@chrisdone chrisdone self-assigned this Aug 6, 2015
@chrisdone
Copy link
Member

This is easy enough, will do.

@chrisdone
Copy link
Member

Implemented in 712c965. @wolftune Confirm?

@chrisdone chrisdone removed their assignment Aug 9, 2015
@wolftune
Copy link
Contributor Author

@chrisdone how do I install this to test? Do I need to run stack upgrade --git ? I'm a little confused about the strange docs around upgrading with vague references to "this" in the upgrade stuff and then link to an issue comment…

@chrisdone
Copy link
Member

stack upgrade --git works. I tend to just have the git repo open and do stack install.

@wolftune
Copy link
Contributor Author

@chrisdone it appears that I didn't have stuff polluted with .o files but I still got .hi files.

I also had a separate problem that appears to be related to failing to import Prelude or something where I had a failure at one point even though I did end up at the prompt anyway…

@chrisdone
Copy link
Member

Oh, I always thought -odir handled interface files too. Turns out there's a -hidir flag, which I've added now in fbcdf56.

@wolftune
Copy link
Contributor Author

Yay, it's all working!

@snoyberg snoyberg removed the ready label Aug 10, 2015
@lukexi
Copy link
Contributor

lukexi commented Aug 11, 2015

Just FYI, there's also -outputdir which I believe redirects all output files in one go (off the top of my head there's also e.g. dyn_o files in dynamic mode, and stub files for foreign exports, so it might be an easier way to go)

@borsboom borsboom modified the milestone: GHCi Sep 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants