commercialhaskell / commercialhaskell/stack

stack ghci/repl with internal sublibraries only works after a build

Open
#4,148 27 comments 0 reactions 1 assignee Claimed by @mihaimaruseac View on GitHub
component: ghci type: bug work-in-progress
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary/comments (optional)

When running `stack ghci` on a fresh clone of a project having internal libraries, the attempt fails with

```
: cannot satisfy -package z-files-z-lib
(use -v for more information)
```

However, if one first `stack build`s then the subsequent `stack ghci` succeeds.

Found while working on #4142 and will probably work on it in the coming weeks.

### Steps to reproduce

1. Go to the test code in `test/integration/tests/3926-ghci-with-sublibraries/files`
2. Run `rm -rf .stack-work` to start from a clean state
3. Run `stack ghci` and see that it fails
4. Run step 2 again
5. Run `stack build` and then `stack ghci` and it succeeds

### Expected

Both step 3 and 5 should succeed.

### Actual

Only step 3 succeeded

### Stack version

```
[files] λ stack --version
Version 1.8.0, Git revision bcbfb1e90d1470ed6b9748b79e1655c52fc65b88 (6034 commits) x86_64 hpack-0.28.2
```

### Method of installation

Git clone

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.