Skip to content
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

DRAFT #7801 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

DRAFT #7801 #2

wants to merge 1 commit into from

Conversation

cbclemmer
Copy link
Owner

Notes:

Find where the update command retrieves the repo index containing the names and version numbers of all packages

-- cabal-install / src / Distribution / Client / CmdUpdate.hs L111
updateAction :: NixStyleFlags () -> [String] -> GlobalFlags -> IO ()
Takes arguments and flags to update repos

-- cabal-install / src / Distribution / Client / CmdUpdate.hs L176
updateRepo :: Verbosity -> UpdateFlags -> RepoContext -> (Repo, RepoIndexState) -> IO ()
Updates ONE repo

-- cabal-install / src / Distribution / Client / FetchUtils.hs L204
downloadIndex :: HttpTransport -> Verbosity -> RemoteRepo -> FilePath -> IO DownloadResult
Downloads the index file for that repo

-- RepoName.hs L19
newtype RepoName = RepoName { unRepoName :: String }
deriving (Show, Eq, Ord, Generic)

Need to find where the build command extracts the index file downloaded with update

-- cabal-install / src / Distribution / Client / CmdBuild.hs L99
buildAction :: NixStyleFlags BuildFlags -> [String] -> GlobalFlags -> IO ()

-- cabal-install / src / Distribution / Client / ProjectOrchestration.hs L99
runProjectPreBuildPhase :: Verbosity
-> ProjectBaseContext
-> (ElaboratedInstallPlan -> IO (ElaboratedInstallPlan, TargetsMap))
-> IO ProjectBuildContext

-- cabal-install / src / Distribution / Client / ProjectPlanning.hs L396
rebuildInstallPlan :: Verbosity
-> DistDirLayout -> CabalDirLayout
-> ProjectConfig
-> [PackageSpecifier UnresolvedSourcePackage]
-> IO ( ElaboratedInstallPlan -- with store packages
, ElaboratedInstallPlan -- with source packages
, ElaboratedSharedConfig
, IndexUtils.TotalIndexState
, IndexUtils.ActiveRepos
)

-- MISC data
readRepoIndex :: Verbosity -> RepoContext -> Repo -> RepoIndexState
-> IO (PackageIndex UnresolvedSourcePackage, [Dependency], IndexStateInfo)

readPackageIndexCacheFile :: Package pkg => Verbosity
-> (PackageEntry -> pkg)
-> Index
-> RepoIndexState
-> IO (PackageIndex pkg, [Dependency], IndexStateInfo)

data Dependency = Dependency
PackageName
VersionRange
(NonEmptySet LibraryName)
-- ^ The set of libraries required from the package.
-- Only the selected libraries will be built.
-- It does not affect the cabal-install solver yet.
deriving (Generic, Read, Show, Eq, Typeable, Data)

data VersionRange
= ThisVersion Version -- = version
| LaterVersion Version -- > version (NB. not >=)
| OrLaterVersion Version -- >= version
| EarlierVersion Version -- < version
| OrEarlierVersion Version -- <= version
| MajorBoundVersion Version -- @^>= ver@ (same as >= ver && < MAJ(ver)+1)
| UnionVersionRanges VersionRange VersionRange
| IntersectVersionRanges VersionRange VersionRange
deriving ( Data, Eq, Generic, Read, Show, Typeable )

data Version = PV0 {-# UNPACK #-} !Word64
| PV1 !Int [Int]
-- NOTE: If a version fits into the packed Word64
-- representation (i.e. at most four version components
-- which all fall into the [0..0xfffe] range), then PV0
-- MUST be used. This is essential for the 'Eq' instance
-- to work.
deriving (Data,Eq,Generic,Typeable)

-- Test Cases
No repos are given
One repo is given
More than one repo is given

No default repos are specified
One default repo is configured
More than one default repo is configured

Local repos
Remote repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant