diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-07-24 15:13:49 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-09-21 11:53:56 -0700 |
commit | 06d46b1e4507e09eb2a7a04998a92610c8dc6277 (patch) | |
tree | 7dc84733d3b6a8313c272c2c8fed4cc0b5d30e90 /testsuite/tests/driver/dynamicToo | |
parent | 09d214dcd8e831c128c684facb7c8da1d63c58bc (diff) | |
download | haskell-06d46b1e4507e09eb2a7a04998a92610c8dc6277.tar.gz |
Unify hsig and hs-boot; add preliminary "hs-boot" merging.
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
Diffstat (limited to 'testsuite/tests/driver/dynamicToo')
-rw-r--r-- | testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hs-boot (renamed from testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig) | 0 | ||||
-rw-r--r-- | testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile | 8 | ||||
-rw-r--r-- | testsuite/tests/driver/dynamicToo/dynamicToo006/A.hs-boot (renamed from testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig) | 0 | ||||
-rw-r--r-- | testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hs-boot index 75d621cfec..75d621cfec 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hs-boot diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile index 617510eec4..a08827a92d 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile @@ -5,11 +5,15 @@ include $(TOP)/mk/test.mk checkExists = [ -f $1 ] || echo $1 missing .PHONY: dynamicToo005 -# Check that "-c -dynamic-too" works with .hsig +# Check that "-c -dynamic-too" works with signatures dynamicToo005: "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ -sig-of A005=base:Prelude \ - -c A005.hsig + -c A005.hs-boot + $(call checkExists,A005.o-boot) + $(call checkExists,A005.hi-boot) + "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ + --merge-requirements A005 $(call checkExists,A005.o) $(call checkExists,A005.hi) $(call checkExists,A005.dyn_o) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hs-boot index f79d5d334f..f79d5d334f 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hs-boot diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile index 497f2c0942..6e025f8322 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile @@ -11,8 +11,10 @@ dynamicToo006: -sig-of A=base:Prelude \ --make B $(call checkExists,A.o) + $(call checkExists,A.o-boot) $(call checkExists,B.o) $(call checkExists,A.hi) + $(call checkExists,A.hi-boot) $(call checkExists,B.hi) $(call checkExists,A.dyn_o) $(call checkExists,B.dyn_o) |