File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ Bug fixes:
1515* For versions of Cabal before 1.24, ensure that the dependencies of
1616 non-buildable components are part of the build plan to work around an old
1717 Cabal bug.
18+ * Run the Cabal file checking in the ` sdist ` command more reliably by
19+ allowing the Cabal library to flatten the
20+ ` GenericPackageDescription ` itself.
1821
1922## v1.6.1
2023
Original file line number Diff line number Diff line change @@ -406,7 +406,20 @@ checkPackageInExtractedTarball pkgDir = do
406406 (gdesc, PackageDescriptionPair pkgDesc _) <- readPackageDescriptionDir config pkgDir False
407407 logInfo $
408408 " Checking package '" <> packageNameText name <> " ' for common mistakes"
409- let pkgChecks = Check. checkPackage gdesc (Just pkgDesc)
409+ let pkgChecks =
410+ -- MSS 2017-12-12: Try out a few different variants of
411+ -- pkgDesc to try and provoke an error or warning. I don't
412+ -- know why, but when using `Just pkgDesc`, it appears that
413+ -- Cabal does not detect that `^>=` is used with
414+ -- `cabal-version: 1.24` or earlier. It seems like pkgDesc
415+ -- (the one we create) does not populate the `buildDepends`
416+ -- field, whereas flattenPackageDescription from Cabal
417+ -- does. In any event, using `Nothing` seems more logical
418+ -- for this check anyway, and the fallback to `Just pkgDesc`
419+ -- is just a crazy sanity check.
420+ case Check. checkPackage gdesc Nothing of
421+ [] -> Check. checkPackage gdesc (Just pkgDesc)
422+ x -> x
410423 fileChecks <- liftIO $ Check. checkPackageFiles pkgDesc (toFilePath pkgDir)
411424 let checks = pkgChecks ++ fileChecks
412425 (errors, warnings) =
You can’t perform that action at this time.
0 commit comments