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

Mixins: stack build error "Could not load module Relude.String, member of hidden package" #393

Closed
ulidtko opened this issue Dec 10, 2021 · 1 comment
Labels
question Further information is requested

Comments

@ulidtko
Copy link
Contributor

ulidtko commented Dec 10, 2021

Hi @kowainik 🙏

Here I've minified a 4-file reproducer: relude-mixins.zip

On unpacking and stack build inside, this error appears:

foo> configure (lib)
Configuring foo-0.1.0.0...
foo> build (lib)
Preprocessing library for foo-0.1.0.0..
Building library for foo-0.1.0.0..
[1 of 2] Compiling Lib

/tmp/foo/src/Lib.hs:5:1: error:
    Could not load module ‘Relude.String’
    It is a member of the hidden package ‘relude-0.7.0.0’.
    Perhaps you need to add ‘relude’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
5 | import Relude.String
  | ^^^^^^^^^^^^^^^^^^^^

And of course, build-depends in the cabal file contains exactly relude ==0.7.0.0.

Stack Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f. Not sure if commercialhaskell/stack#5077 is related; perhaps it is. The --cabal-verbose commandline looks sane too; could be even bug in Cabal or further below 🤷‍♂️ Reporting to Relude for definiteness.

As a workaround, I'm switching to NoImplicitPrelude + import Relude. That way gives me the Text reexport, without further fiddling with dependencies.

HTH

@chshersh chshersh added the question Further information is requested label Dec 10, 2021
@chshersh
Copy link
Contributor

@ulidtko Yes, that mentioned Stack issue is the reason why stack doesn't work when the mixins approach is used. This is already documented in the README as per the relevant issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants