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

Test suite using code generator fails to compile with cabal v2-repl #8424

Open
RyanGlScott opened this issue Aug 23, 2022 · 0 comments
Open
Labels
cabal-install: cmd/repl re: code-generators Concerning the `code-generators` field/functionality for `testsuite`s type: bug

Comments

@RyanGlScott
Copy link
Member

A test suite that depends on a code generator will successfully build with cabal v2-build, but not with cabal v2-repl.

To Reproduce

  1. Clone https://github.com/RyanGlScott/code-generators-issue, which contains a minimal reproducer for the bug.

  2. Run cabal v2-build code-generators-issue-test and observe that it succeeds:

    $ cabal v2-build code-generators-issue-test
    Build profile: -w ghc-9.2.4 -O1
    In order, the following will be built (use -v for more details):
     - code-generators-issue-0.1 (test:code-generators-issue-test) (additional components to build)
    Preprocessing test suite 'code-generators-issue-test' for code-generators-issue-0.1..
    Building test suite 'code-generators-issue-test' for code-generators-issue-0.1..
    [1 of 2] Compiling GeneratedFile    ( /home/rscott/Documents/Hacking/Haskell/code-generators-issue/dist-newstyle/build/x86_64-linux/ghc-9.2.4/code-generators-issue-0.1/t/code-generators-issue-test/build/code-generators-issue-test/code-generators-issue-test-gen/GeneratedFile.hs, /home/rscott/Documents/Hacking/Haskell/code-generators-issue/dist-newstyle/build/x86_64-linux/ghc-9.2.4/code-generators-issue-0.1/t/code-generators-issue-test/build/code-generators-issue-test/code-generators-issue-test-tmp/GeneratedFile.o )
    Linking /home/rscott/Documents/Hacking/Haskell/code-generators-issue/dist-newstyle/build/x86_64-linux/ghc-9.2.4/code-generators-issue-0.1/t/code-generators-issue-test/build/code-generators-issue-test/code-generators-issue-test ...
    
  3. Run cabal v2-repl code-generators-issue-test and observe that it fails:

    $ cabal v2-repl code-generators-issue-test
    Build profile: -w ghc-9.2.4 -O1
    In order, the following will be built (use -v for more details):
     - code-generators-issue-0.1 (test:code-generators-issue-test) (ephemeral targets)
    Preprocessing test suite 'code-generators-issue-test' for code-generators-issue-0.1..
    GHCi, version 9.2.4: https://www.haskell.org/ghc/  :? for help
    Loaded GHCi configuration from /home/rscott/.ghci
    [1 of 1] Compiling Main             ( test/Test.hs, interpreted )
    
    test/Test.hs:3:1: error:
        Could not find module ‘GeneratedFile’
        Use -v (or `:set -v` in ghci) to see a list of the files searched for.
      |
    3 | import GeneratedFile
      | ^^^^^^^^^^^^^^^^^^^^
    Failed, no modules loaded.
    

Expected behavior
I would expect both to succeed.

System information

  • Ubuntu 20.04 (64-bit)
  • $ ghc --version
    The Glorious Glasgow Haskell Compilation System, version 9.2.4
    
    $ cabal --version
    cabal-install version 3.8.1.0
    compiled using version 3.8.1.0 of the Cabal library
    
@RyanGlScott RyanGlScott added re: code-generators Concerning the `code-generators` field/functionality for `testsuite`s type: bug cabal-install: cmd/repl and removed type: bug re: code-generators Concerning the `code-generators` field/functionality for `testsuite`s labels Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal-install: cmd/repl re: code-generators Concerning the `code-generators` field/functionality for `testsuite`s type: bug
Projects
None yet
Development

No branches or pull requests

1 participant