Commit Graph

46 Commits

Author SHA1 Message Date
Daniel Gröber 86c157d1d2 Add some more debug output 2015-09-02 05:30:00 +02:00
Daniel Gröber 41de8b8b2e Sandwich new Monad layer GmOutT into transformer stack
This way we can have access to some options pre Cradle setup which
should fix the output interleaving problems I was observing.
2015-09-01 10:32:27 +02:00
Daniel Gröber 2a0414f368 Pass stack ghc paths down to cabal-helper 2015-08-31 04:17:33 +02:00
scturtle d660e7cd85 add 'StackProject' around 2015-08-19 09:17:30 +02:00
Alan Zimmerman eafde94913 Expose functions for integration with HaRe 2015-08-13 09:49:51 +02:00
Daniel Gröber 28f06e035d Cleanup project type handling 2015-08-12 09:25:13 +02:00
Daniel Gröber 49515b3eb8 Fix #487, Modules from sandbox not visible 2015-06-05 22:45:52 +02:00
Daniel Gröber 95b16ded6d Fix `checkComponent` 2015-04-14 00:53:40 +02:00
Daniel Gröber 94ef8fae79 Enhance debug information 2015-04-12 02:48:54 +02:00
Daniel Gröber 80d91776c5 Cleanup and some fixes 2015-03-28 19:13:48 +01:00
Daniel Gröber 82bb0090c0 Refactoring to use cabal-helper-wrapper
This turned out to be quite involved but save for this huge commit it's
actually quite awesome and squashes quite a few bugs and nasty
problems (hopefully). Most importantly we now have native cabal
component support without the user having to do anything to get it!

To do this we traverse imports starting from each component's
entrypoints (library modules or Main source file for executables) and
use this information to find which component's options each module will
build with. Under the assumption that these modules have to build with
every component they're used in we can now just pick one.

Quite a few internal assumptions have been invalidated by this
change. Most importantly the runGhcModT* family of cuntions now change
the current working directory to `cradleRootDir`.
2015-03-05 17:35:24 +01:00
Daniel Gröber ef96b926c7 Use cabal-helper to support Cabal >= 1.22 with any version of ghc 2015-02-08 12:43:35 +01:00
Rob Everest 2c2e7782d2 Use the cabal configuration flags where possible when finalizing the PackageDescription. 2014-09-12 13:15:05 +10:00
Daniel Gröber 271ff4e162 Catch `cabal configure` failure properly 2014-08-18 08:06:36 +02:00
Kazu Yamamoto 02ce2d4a1d removing warnings. 2014-08-14 10:01:35 +09:00
Daniel Gröber c1c7dcec20 Rename `ghcOpts` -> `ghcUserOptions` 2014-08-13 19:28:08 +02:00
Daniel Gröber 87c587993a Make `parseCabalFile` use MonadError 2014-08-12 18:24:39 +02:00
Kazu Yamamoto cffa7463eb adopting hlint's suggestions. 2014-07-17 17:16:44 +09:00
Daniel Gröber f0bfcb8811 Use GhcModT everywhere and remove the GhcMod alias
Not doing this makes having GhcModT pretty pointless as users of the
library wouldn't be able to use custom inner monads as evey function for
dealing with GhcModT's would be constraint to (GhcModT IO) thus only
allowing IO as the inner monad.
2014-07-15 01:03:56 +02:00
Daniel Gröber b6896a481a Move `initializeFlagsWithCradle` to Monad.hs 2014-07-12 03:33:04 +02:00
Daniel Gröber 4b6a687bc1 Migrate the remaining parts of the exposed API to `GhcMod a` 2014-07-11 03:13:38 +02:00
Daniel Gröber ebfb740a2e Move `convert` to it's own module. 2014-05-14 17:06:30 +02:00
Kazu Yamamoto df4dd97e48 ghc-mod debug does not need a file. 2014-04-21 11:31:15 +09:00
Kazu Yamamoto 12dac1f0a5 ghc-mod root does not need a file. 2014-04-21 11:22:39 +09:00
Daniel Gröber 2381f6e1ab More refactoring of package handling
- 'GhcPkg' now parses 'ghc-pkg -v list' output directly to also get the
  package-id

- Remove unused field 'cradlePackages' in Cradle

- Remove 'getPackageDbPackages' and use 'ghcPkgListEx' instead
2014-04-18 03:59:46 +02:00
Kazu Yamamoto 145c27a129 hlint hack. 2014-04-16 11:52:49 +09:00
Daniel Gröber 30b8366526 Refactor the way packages databases are handled
- cradle now stores a list of active package databases instead of only
  the user store (if present).

- rename `cradlePackageDb` -> `cradlePkgDbStack` as that`s what the ghc
  documentaion calls this kind of thing

- `getPackageDbPackages` now returns names of all visible packages in
  the given directory. Also the implementation now uses `ghc-pkg`
  instead of manually looking at the package database
2014-04-15 05:15:50 +02:00
Kazu Yamamoto 770644e87d debug also displays sys lib dir. 2014-04-09 15:15:26 +09:00
Kazu Yamamoto 3bfbbb8b5c supporting sandbox only (without cabal) to fix #164. 2014-03-30 17:28:57 +09:00
Kazu Yamamoto 187f718de0 hlint hack. 2014-03-27 16:35:41 +09:00
Kazu Yamamoto fbed91f6f2 close import. 2014-03-27 15:23:27 +09:00
Kazu Yamamoto 660a1e95f5 using liftIO from CoreMonad. 2014-03-27 15:08:07 +09:00
Kazu Yamamoto 7141ec5db1 removing "import Prelude". 2014-03-27 13:50:09 +09:00
Kazu Yamamoto ee6dc2fc47 ghc-mod root. 2014-03-20 16:21:48 +09:00
Kazu Yamamoto 31ce0999a1 "debug" displyas a root dir. 2014-03-19 15:01:32 +09:00
Kazu Yamamoto 16e050439d removing fast/slow code. 2014-03-17 15:56:00 +09:00
Naohiro Aota a0db24b0a5 Extend Package to include id
This commit
1. rename Package with PackageBaseName
2. Pacakge = (PackageBaseName, Maybe String) to save its id
3. Expose packages with id if available
2014-01-30 20:45:30 +09:00
Kazu Yamamoto 5f0fcd0442 getCompilerOptions handles package-db options. 2013-09-20 17:15:41 +09:00
Kazu Yamamoto 8e4d2cec21 Obsoleting fromCabalFile. 2013-09-19 16:21:48 +09:00
Kazu Yamamoto 97da4e9be1 Defining CompilerOptions. 2013-09-19 15:58:50 +09:00
Kazu Yamamoto 5e53841451 improving doc. 2013-09-05 14:35:28 +09:00
Niklas Hambüchen 4758a6043c check + expand: Allow passing in multiple files 2013-09-03 20:01:47 +09:00
Kazu Yamamoto 089d490607 writing docs. 2013-05-20 14:28:56 +09:00
Kazu Yamamoto 849c308e5c Separating IO and Ghc. 2013-05-20 11:29:44 +09:00
mvoidex f2f3b120af Moving commands to Ghc monad 2013-05-19 01:16:37 +04:00
Kazu Yamamoto bac4bbbcf3 Changing GHCMod as a library. 2013-05-17 10:00:01 +09:00