Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#1125 closed bug (invalid)

"module main:Foo is not loaded" when trying to load a module from a user package in ghci

Reported by: igloo Owned by:
Priority: normal Milestone: 6.6.1
Component: Compiler Version: 6.6
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

When installing a cabal package as a user, loading a module from the package in ghci fails; it looks like it's got the package wrong.

$ ghc --make Setup
[...]
$ ./Setup configure --prefix=/tmp/foo
[...]
$ ./Setup build
[...]
$ ./Setup install --user
[...]
$ ghci
[...]
Prelude> :m + Foo
module main:Foo is not loaded

Attachments (3)

Foo.hs (36 bytes) - added by igloo 7 years ago.
Setup.hs (49 bytes) - added by igloo 7 years ago.
foo.cabal (65 bytes) - added by igloo 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by igloo

Changed 7 years ago by igloo

Changed 7 years ago by igloo

comment:1 Changed 7 years ago by simonmar

  • Resolution set to invalid
  • Status changed from new to closed

This isn't a bug. It works like this:

  • You have built and installed a package "p", containing module Foo.
  • You start up GHCi and ask it to add module Foo to the context, you expect to get p:Foo.
  • GHCi finds the file Foo.hs in the current directory. It assumes that this contains module Foo from the main package: main:Foo. Modules from the main package take precedence over package modules for the purposes of import and :module.
  • Since you haven't loaded main:Foo in your current GHCi session, GHCi emits an error to that effect.

comment:2 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:3 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.