Skip to content

Installed packageids #1567

Merged
merged 16 commits into from Oct 30, 2013

4 participants

@dcoutts
Haskell member
dcoutts commented Oct 30, 2013

I think this is now ok to merge.

See previous discussion in #1470

idontgetoutmuch and others added some commits Sep 4, 2013
@idontgetoutmuch idontgetoutmuch Add an explicit way of specifying dependencies on the command line
e.g.,

--dependency="MyOtherLib=MyOtherLib-1.0-073259a42bbf95f818c899c57ba5bf30"

If the package names do not match

--dependency="foo=MyOtherLib-1.0-073259a42bbf95f818c899c57ba5bf30"

then this gives an error

Setup.hs: The following names do match their hash name:
(foo, MyOtherLib)

If the hash is incorrect e.g.

--dependency="foo=MyOtherLib-1.0-073259a42bbf95f818c899c57ba5bf31"

then this gives an error

Setup.hs: The following dependencies do not exist:
MyOtherLib-1.0-073259a42bbf95f818c899c57ba5bf31
caba878
@dcoutts dcoutts Rearange and simplify the --dependency configure code a bit
Use a map from package name rather than from constraint, for the
info on the specific packages to use.
6002f62
@Toxaris Toxaris Capture installed package information.
The goal is to learn the installed package id of the package we just
installed, as necessary for #1860. We achieve this by inserting an
additional call to "setup register" that produces the installed package
information in a file. We read and parse that file and could now return
the installed package id, but it is not clear what interface would be
appropriate.
2b10869
@idontgetoutmuch idontgetoutmuch Create hashes from the solver install plan and pass these to cabal so
that the exact packages are installed rather than letting cabal choose
for itself (potentially choosing the package with the incorrect
hash). Closes: #1460.
5e46978
@dcoutts dcoutts Opinionated tweaking of the previous patch 44a2ced
@idontgetoutmuch idontgetoutmuch Don't use the new flag with old cabals: 9af2f51
@dcoutts dcoutts And don't use the old flag with new cabals
We generate both --constraint and --dependency flags, but we only need
to pass one or the other, depending on the Cabal version.
7e88be5
@dcoutts dcoutts Bump version to 0.19.1
Since we now have a new version-dependent feature: the new --dependency
configure flag.
adb22d7
@23Skidoo
Haskell member

LGTM.

@23Skidoo
Haskell member

LGTM.

@23Skidoo
Haskell member

LGTM.

@dcoutts

Oh, we should fix this to fail with a sensible error. This case would mean that the Setup.hs gave us a bogus package info file. That could easily happen with a Custom Setup.hs, so we ought to have a human comprehensible error.

@23Skidoo

Why not make this fragment a helper function? E.g. maybePkgConf <- maybeRegister ...

@23Skidoo
Haskell member

LGTM with minor comments.

@23Skidoo
Haskell member

LGTM.

@23Skidoo
Haskell member

LGTM.

@23Skidoo
Haskell member

LGTM.

Haskell member

But see my comment about ConfiguredPackage. This could also simplify the type of InstallPlan.ready.

Haskell member

The reason we cannot make it part of ConfiguredPackage is about when that information becomes available.

The InstalledPackageId is not determined up front by cabal-install, but by the Setup.hs when we ask it to register (or to give us the reg info). However by that time the ConfiguredPackage has already been created and used as part of the InstallPlan. The InstallPlan creates lots of these ConfiguredPackages using dependencies on source package ids, implicitly referring to the package instances within the InstallPlan.

@23Skidoo

s/we something/we do something/

@23Skidoo

Instead of passing deps as an argument, shouldn't they be made a part of ConfiguredPackage?

@23Skidoo
Haskell member

LGTM.

@idontgetoutmuch

I had trouble parsing this. What does "finalise function expects constraints" mean?

Haskell member

"finalise function" = "function that performs finalisation"

@23Skidoo
Haskell member

The test suite passes with these patches.

@23Skidoo
Haskell member

Strange, the --dependency option is not being passed to the setup script in my tests (using the external setup method).

@23Skidoo
Haskell member

OK, seems to work now, both with the internal and the external setup method.

@23Skidoo 23Skidoo Small tweaks to 'filterConfigureFlags'.
Make the default case the first one, for readability. Tweak versions a little
bit.
3622d17
@23Skidoo
Haskell member

Everything seems to work, so merging.

@23Skidoo 23Skidoo merged commit 6892a37 into master Oct 30, 2013
@23Skidoo 23Skidoo deleted the installed-packageids branch Oct 30, 2013
@idontgetoutmuch

Tested with both 1.19.1 and 1.16.0 in a sandbox so LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.