Repository navigation
Conversation
3cde6a1 to
efca500
Compare
qrilka
left a comment
There was a problem hiding this comment.
LGTM with some minor comments
| tellExecutables :: PackageName -> PackageSource -> M () | ||
| -- | Update the location of executables (if any) in the pdInstall map. | ||
| tellExecutables :: PackageName -> | ||
| -- | The package source for which the exe locations should (possibly) be updated. |
There was a problem hiding this comment.
Very minor thing: I think normally we use postfix and not prefix haddocks for args i.e. -- ^
It's better to make code more consistent
| mlatestApplicable <- getLatestApplicableVersionAndRev | ||
| return $ Left (depname, (range, mlatestApplicable, DependencyMismatch $ adrVersion adr)) | ||
| case partitionEithers deps of | ||
| _ <- addUnkownToolsWarning package |
There was a problem hiding this comment.
what's the point of _ <- here?
| import Stack.Types.Execute | ||
| import Stack.Types.GhcPkgId | ||
| import Stack.Build.Cache | ||
| import Stack.PackageDump (conduitDumpPackage, ghcPkgDescribe) |
There was a problem hiding this comment.
Stack's code base has different ways of formatting imports in different modules but I think it's better at least not to mix different ways in 1 module
| -- | Dump information for a single package | ||
| -- | Dump information for a single package. | ||
| -- This is essentially a replicate of | ||
| -- <https://downloads.haskell.org/ghc/latest/docs/html/libraries/Cabal-3.2.0.0/Distribution-InstalledPackageInfo.html#t:InstalledPackageInfo the cabal ghc-pkg dump type>. |
There was a problem hiding this comment.
| -- <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#installedpackageinfo-a-package-specification see this>. | ||
| -- Why is this not the full cabal datatype ? | ||
| -- There seems to be no trace of components in this (at the ghc-pkg level at least, the | ||
| -- cabal type has it). |
There was a problem hiding this comment.
I'm not sure if it's possible to use Cabal to get this information and also this type and method of using ghc-pkg was created probably before this type (or at least component-related fields) appeared in Cabal.
| -- Absent in cabal ? Comes from 'PackageConfig' 'packageConfigCabalConfigOpts'. | ||
| ,packageFlags :: !(Map FlagName Bool) | ||
| -- ^ Flags used on package. | ||
| -- Absent in cabal ? |
There was a problem hiding this comment.
How could it be absent? it's just in a different place, see e.g. flagAssignment in https://downloads.haskell.org/ghc/8.10.3/docs/html/libraries/Cabal-3.2.1.0/Distribution-Simple-LocalBuildInfo.html#t:LocalBuildInfo
| -- | ||
| ,packageOpts :: !GetPackageOpts | ||
| -- ^ Args to pass to GHC. | ||
| -- Absent in cabal. |
There was a problem hiding this comment.
I guess for Cabal it's just a different type of a flag, see --ghc-option in https://downloads.haskell.org/ghc/8.10.3/docs/html/libraries/Cabal-3.2.1.0/Distribution-Simple-Flag.html#t:Flag
|
Thanks for the review, I'll try to make the change quickly. |
efca500 to
c450e39
Compare
|
@qrilka sorry for the delay, I've been very busy at work. I've juste updated the PR. |
|
@theobat do you want me to review this one or the one you will open? Is there any particular problem you're stuck with? |
|
I answered in #5504, It's still very messy, but it's in the right direction ! (maybe merging this one will ease the process of reviewing the mess in the other PR...) |
|
Thanks, I'll start with this one then |
qrilka
left a comment
There was a problem hiding this comment.
It's probably a bit annoying but let's fixing the capitalization of Cabal and this could be merged
| -- This is PackageIdentifier pkgName in Cabal. | ||
| ,packageVersion :: !Version | ||
| -- ^ Version of the package. | ||
| -- This is PackageIdentifier pkgVersion in cabal. |
There was a problem hiding this comment.
| -- This is PackageIdentifier pkgVersion in cabal. | |
| -- This is PackageIdentifier pkgVersion in Cabal. |
| -- This is PackageIdentifier pkgVersion in cabal. | ||
| ,packageLicense :: !(Either SPDX.License License) | ||
| -- ^ The license the package was released under. | ||
| -- This is PackageDescription licenseRaw in cabal. |
There was a problem hiding this comment.
| -- This is PackageDescription licenseRaw in cabal. | |
| -- This is PackageDescription licenseRaw in Cabal. |
| deriving (Show, Eq, Ord, Hashable, IsString, Generic, NFData, Data, Typeable) | ||
|
|
||
| -- | Some package info. | ||
| -- A lot of the fields are derived from cabal: |
There was a problem hiding this comment.
| -- A lot of the fields are derived from cabal: | |
| -- A lot of the fields are derived from Cabal: |
| -- ^ Get all files of the package. | ||
| ,packageDeps :: !(Map PackageName DepValue) | ||
| -- ^ Packages that the package depends on, both as libraries and build tools. | ||
| -- Derived from cabal: |
There was a problem hiding this comment.
| -- Derived from cabal: | |
| -- Derived from Cabal: |
| -- Note that this filters out _itself_ and all the non buildables. | ||
| ,packageUnknownTools :: !(Set ExeName) | ||
| -- ^ Build tools specified in the legacy manner (build-tools:) that failed the hard-coded lookup. | ||
| -- Likely derived from cabal see the field just before. |
There was a problem hiding this comment.
| -- Likely derived from cabal see the field just before. | |
| -- Likely derived from Cabal see the field just before. |
| -- | ||
| ,packageBenchmarks :: !(Set Text) | ||
| -- ^ names of benchmarks | ||
| -- Derived from cabal through: |
There was a problem hiding this comment.
| -- Derived from cabal through: | |
| -- Derived from Cabal through: |
| -- | ||
| ,packageExes :: !(Set Text) | ||
| -- ^ names of executables | ||
| -- Derived from cabal through: |
There was a problem hiding this comment.
| -- Derived from cabal through: | |
| -- Derived from Cabal through: |
| -- ^ Args to pass to GHC. | ||
| ,packageHasExposedModules :: !Bool | ||
| -- ^ Does the package have exposed modules? | ||
| -- Derived from cabal's exposed modules list |
There was a problem hiding this comment.
| -- Derived from cabal's exposed modules list | |
| -- Derived from Cabal's exposed modules list |
| -- in the main lib. | ||
| ,packageBuildType :: !BuildType | ||
| -- ^ Package build-type. | ||
| -- This is in cabal in <https://hackage.haskell.org/package/Cabal-3.2.1.0/docs/Distribution-PackageDescription.html#v:buildType buildType> |
There was a problem hiding this comment.
| -- This is in cabal in <https://hackage.haskell.org/package/Cabal-3.2.1.0/docs/Distribution-PackageDescription.html#v:buildType buildType> | |
| -- This is in Cabal in <https://hackage.haskell.org/package/Cabal-3.2.1.0/docs/Distribution-PackageDescription.html#v:buildType buildType> |
| -- ^ If present: custom-setup dependencies | ||
| ,packageCabalSpec :: !VersionRange -- ^ Cabal spec range | ||
| -- ^ If present: custom-setup dependencies | ||
| -- Derived from cabal 'SetupBuildInfo'. |
There was a problem hiding this comment.
| -- Derived from cabal 'SetupBuildInfo'. | |
| -- Derived from Cabal 'SetupBuildInfo'. |
c450e39 to
4965387
Compare
- Rename lpWanted to lpShouldBeBuilt - Move printPlan and displayTask in thee Build.hs file (where Plan and Task are defined) - Isolate the merging of planTasks and planFinals into their own function (and remove mergeWithKeys as it's recommended to not use it in its haddock) defined in Build.hs. - A reorganization of toAction which transforms a task into an action. This was using very redundantly the Task constructor, and the task -> action is likely to change with component builds. - Rename W and M in ConstructPlan to more sensible names. Minor other changes there (changed the misnamed packageDepsWithTools). - Refactor Execute.hs and split the Precompiled/installed stuff into their own module. - Various haddock additions. - Remove PackageDepsOracle (unused) - Split ConstructPlan in 2 modules (the current one and its types) - minor hlint suggestions
4965387 to
f7bd275
Compare
|
done ! |
|
Thanks, I'll merge it when CI will finish its job |
@qrilka Note that I added small things since the pull request on master. Notably there was a non pure packageDepsWithTools accessor to package deps, which was only used once and had nothing to do with the actual accessing of package deps.
I have another pull request almost ready after this one which does some actual rework on Setup.hs, the Package datatype and the sublibrary dependencies.