Skip to content

Commit 6310945

Browse files
committed
Fix haskell#8719. Local tarballs are not local packages.
1 parent acbc0f3 commit 6310945

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,17 +2135,19 @@ isInLocal :: [PackageVersionConstraint] -> PackageSpecifier (SourcePackage (Pack
21352135
isInLocal _ NamedPackage{} = Nothing
21362136
isInLocal _extraPackages (SpecificSourcePackage pkg) = case srcpkgSource pkg of
21372137
LocalUnpackedPackage _ -> Just (packageId pkg)
2138-
-- LocalTarballPackage is matched here too, because otherwise ‘sdistize’
2139-
-- produces for ‘localPackages’ in the ‘ProjectBaseContext’ a
2140-
-- LocalTarballPackage, and ‘shouldBeLocal’ will make flags like
2141-
-- ‘--disable-library-vanilla’ have no effect for a typical
2138+
-- Things like
21422139
-- ‘cabal install --lib --enable-shared enable-executable-dynamic --disable-library-vanilla’,
2143-
-- as these flags would apply to local packages, but the sdist would
2144-
-- erroneously not get categorized as a local package, so the flags would be
2145-
-- ignored and produce a package with an unchanged hash.
2146-
LocalTarballPackage _ -> Just (packageId pkg)
2147-
-- TODO: the docs say ‘extra-packages’ is implemented in cabal project
2148-
-- files. We can fix that here by checking that the version range matches.
2140+
-- won't work as cabal install installs from sdist tarballs,
2141+
-- and sdist tarballs are not local packages, so the flags won't apply.
2142+
--
2143+
-- And that is not incorrect behavior. Correct behavior would be
2144+
-- to specify exactly which libraries should be compiled how.
2145+
-- (maybe it's possible with `cabal.project`?)
2146+
--
2147+
-- OTOH, if we match on LocalTarballPackage where, then --enable-tests
2148+
-- would force tests there, and that is not what we want to do.
2149+
--
2150+
--LocalTarballPackage _ -> _
21492151
--RemoteTarballPackage _ -> _
21502152
--RepoTarballPackage _ -> _
21512153
--RemoteSourceRepoPackage _ -> _

0 commit comments

Comments
 (0)