-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cabal cradle causes me to constantly need to run cabal configure #195
Comments
@ocharles for now, probably not. cabal needs to give us the information necessary to compile a given file. What we need is this pr: haskell/cabal#6241 Shouldnt the project only be re-configured once per component? |
I don't think hie-bios currently passes Are there any specific bits of extra information you had in mind for |
It does: i didnt know that it could trigger a configure though |
@bubba As @jneira wrote, we collect options via |
This was also discussed here: #177 (comment) Looking into this is in my long-term list, but hopefully someone from the project itself will fix the problem in a nice way :) |
Maybe, but this is certainly not happening. In just editing a single file, it seems to repeatedly clobber me running |
@ocharles that is exactly the problem I reported in #177 (comment). The problem is that |
@fendor @jneira I copied
Apparantly, cabal stores compiler path in a binary format in a lot of config files, so when a user calls What |
This trick demonstrates my words (of course it needs diff --git a/hie-bios.cabal b/hie-bios.cabal
index f2640f18..0c7c67a1 100644
--- a/hie-bios.cabal
+++ b/hie-bios.cabal
@@ -162,7 +162,8 @@ Library
hslogger >= 1.2 && < 1.4,
file-embed >= 0.0.11 && < 1,
conduit >= 1.3 && < 2,
- conduit-extra >= 1.3 && < 2
+ conduit-extra >= 1.3 && < 2,
+ pathwalk
Executable hie-bios
diff --git a/src/HIE/Bios/Cradle.hs b/src/HIE/Bios/Cradle.hs
index c248c605..7f99848e 100644
--- a/src/HIE/Bios/Cradle.hs
+++ b/src/HIE/Bios/Cradle.hs
@@ -42,6 +42,7 @@ import System.IO.Temp
import System.IO.Error (isPermissionError)
import Data.List
import Data.Ord (Down(..))
+import System.Directory.PathWalk
import System.PosixCompat.Files
import HIE.Bios.Wrappers
@@ -436,16 +437,29 @@ withCabalWrapperTool (ghcPath, ghcArgs) wdir k = do
hPutStr h cabalWrapper
hClose h
setMode loc
- k loc)
+ pathWalk (wdir </> "dist-newstyle") $ \root _ files ->
+ forM_ files $ \file ->
+ when (file `elem` fnames) $ do
+ print ("backing up ", root </> file)
+ copyFileWithMetadata (root </> file) (root </> file <.> "bak")
+ r <- k loc
+ pathWalk (wdir </> "dist-newstyle") $ \root _ files ->
+ forM_ files $ \file ->
+ when (file `elem` fnames) $ do
+ print ("restoring ", root </> file)
+ copyFileWithMetadata (root </> file <.> "bak") (root </> file)
+ return r)
where
setMode wrapper_fp = setFileMode wrapper_fp accessModes
+ fnames = ["config", "compiler-config", "improved-plan", "elaborated-plan", "setup-config", "solver-plan", "build"] With this patch running |
That could be acomplished making the ide build use another dist directory. |
Now config allows you to set an alternative |
I'm using ghcide 0.2 with Cabal cradles. I now seem to constantly having to do a Cabal configure everytime I do
cabal build
, because opening new files in causes ghcide to run Cabal configure through hie-bios. The configuration phase takes a substantial amount of time to run (we're talking minutes), so I now seem to spend most of my time watching Cabal configure itself. I imagine this is because hie-bios uses--with-compiler
which requires a full recnofiguration. Could this be done in such a way that it doesn't disturb what I do in my working directory?The text was updated successfully, but these errors were encountered: