-
Notifications
You must be signed in to change notification settings - Fork 842
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
Avoid building the target packages with "stack ghci" #1364
Comments
Another reason this would be very useful (IIUC) is an issue I just ran into. If you have two packages, A and B, and A depends on B, then running Let me know if this is not related, and I'll file a new issue. |
Hmm, that is surprising. Is this with stack >= 0.1.8? Currently it should carry on running ghci despite build failures. |
That was with stack 0.1.6. I'll try with 0.1.8 and HEAD tomorrow. |
I just tried. 0.1.8 and HEAD give the same result: they build package B, fail, say |
Oh, sorry, I just figured out there was another dependency in between. When testing it with the right setup, it works correctly with HEAD and 0.1.8. Disregard my comments, sorry for the noise. |
No worries! I'm planning to implement #584 soon, btw :D It really does seem to be crucial for having a nice ghci workflow when you have lots of packages. |
Oh that's great news, I'll forward to it! |
Didn't mean to close this, reopening. |
True for single package project, but what about multi-package scenario in which a local package could be a dep of another local package? :P
Rather, since point 2 hasn't been addressed yet, I'm not sure if this is territory where the solution for #1265 may have an effect here |
Oh wow, I hadn't thought about that. Mocking the package might just work, but I'd say it's best to focus on getting it working for a single package. Then, we can do an "only-dependencies" build that includes local packages required by targets.
Yes, something like that. I don't think
I don't think it'll have much impact on this. |
Use a shim to invoke initialBuildSteps for ghci #1364
This is now implemented! |
@mgsloan Should Cabal library take up this fix? UPDATE: Actually, we run initialBuildSteps before repl; I misunderstood what this patch does, which is make it possible to call Setup to just do preprocessing |
@ezyang Shouldn't be necessary. It would be nice to have a way to ask |
In order to make
stack ghci
reliable / consistent, thecabal_macros.h
andPaths_*
files need to be generated. Currently, this means that we do a full build of the targets (unless--no-build
is passed).Really all that needs to happen is to run
initialBuildSteps
before running ghci. Running this function requiresLocalBuildInfo
, which gets stored indist/setup-config
. Unfortunately, we can't call it directly from stack - it uses Binary / Generic, so we can't rely on it being compatible between cabal versions (and stack may be linked with a different version).I think a reasonable solution to this is to have a separate program which runs
initialBuildSteps
on the specified packages. This separate program could either be a script that getsrunhaskell
-ed, or something that gets build and installed to the snapshot (like the default Setup.hs).This solution also has relevance to other issues:
localPkgDescr
as a .cabal file (I really hope this is possible). Then, we'd would parse the resulting cabal file, and use that description to generate the arguments passed to ghci.The text was updated successfully, but these errors were encountered: