-
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
Set cabal_macros.h work directory in stack ghci to something non-temporary #4038
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To reflect upcoming change, that some of these functions won't neccessarily be writing to a temporary directory. Now, they write to whatever output directory they are told to.
For writing files pertaining to `stack ghci`
Example: bash-3.2$ stack exec -- stack ghci -v 2>/dev/stdout | egrep '\-optP.*?cabal_macros.*? ' -o -optP-include -optP/Users/chris/Work/stack/.stack-work/ghci/cb285e1e/cabal_macros.h bash-3.2$ stack exec -- stack ghci -v 2>/dev/stdout | egrep '\-optP.*?cabal_macros.*? ' -o -optP-include -optP/Users/chris/Work/stack/.stack-work/ghci/cb285e1e/cabal_macros.h Here are two runs of `stack ghci` on the stack codebase. The first compiles everything, the second loads the cached object files: https://gist.github.com/chrisdone/7468e27683a5f202b6a5f4e146b2fb8e#file-ghci-output-txt-L146-L164
chrisdone
changed the title
Cabal macros work dir
Set cabal_macros.h work directory in stack ghci to something non-temporary
May 24, 2018
chrisdone
added a commit
to chrisdone-archive/intero
that referenced
this pull request
May 24, 2018
stack already sets the -odir and -hidir to a place in .stack-work which is stable and cacheable. Removing this makes intero much faster at restarting on large projects, because all the object files are cached. That is, once PR #4038 lands: commercialhaskell/stack#4038
This solves a long-standing confusion and problem for me, thank you! |
mgsloan
approved these changes
May 24, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -32,11 +33,18 @@ objectInterfaceDirL = to $ \env -> -- FIXME is this idomatic lens code? | |||
root = view projectRootL env | |||
in root </> workDir </> $(mkRelDir "odir/") | |||
|
|||
-- | GHCi files directory. | |||
ghciDirL :: HasBuildConfig env => Getting r env (Path Abs Dir) | |||
ghciDirL = to $ \env -> -- FIXME is this idomatic lens code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use the
ghciDirL
forcabal_macros.h
instack ghci
command.Example:
Here are two runs of
stack ghci
on the stack codebase. The firstcompiles everything, the second loads the cached object files:
https://gist.github.com/chrisdone/7468e27683a5f202b6a5f4e146b2fb8e#file-ghci-output-txt-L146-L164
Ping @mgsloan @bitemyapp