Skip to content

Commit f5932ce

Browse files
iohk-bors[bot]michaelpj
andauthoredOct 11, 2022
Merge #4522
4522: Fix the workbench shell r=deepfire a=michaelpj Using `cabalWrapped` also requires us to mess with `haskell.nix`'s choices for what packages to prepare the shell for. Co-authored-by: Michael Peyton Jones <[email protected]>
2 parents a0b0003 + 8917365 commit f5932ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎nix/workbench/shell.nix

+9
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ in project.shellFor {
7878

7979
inherit withHoogle;
8080

81+
# The workbench shell uses cabalWrapped, which removes the `source-repository-package` stanzas
82+
# from `cabal.project`. The idea is to use prebuilt ones provided by haskell.nix. However,
83+
# haskell.nix is clever enough to not include `source-repository-package`s in the shell
84+
# package db, because it knows that cabal will rebuild them. So you just end up with nothing!
85+
# We can work around this by overriding haskell.nix's selection of which packages the shell
86+
# is prepared for, so that it *doesn't* include the `source-repository-package` ones
87+
# (the default is *local* packages which includes them, we select *project* pacakges which doesn't)
88+
packages = ps: builtins.attrValues (haskellLib.selectProjectPackages ps);
89+
8190
tools = {
8291
haskell-language-server = {
8392
version = "latest";

0 commit comments

Comments
 (0)