-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
3 comments
on commit d87b584
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, a few issues here.
Firstly, we're not actually relaxing the constraints from the .cabal file, so the solver (in finalizePackageDescription
) should fail if we give a dep on a package that's not allowed by the constraints in the .cabal file. OTOH, you say it works, but my reading is that it ought to fail, so what am I missing?
Secondly, I think for --exact-configuration
we ought to have a sanity check that all the deps and flags are indeed specified.
I realise that finalizePackageDescription
is rather limiting, but eventually (if I ever get any further with my parser + GenericPackageDescription rewrite) we'll have finalizePackageDescription
split into two: a solver and a function that applies a solution to go from a GenericPackageDescription
to a PackageDescription
. With --exact-configuration
we will be able to skip the solver bit and go straight to a solution, but obviously that relies on the solution being complete. So I think the sanity check is important (cabal-install could get it wrong and specify incomplete info which would be partially covered up by the finalizePackageDescription
filling in the remaining info -- leading to really hard to diagnose bug reports).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed how dependencySatisfiable
works. With --exact-configuration
, it simply looks up the package name in the requiredDepsMap
. Note that it does not do the version range check. This has the added benefit that if the package name is not in requiredDepsMap
(wasn't given via --dependency
), finalizePackageDescription
will fail because the dependency is not satisfiable.
So I think that in the sanity check I need to only look at whether all flags are provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it, thanks.
Ahh, this is an internal dependency. Could probably give that a named local function so it's clearer.