Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Can't find src/ClassMain.hs #9185

Closed
andrewufrank opened this issue Aug 18, 2023 · 3 comments
Closed

error: Can't find src/ClassMain.hs #9185

andrewufrank opened this issue Aug 18, 2023 · 3 comments

Comments

@andrewufrank
Copy link

Describe the bug
I have a (perhaps unusual) configuration with two test suits in the cabal file. The project compiles and runs ok.
Running the two tests (each in a separate test suite) runs with cabal test test1 and cabal test test2 ok.

When I run cabal repl test1 I get the following:

Build profile: -w ghc-9.4.5 -O1
In order, the following will be built (use -v for more details):
 - relocation-0.0.1 (test:test1) (ephemeral targets)
Preprocessing test suite 'test1' for relocation-0.0.1..
GHCi, version 9.4.5: https://www.haskell.org/ghc/  :? for help

<no location info>: error: Can't find src/ClassMain.hs
Failed, no modules loaded.
Loaded GHCi configuration from /home/frank/Workspace11/experiments_SSG_related/relocation/.ghci
[1 of 3] Compiling Main             ( tests/Testing.hs, interpreted )
[2 of 3] Compiling Paths_relocation ( /home/frank/Workspace11/experiments_SSG_related/relocation/dist-newstyle/build/x86_64-linux/ghc-9.4.5/relocation-0.0.1/t/test1/build/test1/autogen/Paths_relocation.hs, interpreted )
Ok, two modules loaded.
ghci> 

and processing goes as usual.

The error message error: Can't find src/ClassMain.hs troubles me (because I have with a similar configuration a more serious problem with error: relocation overflow: which might be related).

The cabal file is

cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.35.3.
--
-- see: https:/sol/hpack

name:           relocation
version:        0.0.1
synopsis:       a new test
description:    test for relocation overflows
license:        BSD2
license-file:   LICENSE
build-type:     Simple

library
  exposed-modules:
      Lib.Top
  other-modules:
      Paths_relocation
  hs-source-dirs:
      src
  ghc-options: -Wall
  build-depends:
      base >=4.7 && <5
  default-language: Haskell2010

executable relocation
  main-is: newtest.hs
  other-modules:
      Paths_relocation
  hs-source-dirs:
      app
  ghc-options: -Wall
  build-depends:
      base >=4.7 && <5
  default-language: Haskell2010

test-suite test1
  type: exitcode-stdio-1.0
  main-is: Testing.hs
  other-modules:
      Paths_relocation
  hs-source-dirs:
      tests
  ghc-options: -Wall
  build-depends:
      base >=4.7 && <5
    , relocation
  default-language: Haskell2010

test-suite test2
  type: exitcode-stdio-1.0
  main-is: Testing2.hs
  other-modules:
      Paths_relocation
  hs-source-dirs:
      tests2
  ghc-options: -Wall
  build-depends:
      base >=4.7 && <5
    , relocation
  default-language: Haskell2010

To Reproduce

$ cabal repl test1

Expected behavior
I expect no error message

cabal run produces expected result.

System information

  • Operating system
  • Linux bhutan 6.1.0-11-amd64 Add support for the Apache license #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux
  • cabal, ghc versions
    The Glorious Glasgow Haskell Compilation System, version 9.4.5
    frank@bhutan:~/Desktop$ cabal --version
    cabal-install version 3.8.1.0
    compiled using version 3.8.1.0 of the Cabal library

Additional context
Add any other context about the problem here.

@fendor
Copy link
Collaborator

fendor commented Aug 18, 2023

Hi!

Where does ClassMain come from? Is that really a module in src/ClassMain.hs? Do you import that somewhere?

@fgaz
Copy link
Member

fgaz commented Aug 18, 2023

Could you share your ~/.ghc/ghci.conf and /home/frank/Workspace11/experiments_SSG_related/relocation/.ghci?

@andrewufrank
Copy link
Author

Thank yo for the hint to look into the .ghci file. I am sorry, I tried to build a minimal example and forgot that I had still an old .ghci file in the directory, which produced the src/ClassMain.hs message. (The relocation error problem vanished as well after some unrelated changes, fortunately). Thank you for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants