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

Fix issue #3428 #3470

Merged
merged 2 commits into from
May 31, 2016
Merged

Fix issue #3428 #3470

merged 2 commits into from
May 31, 2016

Conversation

dcoutts
Copy link
Contributor

@dcoutts dcoutts commented May 30, 2016

Fix issue #3428, by updating the install plan with the right info

When building packages we update the install plan with the completed packages and for libraries we include the InstalledPackageInfo. We now support packages that register multiple libraries but only one of them is the representative public library, and only that one is stashed in the install plan. Out of the list of library registraions we select the primary one by looking for the one with the expected unit it. As part of collecting the registration info we do some processing (to account for older Cabal and ghc versions) and the mistake was that while did that post-processing ok and registered the right libraries we ended up returing the un-processed registraion info and so then failed to find the primary lib, and thus failed to stash any library info in the install plan, causing internal errors later on.

So the first patch fixes it to return the same post-processed registration info as actually gets registered. Subsequent patches improve the internal error checking for this issue.

This doesn't yet add a regression test. I'll see if I can make a simple one.

dcoutts added 2 commits May 30, 2016 22:33
When building packages we update the install plan with the completed
packages and for libraries we include the InstalledPackageInfo. We
now support packages that register multiple libraries but only one of
them is the representative public library, and only that one is stashed
in the install plan. Out of the list of library registraions we select
the primary one by looking for the one with the expected unit it. As
part of collecting the registration info we do some processing (to
account for older Cabal and ghc versions) and the mistake was that
while did that post-processing ok and registered the right libraries
we ended up returing the un-processed registraion info and so then
failed to find the primary lib, and thus failed to stash any library
info in the install plan, causing internal errors later on.

So this patch fixes it to return the same post-processed registration
info as actually gets registered. Subsequent patches improve the
internal error checking for this issue.
Check that we do get the registration info we expect in a couple places,
and add detail to the error message originally reported in haskell#3428.

Also build the integration tests with assertions on, which might have
caught this error earlier (via the invariant for the install plan).
@23Skidoo
Copy link
Member

LGTM.

@dcoutts dcoutts merged commit d0eb37d into haskell:master May 31, 2016
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.

2 participants