Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Explicit project (Was: #585) #806

Closed
wants to merge 4 commits into from
Closed

Conversation

alang9
Copy link
Contributor

@alang9 alang9 commented Jul 11, 2016

This is continued from #585. We've added some tests and travis runs now succeed.

@alang9 alang9 changed the title Explicit project (Was: !585) Explicit project (Was: #585) Jul 11, 2016
@alang9 alang9 force-pushed the explicit-project branch from 57b1be1 to e50639d Compare August 2, 2016 04:03
@lierdakil
Copy link
Collaborator

This fails to build on GHC 8.0.1:

Language/Haskell/GhcMod/Gap.hs:681:11: error:
    Variable not in scope: cleanTempFiles :: DynFlags -> IO a0

Language/Haskell/GhcMod/Gap.hs:682:11: error:
    Variable not in scope: cleanTempDirs :: DynFlags -> IO a1

where
zipMap f l = l `zip` (f `map` l)

explicitOpts :: Cradle -> GhcModT m [String]
explicitOpts Cradle {..} = case cradleCabalFile of
Nothing -> return []
Copy link
Owner

@DanielG DanielG Aug 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain what you're doing here? Looking at what explicitCradle above it seems that when the project type is ExplicitCradle """cradleCabalFile""" would always be: cradleCabalFile = Just optionsFile which seems like a horrible misnomer in its own right ;)

Also maybe you could put the optionsFile in the ExplicitProject constructor like we do with the StackEnv stuff?

@DanielG
Copy link
Owner

DanielG commented Aug 3, 2016

Those binary package.cache files are sure to break at some point, do you absolutely need them? Maybe those can just be empty or something? Either way we already do package-db setup in the test Main, maybe you can re-use that: https://github.com/DanielG/ghc-mod/blob/master/test/Main.hs#L26

out <- liftIO $ readProc ghcMod ["--verbose", "error", "dumpsym"] ""
return $!! decode out
ts <- liftIO getCurrentModTime
st <- runGmPkgGhc getGlobalSymbolTable
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no good, there is a reason we do this in another process (memory usage). Please revert.

@DanielG
Copy link
Owner

DanielG commented Aug 3, 2016

@lierdakil this PR doesn't even touch Gap, wtf?

@lierdakil
Copy link
Collaborator

It's probably just needs rebasing on current master =\

bench/data/simple-cabal/*.hs
test/data/options-cradle/ghc-mod.options
test/data/options-cradle/ghc-mod.package-db-stack
test/data/options-cradle/package-db-a/package.cache
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so you don't want to check in package.cache into repo, since it's ghc-specific binary format which can (and will) change, and your tests will fail for no good reason with something like
GHC.PackageDb.readPackageDb: inappropriate type (not a ghc-pkg db file, wrong file magic number)

@DanielG
Copy link
Owner

DanielG commented Sep 25, 2017

ETIMEDOUT, closing. Feel free to reopen if you still want to work on this.

@DanielG DanielG closed this Sep 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants