Skip to content

Look up sublibraries also with nonexact deps - #8089

Merged
andreabedini merged 4 commits into
haskell:masterfrom
fgaz:fix-7270
May 6, 2022
Merged

andreabedini merged 4 commits into
haskell:masterfrom
fgaz:fix-7270

Conversation

@fgaz

@fgaz fgaz commented Apr 8, 2022 •

Copy link
Copy Markdown
Member

Fixes #7270 🎉
Closes #6801
Closes #7286

  • check that this does not break anything
  • and that there aren't other misuses of lookupDependency
    • maybe deprecate it?
  • remove the experimental warning
  • add a test

Would it be possible/worthwhile to do a 3.6 patch release with this, considering that this is blocking hackage upload for the "multiple public libraries" feature?


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@Mikolaj

Mikolaj commented Apr 8, 2022

Copy link
Copy Markdown
Member

There's no harm in a backport. About the actual release, perhaps let's wait and see if we need a release anyway, e.g., for patches that are necessary in GHC 9.4, and if we are able to pull off 3.8 or rather give up and release 3.6 again.

@fgaz

fgaz commented Apr 14, 2022

Copy link
Copy Markdown
Member Author
/home/runner/.cabal/store/ghc-9.0.2/Cabal-3.6.3.0-5b25874bd4a212829928a04ead2f5bab253ba963aa995de42556b96bb18c9aec/lib/libHSCabal-3.6.3.0-5b25874bd4a212829928a04ead2f5bab253ba963aa995de42556b96bb18c9aec.a(Backpack.o)(.text+0x849c): error: undefined reference to 'base_GHCziRead_list3_info'

this is weird. maybe it's a caching problem?

@fgaz

fgaz commented Apr 15, 2022

Copy link
Copy Markdown
Member Author

Ok, that's definitely a caching problem, since the same pr in my fork succeeds. Travis had a useful "clear cache and rerun" button, but it looks like flushing the cache is impossible in github: actions/cache#2

@jneira

jneira commented Apr 25, 2022

Copy link
Copy Markdown
Member

@Mergifyio rebase master

@mergify

mergify Bot commented Apr 25, 2022

Copy link
Copy Markdown
Contributor

rebase master

✅ Branch has been successfully rebased

@fgaz
fgaz force-pushed the fix-7270 branch 2 times, most recently from e905400 to 0cdca20 Compare May 2, 2022 10:20
fgaz added a commit to fgaz/cabal that referenced this pull request May 2, 2022
@fgaz

fgaz commented May 3, 2022

Copy link
Copy Markdown
Member Author

The test that checks that experimental warnings are deduplicated relies on the warning I just removed... I could just remove that test or I could also remove PWTExperimental, since it isn't used anywhere else

@Mikolaj

Mikolaj commented May 4, 2022

Copy link
Copy Markdown
Member

The test that checks that experimental warnings are deduplicated relies on the warning I just removed... I could just remove that test or I could also remove PWTExperimental, since it isn't used anywhere else

IMHO, go for it.

fgaz added a commit to fgaz/cabal that referenced this pull request May 4, 2022
fgaz added a commit to fgaz/cabal that referenced this pull request May 4, 2022
fgaz added a commit to fgaz/cabal that referenced this pull request May 5, 2022
@fgaz
fgaz marked this pull request as ready for review May 5, 2022 06:59
fgaz added 4 commits May 5, 2022 09:00
When Cabal is passed --exact-configuration, it knows from
--dependency flags the ids of all dependencies, including sublibraries.
When this flag does not exists though, Cabal tries to locate them by
looking them up in the package databases. lookupDependency was used for
this, but it only looks up main (unnamed) libraries (LMainLibName), so
Cabal was failing to locate installed public sublibraries.
Using lookupInternalDependency and passing the library name fixes this.

Fixes haskell#7270
Same for "visibility is experimental feature"
With haskell#7270 fixed, it's time to allow hackage uploads.

PWTExperimental is not used anymore, but for now I'm keeping it in case
we add other experimental features in the future, so we don't keep
removing and adding it (pushing CPP on users).

Since it isn't used though there is no way to run
cabal-testsuite/PackageTests/DuplicateExperimental
so I'm just removing that test.

Closes haskell#6801
@fgaz

fgaz commented May 5, 2022

Copy link
Copy Markdown
Member Author

This is ready for review. I checked other lookupDependency uses and they are mostly fine, I'll leve the deprecation for another pr

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the whole epic bug was not updating a single use of lookupDependency to lookupInternalDependency?

@fgaz

fgaz commented May 5, 2022

Copy link
Copy Markdown
Member Author

Yes 😔

@Kleidukos Kleidukos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix ;)

@andreabedini

Copy link
Copy Markdown
Collaborator

Two approvals in. I am merging this one while everybody sleeps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants