Skip to content

Fix components in build-type: Custom packages #2257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/load-cabal-plan.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ let
name = pkgs.lib.removePrefix "${prefix}:" n;
value = (if cabal2nixComponents == null then {} else cabal2nixComponents.${collectionName}.${name}) // {
buildable = true;
} // lookupDependencies hsPkgs c.depends c.exe-depends;
} // lookupDependencies hsPkgs (
c.depends
# If plan.json uses a single unit for this package (build-type: Custom),
# then it will leave the package itself out of `c.depends` for the
# components of the package.
# Haskell.nix builds the components separately so we need
# to add the `library` component as a dependency.
++ pkgs.lib.optional (p ? components && p.components ? lib) p.id
) c.exe-depends;
in { inherit name value; }
)) components));
in
Expand Down
4 changes: 4 additions & 0 deletions test/setup-deps/pkg/src/Pkg.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Pkg where

foo :: Int
foo = 1
5 changes: 0 additions & 5 deletions test/setup-deps/pkg/src/conduit-test.hs

This file was deleted.

Loading