Giter Club home page Giter Club logo

Comments (4)

Fuuzetsu avatar Fuuzetsu commented on July 26, 2024

Spent some time on this today. It's a lot more difficult than expected. There seem to be 2 ways to go about this.

  1. Let GHC deal with it. This requires us to run from the "top level" of module hierarchy. Notably we don't seem to be able to do:
ghc src/A.hs src/B.hs

where we have src/A.hs-boot: we'd have to run from src. As far as I understand, this is more or less what cabal does. It sucks but it may be what we'll have to do. Notably doing -isrc does not work: GHC will not pick up A.hs-boot regardless. It will happily grab it from . if it happened to be there though…

  1. Deal with it ourselves as per https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/separate_compilation.html#how-to-compile-mutually-recursive-modules : this would be better because we don't have to do a directory-changing dance while having things be explicit but it requires that we know the module graph which we don't at the moment and might never do.

I'm leaving this ticket for now to give it some thinking space especially as boot files are not that common. I suspect we'll have to go with first way though…

from rules_haskell.

mboes avatar mboes commented on July 26, 2024

Arguably this is a bug upstream. File a ticket?

from rules_haskell.

Fuuzetsu avatar Fuuzetsu commented on July 26, 2024

Trac is down. Will try tomorrow morning.

from rules_haskell.

Fuuzetsu avatar Fuuzetsu commented on July 26, 2024

Upon further experimentation when creating Trac ticket, I discovered that -i does work. The mistake in my testing was using ~ which wasn't being expanded into my $HOME and so it looked like it can't find the module:

src/B.hs:3:1: error:
    Failed to load interface for ‘A’
    Locations searched:
      A.hs
      A.lhs
      A.hsig
      A.lhsig
      ~/src/A.hs
      ~/src/A.lhs
      ~/src/A.hsig
      ~/src/A.lhsig

from rules_haskell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.