Version 0.8.
This is a major new release with a lot of new functionality, bug fixes, and
some minor API changes.
-
New functionality: support for GHC 7.8, and make sure that a single
ide-backend client library, compiled with a stock ghc, can talk to
multiple ide-backend-servers (one for ghc 7.4, one for ghc 7.8)
(#137, #147, #148, #149, #150, #151, #158, ghc #8006, ghc #8067,
ghc Hooks proposal). Setup instructions are included in "setup/SETUP.md".
NOTE: This requires new versions of both ghc 7.4 and ghc 7.8.
-
For ghc 7.4: commit 8c021d1 (branch ide-backend-experimental-74).
Differences from the official release: backported Hooks; backported
fixes to #1381, #7040, #7231, #7478, #8006, #8333
(ide-backend issues #145 and #161). Also applied patch for #4900,
although that patch is not accepted in HEAD yet (necessary for #118).
-
For ghc 7.8: commit e0f0172 (branch ide-backend-experimental-78).
Since there is no official release of ghc yet, this picks a
semi-random snapshot of the ghc tree (a93f857). Our branch differs
from this snapshot by only a single patch (for #118/ghc #4900); we
have made various other patches, but they have all been included in
the official tree.
Note that we now use ghc's standard non-release version numbering
(7.4.2. and 7.7.). ide-backend supports a higher level query
(getGhcVersion :: Query GhcVersion) where
data GhcVersion = GHC742 | GHC78
-
New functionality: debugging API (#131).
Breakpoints can be set/cleared using
setBreakpoint :: IdeSession
-> ModuleName
-> Public.SourceSpan
-> Bool
-> IO (Maybe Bool)
The existing API for binding subexpressions can be used to construct
SourceSpans.
When a breakpoint is set, snippets can stop with a new RunResult
data RunResult =
...
| RunBreak
They can be resumed using
resume :: IdeSession -> IO (RunActions Public.RunResult)
Information about the current breakpoint (if any) can be got using
getBreakInfo :: Query (Maybe BreakInfo)
data BreakInfo = BreakInfo {
breakInfoModule :: Public.ModuleName
, breakInfoSpan :: SourceSpan
, breakInfoResultType :: Public.Type
, breakInfoVariableEnv :: Public.VariableEnv
}
type VariableEnv = [(Name, Type, Value)]
Variables can be printed and/or forced using
printVar :: IdeSession
-> Public.Name
-> Bool
-> Bool
-> IO Public.VariableEnv
The two booleans indicate whether new variables should be bound (cf.
ghci's :print vs :sprint) and whether the value should be forced (:print
vs :force). This is only valid during an active breakpoint.
Not all of ghci's debugging funtionality is yet supported; this is
documented in more detail in the ticket (#131, also #136). Note also
that the API may not be entirely stable yet. In particular, having
printVar independent of RunActions is unsatisfactory; fixing this may
change the runStmt API too. This is documented in great detail in a new
ticket (#153).
-
New functionality: generate Hoogle/Haddock (#70). Please read
the documentation of @buildDoc@, test and suggest improvements. See also
https://github.com/fpco/ide-backend/issues/70#issuecomment-32031570
-
New functionality: distinguish between KindError and KindServerDied, and
hide the "internal exception" when showing external exceptions (#135)
-
New functionality: allow to set compilation targets (#152)
updateTargets :: Maybe [FilePath] -> IdeSessionUpdate ()
As part of this also added a new field called configRelativeIncludes to
SessionConfig (#156). To see why this is necessary, consider "module A"
in "foo/bar/A.hs" and "module B" in "foo/bar/B.hs", where module B
imports module A, and we specify "foo/bar/B.hs" as the target. Then ghc
will be unable to find module A because it won't know to look in
directory "foo/bar" (before updateTargets this was not an issue because
we specified all modules paths explicitly to ghc). Now
configRelativeIncludes can be used to tell ghc where to look (in this
case, it should be set to ["foo/bar"]).
Note that buildExe and co do not yet take these targets into account
(#154), except for configRelativeIncludes, which are, in particular,
inserted into the hs-source-dirs field of .cabal, if set.
Also, fixed bug where we would not pass -i to the ghc server on session
restart (this bug was mostly invisible when we were providing all source
files explicitly).
-
New functionality: support for boot files (#155, #157).
-
New functionality: support C files (and .h files), both through
the API (where ide-backend-server compiles the .c files
into .o files and dynamically loads/unloads these object files)
and in executable generation (#122).
-
New functionality: specify (as the first argument of buildExe)
additional arguments for ghc when building executables (#159).
-
Bugfix: setting ghc options is now stateless. We still have
configStaticOpts :: [String]
as before, which can be used for things like package options, but changed
updateGhcOptions :: Maybe [String] -> IdeSessionUpdate
to
updateDynamicOpts :: [String] -> IdeSessionUpdate
with the following semantics: the full set of active options is those
specified in configStaticOpts, plus those (and only those) set in the
last call to updateDynamicOpts. In other words, setting
updateDynamicOpts ["-Wall", "-Werror"]
and then later
updateDynamicOpts ["-Wall"]
now does the right thing (#115).
-
Bugfix: Make sure ID info is updated on code changes (fixed a caching
problem) (#142)
-
Bugfix: Make sure that updating static files triggers recompilation
(#118). This is fixed by means of a ghc patch (in both 7.4 and 7.8; ghc
issue #4900).
-
Bugfix: Avoid confusing error message in buildExe for code with type
errors (#145, #160).
-
Better way to deal with async exceptions in snippet interrupts in ghc
(#58, ghc issue #8006). The new solution works in both 7.4 and 7.8, and
in both "regular" execution of snippets and in execution with
breakpoints enabled/resumed execution (#133). The new approach is now in
the official GHC tree.
-
Upgraded to Cabal 1.18.1.2 (necessary to support GHC 7.8), and set
things up so that it generates the necessary dynlibs when using 7.8.
Although Cabal 1.18 reports problems slightly differently to Cabal
1.16, ide-backend attempts to hide this difference (#146). There is
still a minor problem on OSX when using an in-place compiler due to
either a bug in ghc or a bug in cabal (#8266); see #164.
-
Minor API changes:
- RunActions now has kind * -> * ; what was previously just "RunActions"
is now (from the client's perspective) "RunActions RunResult"
- String argument to RunOk has been removed.
- IdeSessionUpdate now has kind * -> * ; what was previously just
"IdeSessionUpdate" is now "IdeSessionUpdate ()". IdeSessionUpdate
has been given a Monad instance.
- updateModule* is now called updateSourceFile* (because it is used for
more than just Haskell modules).
-
Merged pull requests
- Use binary-ide-backend throughout (#144)
- Tweaks to getDotCabal (#141)
-
Test-suite modificatons:
- Test for #134: multiple changes to TH dependent files in one second
- Test for #32: Internal paths in error messages
- Test for #50: Async problem with snippet interrupt
- Test for fpco/fpco/#3043: constraints in monotypes
- Fixed non-deterministic failure of test for #58 (#143)
- Updated tests to support for 7.4 and 7.8 (mark allowable differences,
use alpha-equivalence rather than syntactic identity to compare
types, etc.), and be less picky about package versions
- Others, testing most of the features and fixes in this release
-
Isolated a bug in sqlite which was causing #104.
-
Known issue: tracked #125 down to a bug in the GHC RTS, and reported
this (#165, https://ghc.haskell.org/trac/ghc/ticket/8648). There is no
fix yet though.