google / google/hrepl

Dependencies aren't loaded by default

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
51
Forks
9
PR merge metrics
No merged PRs in 30d

Description

`hrepl` doesn't expose dependencies by default. To load a dependency into the
interpreter, it needs to be either passed explicitly on the command line, or else
exposed with `:set -package ...`. This could be considered "working as intended"
since it's how the actual Bazel build rules work. However, it's not a great user experience:
- The `...` may be a mangled GHC package name
- `:set -package` causes all modules to reload and makes you lose all bindinsg.

The current recommended approach is to use `--package //some:label` which will add the given target as an exposed (compiled) dependency. But in all cases, if you want to expose
a new dependency you effectively need to start a new session.

Google's internal version of hrepl exposes everything, but that has its own tradeoff: Two
modules from different targets could conflict, and distinguishing between them with
`-XPackageImports` is cumbersome due to the mangled package names. Internally, we
modified GHC to be more permissive and allow unmangled labels as package names.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.