[commit: ghc] master: Fix #11256 by not immediately erroring if we can't find a module. (ff3f918)

git at git.haskell.org git at git.haskell.org
Mon Dec 21 21:44:21 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ff3f918d1c9685857d3ba4bb0dc119616e89cbe6/ghc

>---------------------------------------------------------------

commit ff3f918d1c9685857d3ba4bb0dc119616e89cbe6
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Dec 21 20:25:08 2015 +0100

    Fix #11256 by not immediately erroring if we can't find a module.
    
    Test Plan: validate
    
    Reviewers: austin, bgamari, thomie
    
    Reviewed By: bgamari, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1669
    
    GHC Trac Issues: #11256


>---------------------------------------------------------------

ff3f918d1c9685857d3ba4bb0dc119616e89cbe6
 compiler/main/GhcMake.hs                      | 8 +++-----
 testsuite/tests/cabal/cabal07/cabal07.stderr  | 6 +++---
 testsuite/tests/driver/driver063.stderr       | 4 ++--
 testsuite/tests/ghc-e/should_run/T2636.stderr | 4 ++--
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 41d4f1c..843def1 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -1886,13 +1886,11 @@ summariseModule hsc_env old_summary_map is_boot (L loc wanted_mod)
                 | isJust (ml_hs_file location) ->
                         -- Home package
                          just_found location mod
-                | otherwise ->
-                        -- Drop external-pkg
-                        ASSERT(moduleUnitId mod /= thisPackage dflags)
-                        return Nothing
 
-             err -> return $ Just $ Left $ noModError dflags loc wanted_mod err
+             _ -> return Nothing
                         -- Not found
+                        -- (If it is TRULY not found at all, we'll
+                        -- error when we actually try to compile)
 
     just_found location mod = do
                 -- Adjust location to point to the hs-boot source file,
diff --git a/testsuite/tests/cabal/cabal07/cabal07.stderr b/testsuite/tests/cabal/cabal07/cabal07.stderr
index 097f23f..b3cfe5b 100644
--- a/testsuite/tests/cabal/cabal07/cabal07.stderr
+++ b/testsuite/tests/cabal/cabal07/cabal07.stderr
@@ -1,6 +1,6 @@
 
-Q.hs:3:8: error:
-    Could not find module ‘Data.Set’
-    It is a member of the hidden package ‘containers-0.5.6.3 at containers-0.5.6.3’.
+Q.hs:3:1: error:
+    Failed to load interface for ‘Data.Set’
+    It is a member of the hidden package ‘containers-0.5.7.0’.
     Perhaps you need to add ‘containers’ to the build-depends in your .cabal file.
     Use -v to see a list of the files searched for.
diff --git a/testsuite/tests/driver/driver063.stderr b/testsuite/tests/driver/driver063.stderr
index 25488b8..84ff5b6 100644
--- a/testsuite/tests/driver/driver063.stderr
+++ b/testsuite/tests/driver/driver063.stderr
@@ -1,4 +1,4 @@
 
-D063.hs:2:8:
-    Could not find module ‘A063’
+D063.hs:2:1: error:
+    Failed to load interface for ‘A063’
     It is not a module in the current program, or in any known package.
diff --git a/testsuite/tests/ghc-e/should_run/T2636.stderr b/testsuite/tests/ghc-e/should_run/T2636.stderr
index 98c109e..1a79127 100644
--- a/testsuite/tests/ghc-e/should_run/T2636.stderr
+++ b/testsuite/tests/ghc-e/should_run/T2636.stderr
@@ -1,4 +1,4 @@
 
-T2636.hs:1:8:
-    Could not find module ‘MissingModule’
+T2636.hs:1:1: error:
+    Failed to load interface for ‘MissingModule’
     Use -v to see a list of the files searched for.



More information about the ghc-commits mailing list