| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The -x option is used to manually specify which phase a file should be
started to be compiled from (even if it lacks the correct extension). I
just failed to implement this when refactoring the driver.
In particular Cabal calls GHC with `-E -cpp -x hs Foo.cpphs` to
preprocess source files using GHC.
I added a test to exercise this case.
Fixes #22044
|
|
|
|
|
|
|
| |
We were failing to stop before running the assembler so the object file
was also created.
Fixes #21869
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems like it was just an oversight to use the incorrect DynFlags
(global rather than local) when implementing these two options. Using
the local flags allows users to request these intermediate files get
cleaned up, which works fine in --make mode because
1. Interface files are stored in memory
2. Object files are only cleaned at the end of session (after link)
Fixes #21349
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
How things should work:
* -i is the search path for source files
* -hidir explicitly sets the search path for interface files and the output location for interface files.
* -odir sets the search path and output location for object files.
Before in one shot mode we would look for the interface file in the
search locations given by `-i`, but then set the path to be in the
`hidir`, so in unusual situations the finder could find an interface
file in the `-i` dir but later fail because it tried to read the
interface file from the `-hidir`.
A bug identified by #20569
|
|
|
|
|
| |
Otherwise GHC realizes that it's not attached to a proper tty and will
disable caret diagnostics.
|
|
|
|
|
|
|
|
|
| |
- Change the dumpPrefix to FilePath, and default to non-module
- Add dot to seperate dump-file-prefix and suffix
- Modify user guide to introduce how dump files are named
- This commit does not affect Ghci dump file naming.
See also #17500
|
|
|
|
|
| |
The BSD sed implementation doesn't allow `sed -i COMMAND FILE`; one must
rather use `sed -i -e COMMAND FILE`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The GHC.Prim module is quite special as there is no interface file,
therefore it doesn't appear in ms_textual_imports, but the ghc-prim
package does appear in the direct package dependencies. This confused
the recompilation checking which couldn't find any modules from ghc-prim
and concluded that the package was no longer a dependency.
The fix is to keep track of whether GHC.Prim is imported separately in
the relevant places.
Fixes #20084
|
| |
|
|
|
|
|
|
| |
Fixed in 25977ab542a30df4ae71d9699d015bcdd1ab7cfb
Fixes #17481
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch comprises of four different but closely related ideas. The
net result is fixing a large number of open issues with the driver
whilst making it simpler to understand.
1. Use the hash of the source file to determine whether the source file
has changed or not. This makes the recompilation checking more robust to
modern build systems which are liable to copy files around changing
their modification times.
2. Remove the concept of a "stable module", a stable module was one
where the object file was older than the source file, and all transitive
dependencies were also stable. Now we don't rely on the modification
time of the source file, the notion of stability is moot.
3. Fix TH/plugin recompilation after the removal of stable modules. The
TH recompilation check used to rely on stable modules. Now there is a
uniform and simple way, we directly track the linkables which were
loaded into the interpreter whilst compiling a module. This is an
over-approximation but more robust wrt package dependencies changing.
4. Fix recompilation checking for dynamic object files. Now we actually
check if the dynamic object file exists when compiling with -dynamic-too
Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093
|
|
|
|
| |
Fix missing quoting and expected exit code.
|
|
|
|
| |
This isn't pretty but it's perhaps better than nothing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Under Windows all parameters to gcc are enclosed in quotes, opposite to
Linux, where the quotes are missing. Therefore in the test, we remove all
quotes in the stdout file with sed.
Test Plan: make test TEST=T14452
Reviewers: osa1, hvr, bgamari, monoidal, Phyx, simonpj
Reviewed By: Phyx
Subscribers: rwbarton, carter
GHC Trac Issues: #14452
Differential Revision: https://phabricator.haskell.org/D5398
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: make test TEST=T14452
Reviewers: hvr, bgamari, monoidal, thomie, osa1
Reviewed By: osa1
Subscribers: rwbarton, carter
GHC Trac Issues: #14452
Differential Revision: https://phabricator.haskell.org/D5318
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: `make test=T10869`
Reviewers: mpickering, thomie, ezyang, bgamari
Reviewed By: thomie, bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #10869
Differential Revision: https://phabricator.haskell.org/D4861
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a new flag, `-fignore-optim-changes`, allowing them to avoid
recompilation if the only changes are to the `-O` level or to
flags controlling optimizations.
* When `-fignore-optim-changes` is *off*, recompile when optimization
flags (e.g., `-fno-full-laziness`) change. Previously, we ignored
these unconditionally when deciding whether to recompile a module.
Reviewers: austin, bgamari, simonmar
Reviewed By: simonmar
Subscribers: duog, carter, simonmar, rwbarton, thomie
GHC Trac Issues: #13604
Differential Revision: https://phabricator.haskell.org/D4123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
D2917 added a change that will make paths on Windows response files
use DOS 8.3 shortnames to get around the fact that `libiberty` assumes
a one byte per character encoding.
This is actually not the problem, the actual problem is that GCC on
Windows doesn't seem to support Unicode at all.
This comes down to how unicode characters are handled between POSIX and
Windows. On Windows, Unicode is only supported using a multibyte character
encoding such as `wchar_t` with calls to the appropriate wide version of
APIs (name post-fixed with the `W` character). On Posix I believe the standard
`char` is used and based on the value it is decoded to the correct string.
GCC doesn't seem to make calls to the Wide version of the Windows APIs,
and even if it did, it's character representation would be wrong. So I
believe GCC just does not support utf-8 paths on Windows.
So the hack in D2917 is the only way to get Unicode support. The problem is
however that `GCC` is not the only tool with this issue and we don't use response
files for every invocation of the tools. Most of the tools probably don't support it.
Furthermore, DOS 8.1 shortnames only exist when the path or file physically exists on
disk. We pass lots of paths to GCC that don't exist yet, like the output file.
D2917 works around this by splitting the path from the file and try shortening that.
But this may not always work.
In short, even if we do Unicode correctly (which we don't atm, the GCC driver we build
uses `char` instead of `wchar_t`) we won't be able to compile using unicode paths that
need to be passed to `GCC`. So not sure about the point of D2917.
What we can do is support the most common non-ascii characters by writing the response
files out using the `latin1` code page.
Test Plan: compile + make test TEST=T12971
Reviewers: austin, bgamari, erikd
Reviewed By: bgamari
Subscribers: thomie, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2942
GHC Trac Issues: #12971
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2855
GHC Trac Issues: #12971
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously we would just let compilation proceed along until
we tried to pull up the Module for the hsig file, and get
main:A instead of <A>, and get a mysterious error. Check
for this earlier!
Fixes #12955.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2815
GHC Trac Issues: #12955
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonmar, austin, bgamari, thomie, rwbarton
Differential Revision: https://phabricator.haskell.org/D2509
GHC Trac Issues: #10923
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem with ignore_output is that it hides errors for WAY=ghci.
GHCi always returns with exit code 0 (unless it is broken itself).
For example: ghci015 must have been failing with compile errors for
years, but we didn't notice because all output was ignored.
Therefore, replace all uses of ignore_output with either ignore_stderr
or ignore_stdout. In some cases I opted for adding the expected output.
Update submodule hpc and stm.
Reviewed by: simonmar
Differential Revision: https://phabricator.haskell.org/D2367
|
|
|
|
|
| |
The previous commits removed `-fforce-recomp` from TEST_HC_OPTS, so
TEST_HC_OPTS_NO_RECOMP = TEST_HC_OPTS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no need for this flag anymore, since each test runs in a
newly created directory. Removing it cleans up testlib.py a bit.
There is a small risk that this renders some tests useless. It's hard to
know. Those tests should have specified -fforce-recomp` explicitly
anyway, so I'm not going to worry about it. I've fixed the ones that
failed without -fforce-recomp.
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D2346
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a linter to encourage the use of `$(TEST_HC_OPTS_INTERACTIVE)`
instead of `$(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0`. It's
too easy to forget one of those flags when adding a new test.
Update submodule hpc.
Reviewed by: austin
Differential Revision: https://phabricator.haskell.org/D2265
GHC Trac Issues: #11468
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: ./validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2015
GHC Trac Issues: #10320
|
|
|
|
|
| |
This reverts commit 8cba907ad404ba4005558b5a8966390159938172 which
broke `-ddump-to-file`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch creates empty dump file when GHC was run with
`-ddump-rule-firings` (or `-ddump-rule-rewrites`) and `-ddump-to-file`
specified, and there were no rules applied. If dump already exists it
will be overwritten by empty one.
Test Plan: ./validate
Reviewers: austin, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D1514
GHC Trac Issues: #10320
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
D898 was primarily intended to fix hangs in the event that iconv was
unavailable (namely #10298 and #7695). In addition to this fix, it also
introduced self-contained handling of ANSI terminals to allow compiled
executables to run in minimal environments lacking iconv.
However, the behavior that the patch introduced is highly suspicious.
Specifically, it gives the user a UTF-8 encoding even if they requested
ASCII.
This has the potential to break quite a lot of code. At very least it
breaks GHC's Unicode terminal detection logic, which attempts to catch
an invalid character when encoding a pair of smart-quotes. Of course,
this exception will never be thrown if a UTF-8 encoder is used.
Here we use the `char8` encoding to handle requests for ASCII encodings
in the event that we find iconv to be non-functional.
Fixes #10623.
Test Plan: Validate with T8959a
Reviewers: rwbarton, hvr, austin, hsyl20
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1059
GHC Trac Issues: #10623
|
|
|
|
|
|
| |
Since T10408A and T10408B would become the same now, delete T10408A and
rename T10408B to T10408. The test without -ignore-dot-ghci (T10408A)
didn't add anything (#10408).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* extra_clean argument should be a list
Add an assert to prevent regressions.
* properly clean package conf direcories
They are directories now, which was causing problems.
* properly clean write_interface_* tests
We were getting these errors:
[Errno 21] Is a directory: './driver/write_interface_oneshot'
[Errno 39] Directory not empty: './driver/write_interface_oneshot'
[Errno 21] Is a directory: './driver/write_interface_make'
[Errno 39] Directory not empty: './driver/write_interface_make'
* outputdir() is better than -outputdir, as it knows how to (pre)clean
itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
hs-boot declarations were leaking into the EPS due to
self {-# SOURCE #-} imports, and interface loading induced by
orphan instances. For the former, we simply disallow self
{-# SOURCE #-} imports; for the latter, we simply just don't
load an interface if it would be ourself.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D860
GHC Trac Issues: #10182
|
|
|
|
|
|
|
|
|
| |
By passing -O2, the bug appears depending on the order of clauses in
"solve", hence adding T9938B as the other variant.
Currently, T9938 is marked as broken, but maybe the bug is actually in
T9938B, where something (possibly inlining, as suggested by rwbarton)
affected the requirement to link against transformers.
|
|
|
|
| |
Marked as known_broken
|
|
|
|
|
|
|
| |
I found several tests that failed when the interface file format changed,
due to leftover .hi file droppings.
I'm not sure I've done this right, but it should be a bit better
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Amazingly, the fix for this very old bug is quite simple: when type-checking,
maintain a set of "visible orphan modules" based on the orphans list of
modules which we explicitly imported. When we import an instance and it
is an orphan, we check if it is in the visible modules set, and if not,
ignore it. A little bit of refactoring for when orphan-hood is calculated
happens so that we always know if an instance is an orphan or not.
For GHCi, we preinitialize the visible modules set based on the list of
interactive imports which are active.
Future work: Cache the visible orphan modules set for GHCi, rather than
recomputing it every type-checking round. (But it's tricky what to do when you
/remove/ a module: you need a data structure a little more complicated than
just a set of modules.)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: new tests and validate
Reviewers: simonpj, austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D488
GHC Trac Issues: #2182
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
This reverts commit 05120ecd95b2ebf9b096a95304793cd78be9506e.
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Normally, -fno-code does not generate interface files.
However, if you want to use it to type check over multiple
runs of GHC, you will need the interface files to check
source files further down the dependency chain; -fwrite-interface
does this for you.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: clean validate, and a new test-case
Reviewers: simonpj
Subscribers: simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D27
|
|
|
|
| |
using the same check as for unicode quotes.
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
| |
|
| |
|
| |
|