Fix cabal-install in the presence of extra-packages
commitc671f0e91d72cc51f48f7e5a32c531086b44c7e1
authorRodrigo Mesquita <rodrigo.m.mesquita@gmail.com>
Fri, 16 Feb 2024 14:17:53 +0000 (16 14:17 +0000)
committerMikolaj <281893+Mikolaj@users.noreply.github.com>
Mon, 4 Mar 2024 11:05:07 +0000 (4 11:05 +0000)
tree49b66f899f4c02e5f6c23516783616a1c34e1a35
parent3c06125115c2a86324e9f72f615f381278bb107b
Fix cabal-install in the presence of extra-packages

Extra-packages listed in a cabal project are to be fetched from hackage,
and will be in memory as 'NamedPackages' rather than resolved to
'SpecificSourcePackage'.

On install, we need to make source-dists for all the specific source
packages, and fetch other packages from hackage. Since extra-packages
are already 'NamedPackages', we simply return them along the sdistize-d
specific source packages and the hackage source packages -- they will be
correctly fetched from Hackage from install.

Previously, cabal install <tgt> on a project with extra-packages would
fail because the branch of 'NamedPackage' for 'PackageSpecifier' was
simply unimplemented.

Fixes #8848
cabal-install/src/Distribution/Client/CmdInstall.hs
cabal-testsuite/PackageTests/Install/T8848/Main.hs [new file with mode: 0644]
cabal-testsuite/PackageTests/Install/T8848/cabal.project [new file with mode: 0644]
cabal-testsuite/PackageTests/Install/T8848/cabal.test.hs [new file with mode: 0644]
cabal-testsuite/PackageTests/Install/T8848/t8848.cabal [new file with mode: 0644]