[GHC] #10862: No way to exclude current directory from search path

GHC ghc-devs at haskell.org
Wed Sep 16 22:06:39 UTC 2015


#10862: No way to exclude current directory from search path
-------------------------------------+-------------------------------------
        Reporter:  literon           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Driver            |                 Version:  7.8.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by thomie):

 * component:  Compiler => Driver


Comment:

 `-i` does reset the searchpath.
 {{{
 $ ghci -i
 GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
 Prelude> :show paths
 current working directory:
   /tmp/test
 module import search paths: none
 }}}

 But the searchpath isn't consulted for filenames you give as arguments on
 the command line. So if you have the following setup:

 A.hs:
 {{{
 module A where
 import B
 }}}
 B.hs:
 {{{
 module B where
 }}}

 * `ghc A.hs` will work, because the default searchpath is ".", so B.hs can
 be found.
 * `ghc -i A.hs B.hs` will work, because B.hs is given on the command line.
 * `ghc -i A.hs` will fail with `Could not find module ‘B’`.

 That seems to work as expected.

 But you are giving a module name on the command line. Is that relevant? Do
 you think something different should happen when you say `ghc -i Main` vs
 `ghc -i Main.hs`?

 I'm trying to figure out what the bug is. Please help.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10862#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list