| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous suggestion would clear executable bit, meaning directory
couldn't be entered. Fixes #11003.
Test Plan: Read message.
Reviewers: austin, thomie, dfeuer
Reviewed By: thomie, dfeuer
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1350
GHC Trac Issues: #11003
|
|
|
|
|
|
|
|
| |
Patch by lukyanov.
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D1337
|
|
|
|
|
| |
As GHCi is compiled by stage1+ GHC only, we can
drop the explicit `return` definition rightaway.
|
|
|
|
|
|
| |
Comes with Haddock submodule update.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
| |
Reviewed by: austin
Differential Revision: https://phabricator.haskell.org/D1314
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Windows preprocessor code calls `runInteractiveProcess` but does
not check if an exception is thrown.
`runInteractiveProcess` calls `CreateProcess` which when given a format
the system loader does not know about
will throw an exception. This is what makes #9399 fail.
Ultimately we should not use any `CreateProcess` based calls but
instead `ShellExecuteEx` as this would allow
us to run applications that the shell knows about instead of just the
loader. More details on #365.
This patch removes `PhaseFailed` and throws `ProgramError` instead.
`PhaseFailed` was largely unneeded since it never gave
very useful information aside from the `errorcode` which was almost
always `1`. `IOErrors` have also been eliminated and `GhcExceptions`
thrown in their place wherever possible.
Updates haddock submodule.
Test Plan:
`./validate` to make sure anything didn't break and
`make TESTS="T365"` to test that an error is now properly thrown
Reviewers: austin, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D1256
GHC Trac Issues: #365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch drops the file level distinction between hs-boot and hsig;
we figure out which one we are compiling based on whether or not there
is a corresponding hs file lying around.
To make the "import A" syntax continue to work for bare hs-boot
files, we also introduce hs-boot merging, which takes an A.hi-boot
and converts it to an A.hi when there is no A.hs file in scope.
This will be generalized in Backpack to merge multiple A.hi files together;
which means we can jettison the "load multiple interface files" functionality.
This works automatically for --make, but for one-shot compilation
we need a new mode: ghc --merge-requirements A will generate an A.hi/A.o
from a local A.hi-boot file; Backpack will extend this mechanism further.
Has Haddock submodule update to deal with change in msHsFilePath behavior.
- This commit drops support for the hsig extension. Can
we support it? It's annoying because the finder code is
written with the assumption that where there's an hs-boot
file, there's always an hs file too. To support hsig, you'd
have to probe two locations. Easier to just not support it.
- #10333 affects us, modifying an hs-boot still doesn't trigger
recomp.
- See compiler/main/Finder.hs: this diff is very skeevy, but
it seems to work.
- This code cunningly doesn't drop hs-boot files from the
"drop hs-boot files" module graph, if they don't have a
corresponding hs file. I have no idea if this actually is useful.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari, spinda
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1098
|
|
|
|
| |
This reverts commit 214596de224afa576a9c295bcf53c6941d6892e0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
See Note [CrossCompiling vs Stage1Only] in mk/config.mk.in.
See Note [Stage1Only vs stage=1] in mk/config.mk.in.
See Note [No stage2 packages when CrossCompiling or Stage1Only].
Also:
* use stage2 to build mkUserGuidePart, as was probably intended.
Now the following represent the same set of packages:
- packages that we build with ghc-stage2
- packages that depend on the ghc library
Those packages are: haddock, mkUserGuidePart and ghctags.
* don't let utils that don't depend on the ghc library depend on its
package-data.mk file. Instead, let those utils directly depend on
the package-data.mk files of the stage1 packages. Not sure if it
improves anything, but I found it easier to explain what's going on
this way.
(partially) reviewed by: austin
Differential Revision: https://phabricator.haskell.org/D1218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only supports UTF-8 as a value right now. I expect some discussion to go
on around the naming of this variable and whether it's valid to backport
it to GHC 7.10 (which would be my preference). The motivation here is
that, when capturing the output of GHC to a file, we often want to
ensure that the output is UTF-8, regardless of the actual character
encoding of the terminal/console.
On the other hand, we don't want to necessary change the
terminal/console encoding. The reason being:
* On Windows, this requires a global-esque change to the console
codepage, which adversely affects other processes in the same console
* On all OSes, this can break features like smart quote auto-detection.
Test Plan:
Set LANG to C, GHC_CHARENC to UTF-8, and compile a Haskell source
file with a non-ASCII warning produced. The output who include the UTF-8
sequence instead of replacing it with ?.
Reviewers: austin, rwbarton, bgamari
Reviewed By: bgamari
Subscribers: hsyl20, thomie
Differential Revision: https://phabricator.haskell.org/D1167
GHC Trac Issues: #10762
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids the compiler from crashing when, for example, a warning
contains a non-Latin identifier and the LANG variable is set to C.
Fixes #6037.
Test Plan:
Create a Haskell source file containing an identifier with non-Latin
characters and no type signature. Compile with `LANG=C ghc -Wall
foo.hs`, and it should fail. With this patch, it will succeed.
Reviewers: austin, rwbarton, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1153
GHC Trac Issues: #6037, #10762
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Phab:D907 introduced SourceText for a number of data types, by replacing
FastString with (SourceText,FastString). Since this has an Outputable
instance, no warnings are generated when ppr is called on it, but
unexpected output is generated. See Phab:D1096 for an example of this.
Replace the (SourceText,FastString) tuples with a new data type,
```lang=hs
data StringLiteral = StringLiteral SourceText FastString
```
Update haddock submodule accordingly
Test Plan: ./validate
Reviewers: hvr, austin, rwbarton, trofi, bgamari
Reviewed By: trofi, bgamari
Subscribers: thomie, trofi, rwbarton, mpickering
Differential Revision: https://phabricator.haskell.org/D1101
GHC Trac Issues: #10692
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: bgamari, thomie
Differential Revision: https://phabricator.haskell.org/D904
|
|
|
|
|
|
|
| |
This reverts commit bac927b9770ff769128b66d13a3e72bf5a9bc514.
As it turns out, we need these commits for separate compilation
and accurate dependency tracking. So back in they go!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: I couldn't add tests because apparently line number
reporting was already working correctly when loading script files. I
don't know how to test by running commands using stdin, is this
supported?
Reviewers: austin, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: hvr, thomie
Differential Revision: https://phabricator.haskell.org/D1067
|
|
|
|
|
| |
They were introduced in 6ae696a1d1f25bf52923a3dd1c3b4a08e2033bfd. We do
cross-compilation differently now.
|
|
|
|
|
|
|
|
| |
Added load! and reload! commands, effectively setting
"-fdefer-type-errors" before loading a file and
unsetting it after loading if it has not been set before.
Differential Revision: https://phabricator.haskell.org/D960
|
|
|
|
| |
Follow up to 124f3999d78d8ef6b093e4f1bb1dcef87e4283da.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: It was possible to kill GHCi with a carefully-timed ^C
Test Plan: The bug in #10017 exposed this
Reviewers: bgamari, austin
Reviewed By: austin
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1015
GHC Trac Issues: #10017
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This commit brings following changes and fixes:
* Implement parseExpr and compileParsedExpr;
* Fix compileExpr and dynCompilerExpr, which returned `()` for empty expr;
* Fix :def and :cmd, which didn't work if `IO` or `String` is not in scope;
* Use GHCiMonad instead IO in :def and :cmd;
* Clean PrelInfo: delete dead comment and duplicate entries, add assertion.
See new tests for more details.
Test Plan: ./validate
Reviewers: austin, dterei, simonmar
Reviewed By: simonmar
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D974
GHC Trac Issues: #10508
|
|
|
|
| |
This reverts commit a7524eaed33324e2155c47d4a705bef1d70a2b5b.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`enqueueCommands` should always force exception in commands. Otherwise
the exception thrown in `:cmd` (e.g. `:cmd return $ head []`) will cause
GHCi to terminate with panic.
Test Plan: `cd testsuite/tests/ghci/ && make`
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D967
GHC Trac Issues: #10501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The strings used in a WARNING pragma are captured via
strings :: { Located ([AddAnn],[Located FastString]) }
: STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) }
..
The STRING token has a method getSTRINGs that returns the original
source text for a string.
A warning of the form
{-# WARNING Logic
, mkSolver
, mkSimpleSolver
, mkSolverForLogic
, solverSetParams
, solverPush
, solverPop
, solverReset
, solverGetNumScopes
, solverAssertCnstr
, solverAssertAndTrack
, solverCheck
, solverCheckAndGetModel
, solverGetReasonUnknown
"New Z3 API support is still incomplete and fragile: \
\you may experience segmentation faults!"
#-}
returns the concatenated warning string rather than the original source.
This patch now deals with all remaining instances of getSTRING to bring
in a SourceText for each.
This updates the haddock submodule as well, for the AST change.
Test Plan: ./validate
Reviewers: hvr, austin, goldfire
Reviewed By: austin
Subscribers: bgamari, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D907
GHC Trac Issues: #10313
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Introduce by #95 'canonicalizePath' throws and exception when given
an invalid file in a call to 'sameFile'.
There are two cases when this can happen when using ghci:
1) If there is an error at the interactive prompt, "<interactive>"
file is searched for and not found.
2) If there is an error in any loaded file and editing an inexistent/new
file with 'e: foo'.
Both cases are now tested.
Test Plan: validate
Reviewers: austin, #ghc
Reviewed By: austin, #ghc
Subscribers: bgamari, thomie
Differential Revision: https://phabricator.haskell.org/D930
GHC Trac Issues: #10101
|
|
|
|
|
|
|
|
|
| |
These behave like the count arguments of the gdb `up` and `down`
commands, allowing the user to quickly jump around in history.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D853
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not check dir perms when .ghci doesn't exist, otherwise GHCi will
print some confusing and useless warnings in some cases (e.g. in travis).
This will fix test T8333 and T10408A in travis.
T10408A will be a test case to cover this. And T8333 is changed to be
not affected by this.
Test Plan:
chmod o+w ~/.ghc
make TESTS="T8333 T10408A T10408B"
chmod o-w ~/.ghc
Reviewers: austin, nomeata
Differential Revision: https://phabricator.haskell.org/D890
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make `-ghci-script` be executed in the order they are specified;
* Make `-ignore-dot-ghci` only ignores the default .ghci files but
still execute the scripts passed by `-ghci-script`.
Reviewed By: simonmar, austin
Differential Revision: https://phabricator.haskell.org/D887
GHC Trac Issues: #10408
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The point of this commit is to make the memory allocation statistic
from :set +s in GHCi a lot more accurate. Currently it uses the total
allocation figure calculated by the RTS, which is only updated during
GC, so can be wrong by an arbitrary amount. The fix is to the the
per-thread allocation counter that was introduced for allocation
limits.
This required changes to the GHC API, because we now have to return
the allocation value from each evaluation. Rather than just change
the API, I introduced a new API and deprecated the old one. The new
one is simpler and more extensible, so hopefully we won't need to make
this transition in the future. See GHC.hs for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is currently no way to separate whether UnicodeSyntax is accepted
for input from the corresponding output syntax using unicode symbols.
This patch implements a separate flag for affecting ghc(i)'s output.
Signed-off-by: Bertram Felgenhauer <int-e@gmx.de>
Reviewed By: nomeata, austin
Differential Revision: https://phabricator.haskell.org/D807
GHC Trac Issues: #8959
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
A common pattern when programming with signatures is to combine multiple
signatures together (signature linking). We achieve this by making it
not-an-error to have multiple, distinct interface files for the same module
name, as long as they have the same backing implementation. When a user
imports a module name, they get ALL matching signatures dumped into their
scope.
On the way, I refactored the module finder code, which now distinguishes
between exact finds (when you had a 'Module') and regular finds (when
you had a 'ModuleName'). I also refactored the package finder code to
use a Monoid instance on LookupResult to collect together various results.
ToDo: At the moment, if a signature is declared in the local package,
it completely overrides any remote signatures. Eventually, we'll want
to also pull in the remote signatures (or even override the local signature,
if the full implementation is available.) There are bunch of ToDos in the
code for what to do once this is done.
ToDo: At the moment, whenever a module name lookup occurs in GHCi and we
would have seen a signature, we instead continue and return the Module
for the backing implementation. This is correct for most cases, but there
might be some situations where we want something a little more fine-grained
(e.g. :browse should only list identifiers which are available through
the in-scope signatures, and not ALL of them.)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, hvr, austin
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D790
GHC Trac Issues: #9252
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```
chmod 664 $PATH_TO_GHCI_CONF/.ghci
```
Run ghci. You will now get a warning + a suggestion:
```
*** WARNING: $PATH_TO_GHCI_CONF/.ghci is writable by someone else, IGNORING!
Suggested fix: execute 'chmod 644 $PATH_TO_GHCI_CONF/.ghci'
```
Execute fix and the warning should disappear.
Reviewed By: mboes, thomie
Differential Revision: https://phabricator.haskell.org/D805
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Hooks rely on static linking semantics, and are broken by -Bsymbolic
which we need when using dynamic linking.
Test Plan: Built it
Reviewers: austin, hvr, tibbe
Differential Revision: https://phabricator.haskell.org/D8
|
|
|
|
|
|
| |
[skip ci]
Differential Revision: https://phabricator.haskell.org/D812
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`.hspp` and `.hscpp` are haskell files that have already been preprocessed.
Treat `.hspp` and `.hscpp` as Haskellish sources again, as they were before
commit a10e1990. This way, ghc --make will load their imports.
Make sure that `.cmm` and `.cmmcpp` are still not treated as Haskellish,
by moving them out of `haskell_src_suffixes` (but still keeping them in
haskellish_suffixes, though I'm not sure what the purpose of that group
is).
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D778
|
|
|
|
|
|
|
|
| |
Show a more descriptive error message.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D775
|
|
|
|
|
|
| |
Reviewed By: kgardas
Differential Revision: https://phabricator.haskell.org/D763
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Cpp = Pre-process C
Ccpp = Compile C++
Cobjcpp = Compile Objective-C++
CmmCpp = Pre-process Cmm
Quite confusing! This commit renames `Ccpp` to `Ccplusplus`, and
`Cobjcpp` to `Cobjcplusplus`. The two letters `p-p` keep standing for
`pre-processing` throughout the compiler.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D756
|
|
|
|
|
|
| |
The `-unreg` flag was removed in commit dade8ab (2007), see #1008.
[skip-ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parsing of static and mode flags happens before any session is started,
i.e., before the first call to 'GHC.withGhc'. Therefore, to report
errors for invalid usage of these two types of flags, we can not call
any function that needs DynFlags, as there are no DynFlags available yet
(unsafeGlobalDynFlags is not set either). So we always print "on the
commandline" as the location, which is true except for Api users, which
is probably ok.
When reporting errors for invalid usage of dynamic flags we /can/ make
use of DynFlags, and we do so explicitly in
DynFlags.parseDynamicFlagsFull.
Before, we called unsafeGlobalDynFlags when an invalid (combination of)
flag(s) was given on the commandline, resulting in panics (#9963). This
regression was introduced in 1d6124de.
Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
from happening again.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D730
GHC Trac Issues: #9963
|
|
|
|
|
|
| |
This also needs to update a couple of other submodules
to update the upper bound on filepath to allow this major
version bump to 1.4.0.0
|
|
|
|
|
|
| |
This involves recognizing lines starting with `"pattern "` as declarations,
keeping non-exported pattern synonyms in `deSugar`, and including
pattern synonyms in the result of `hscDeclsWithLocation`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Note: This commit includes an API change to GhciMonad.runDecls
to allow the caller to determine whether the declarations were
run successfully or not.
Test Plan: harbormaster
Reviewers: austin
Reviewed By: austin
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D582
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Some Trues and Falses were mixed up due to Bool being used in
different senses in different parts of GHCi.
Test Plan: harbormaster; validate
Reviewers: austin
Reviewed By: austin
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D581
GHC Trac Issues: #9905
Conflicts:
ghc/InteractiveUI.hs
|
| |
|
|
|
|
| |
declaration (fixes #9914)
|
|
|
|
| |
look like prefixes of valid declarations (fixes #9915)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we switched to a Git submodule based GHC Git repo, `ghc.git`'s
commit id uniquely identifies the state of the GHC source-tree. So
having that information embedded into the `ghc` executable provides
valuable information to track accurately (especially when created by
buildbots) from which source-tree-state a given `ghc` snapshot
(distribution) was generated.
So this commit adds a new field `"Project Git commit id"` to the
`ghc --info` meta-data containing the `./configure`-time Git commit id
as reported by `git rev-parse HEAD`.
This field can also be queried with `ghc --print-project-git-commit-id`.
For source distributions, the file `GIT_COMMIT_ID` is created (with some
sanity checking to detect stale commit ids, as that would render this
information rather useless)
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D528
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously 'ghc --show-options' showed all options that GHC can possibly
accept. With this patch, it'll only show the options that have effect in
non-interactive modes.
This change also adds support for using 'ghc --interactive --show-options'
which previously was disallowed. This command will show all options that have
effect in the interactive mode.
The CmdLineParser is updated to know about the GHC modes, and then each flag
is annotated with which mode it has effect.
This fixes #9259.
Test Plan:
Try out --show-options with --interactive on the command line. With and without
--interactive should give different results.
Run the test suite, mode001 has been updated to verify this new flag
combination.
Reviewers: austin, jstolarek
Reviewed By: austin, jstolarek
Subscribers: jstolarek, thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D337
GHC Trac Issues: #9259
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
trac #9293)
Summary: ghci unset could not reverse language extensions.
Reviewers: hvr, thomie, austin
Reviewed By: hvr, thomie, austin
Subscribers: goldfire, hvr, thomie, carter
Differential Revision: https://phabricator.haskell.org/D516
GHC Trac Issues: #9293
|