Skip to content

Commit

Permalink
Satisfy build and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-romes committed Feb 26, 2024
1 parent 6c19b98 commit 493cdd4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module UnitTests.Distribution.PackageDescription.Check (tests) where

import Distribution.Compat.Prelude.Internal
import Distribution.Compat.Prelude
import Prelude ()

import Distribution.PackageDescription.Check
Expand Down
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ computeLocalBuildConfig cfg comp programDb = do

data PackageInfo = PackageInfo
{ internalPackageSet :: Set LibraryName
, promisedDepsSet :: Map (PackageName, ComponentName) ComponentId
, promisedDepsSet :: Map (PackageName, ComponentName, Maybe PrivateAlias) ComponentId
, installedPackageSet :: InstalledPackageIndex
, requiredDepsMap :: Map (PackageName, ComponentName) InstalledPackageInfo
, requiredDepsMap :: Map (PackageName, ComponentName, Maybe PrivateAlias) InstalledPackageInfo
}

configurePackage
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Types/LocalBuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pattern LocalBuildInfo
-> Maybe FilePath
-> Graph ComponentLocalBuildInfo
-> Map ComponentName [ComponentLocalBuildInfo]
-> Map (PackageName, ComponentName) ComponentId
-> Map (PackageName, ComponentName, Maybe PrivateAlias) ComponentId
-> InstalledPackageIndex
-> PackageDescription
-> ProgramDb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ instance IsNode NonSetupLibDepSolverPlanPackage where
nodeKey spkg

nodeNeighbors (NonSetupLibDepSolverPlanPackage spkg) =
ordNub $ (map fst $ CD.nonSetupDeps (resolverPackageLibDeps spkg))
ordNub $ map fst (CD.nonSetupDeps (resolverPackageLibDeps spkg))

-- | Work out which version of the Cabal we will be using to talk to the
-- Setup.hs interface for this package.
Expand Down
11 changes: 5 additions & 6 deletions cabal-install/tests/UnitTests/Distribution/Client/ScriptUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ testScriptPath (ShortPath p) = withMaxSuccess 10000 $ ioProperty $ do
hashed_path <- getScriptCacheDirectory p
script_build_dir <- defaultScriptBuildsDir
return $
and
-- 1. Is it a valid path at all
[ isValid hashed_path
, -- 2. Is the computed hashed path in the expected directory?
(script_build_dir </> takeFileName hashed_path) `equalFilePath` hashed_path
]
-- 1. Is it a valid path at all
isValid hashed_path
&&
-- 2. Is the computed hashed path in the expected directory?
(script_build_dir </> takeFileName hashed_path) `equalFilePath` hashed_path
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ revertA2 L2.B = L.B

hooks_show :: L.A -> HooksM String
hooks_show a = do
ver <- hooksVersion <$> ask
ver <- asks hooksVersion
case ver of
V01 -> readHooksExe "show" (convertA1 a)
V02 -> readHooksExe "show" (convertA2 a)

hooks_inc :: L.A -> HooksM L.A
hooks_inc a = do
ver <- hooksVersion <$> ask
ver <- asks hooksVersion
case ver of
V01 -> revertA1 <$> (readHooksExe "inc" (convertA1 a))
V02 -> revertA2 <$> (readHooksExe "inc" (convertA2 a))
Expand All @@ -88,7 +88,7 @@ hooks_inc a = do

readHooksExe :: (Binary a, Binary b) => String -> a -> HooksM b
readHooksExe hook args = do
exe <- hooksExe <$> ask
exe <- asks hooksExe
liftIO $ readHooksExe_ exe hook args

withForkWait :: IO () -> (IO () -> IO a) -> IO a
Expand Down
2 changes: 1 addition & 1 deletion cabal-testsuite/src/Test/Cabal/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ findDependencyInStore :: String -- ^package name prefix
findDependencyInStore pkgName = do
storeDir <- testStoreDir <$> getTestEnv
liftIO $ do
storeDirForGhcVersion <- head <$> listDirectory storeDir
(storeDirForGhcVersion:_) <- listDirectory storeDir
packageDirs <- listDirectory (storeDir </> storeDirForGhcVersion)
-- Ideally, we should call 'hashedInstalledPackageId' from 'Distribution.Client.PackageHash'.
-- But 'PackageHashInputs', especially 'PackageHashConfigInputs', is too hard to construct.
Expand Down

0 comments on commit 493cdd4

Please sign in to comment.