Comments (4)
Spent some time on this today. It's a lot more difficult than expected. There seem to be 2 ways to go about this.
- 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…
- 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.
Arguably this is a bug upstream. File a ticket?
from rules_haskell.
Trac is down. Will try tomorrow morning.
from rules_haskell.
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)
- rts dependency in cc_library no longer works (can't find HsFFI.h) HOT 5
- Refactor Bazel configuration to reduce/eliminate platform-specific flags HOT 3
- `ghc_wrapper` is killed on MacOS arm64 running tests under `rules_haskell_tests` HOT 6
- Prepare release 0.19
- Update BCR presubmit to use `rules_haskell` instead of running the tests in `rules_haskell`
- Upgrade to new rules_nixpkgs release
- Buildifier support on NixOS with bzlmod HOT 1
- Haddock 2.30 faillure in profiling mode
- proto-len protoc plugin failures on windows with ghc 9.6.2 and 9.8.1
- Docker example should work on Darwin
- Dependency Dashboard
- Bazel 7.1.1 and nixpkgs GHC 9.8.2 produce dynamically linked haskell_cabal_binary's
- Avoid creating empty libraries
- [Bazel CI] Unrecognized option incompatible_struct_has_no_methods in bazel command HOT 3
- build on Bazel CI broken HOT 2
- [Bazel CI] library tests are failing with Bazel@HEAD HOT 8
- C-only cabal libraries fail to build with haddock = True HOT 3
- Project created through `start` script doesn't build in nix shell HOT 4
- Support both bzlmod and nix in `start` script
- Using `nix_file_deps` in rules_haskell_toolchains` extension causes error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_haskell.