-
Notifications
You must be signed in to change notification settings - Fork 698
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
Cabal 3: in build-depends, package name gets treated as internal library name ("legacy" syntax) even when using the pkg:lib qualified syntax #6083
Comments
That's the legacy syntax :-/ Internal library names shadow external package names. I was planning to leave it for another .cabal version or so, but I guess we could just disable it now since conflicts like this are likely to happen /cc @hvr |
Btw you may want to add visibility:public to those sublibrary stanzas. The Cabal shipped with ghc 8.8 alpha does not enforce it, but from rc1 onwards it will |
@fgaz what do you consider "legacy" syntax? Shouldn't Likewise, shouldn't I.e. by using the fully qualified syntax we should always be able to refer to an absolute target, regardless of what intra-package sublibs happen to be in scope. Whether |
@hvr is right, I didn't see you used the full qualified syntax (freetype:freetype), which should work. Somehow the package name gets treated as a library name anyway. This is indeed a bug |
We cannot fix this in The + condTreeConstraints = [Dependency
+ (PackageName "freetype")
+ AnyVersion
+ (Set.fromList [LMainLibName])], So latter in the pipeline we cannot know which way it was originally. Reschedulling for 3.2 |
I'm adding this test, so we dont' silently change the behaviour for `cabal-version: 3.0`
Sorry for the spam. Actually I'm scheduling this for 3.4 directly, as the current plan is to not produce |
I'm adding this test, so we dont' silently change the behaviour for `cabal-version: 3.0`
I'm adding this test, so we dont' silently change the behaviour for `cabal-version: 3.0`
Add test for #6083, build-depends: pkg:pkg
I'm adding this test, so we dont' silently change the behaviour for `cabal-version: 3.0`
I think this might be a solution, as interpretation of names happens after the parsing. Then EDIT: |
Also add a test for current behaviour of haskell#6083 And variant with mixin, for haskell#6281 The tests are disable for GHC older than 8.8 Should they work?
Also add a test for current behaviour of haskell#6083 And variant with mixin, for haskell#6281 The tests are disable for GHC older than 8.8 Should they work?
Also add a test for current behaviour of haskell#6083 And variant with mixin, for haskell#6281 The tests are disable for GHC older than 8.8 Should they work?
This is preparation to solve #6083. As such, this shouldn't affect anything yet.
This is preparation to solve haskell#6083. As such, this shouldn't affect anything yet.
Note: configuredPackageProblems is a mess, and there might be bugs now.
Fix #6083: allow depending on public sublibrary with pkg:lib qualified syntax
I had 3 libraries:
I've consolidated the first two into one using public sublibraries. I had to rename the new sublibrary for
fontconfig-freetype
tofcfreetype
to hack it into place.Now I'd like to be able to use the unmangled name, so that users would incur a dependency on
fontconfig:freetype
orfontconfig:{freetype}
, and all that really changes is a character or so in their imports, but I'd be able to maintain a single package on hackage. While users who do not want or needfreetype
can depend onfontconfig:core
and bypass the extras.Done right this sort of thing seems like a path to having many many little fine-grained internal dependencies, so you can incur dependencies on just the functionality you need out of a larger package.
But it seems no matter how I try to refer to the external library
freetype
, I'm getting a cycle detected as if the top levelfontconfig
library which re-exports its own sub-libraryfreetype
s contents is in a cycle with its member.I'm guessing either I have no way to refer to the external
freetype
in the current naming convention, or something is one step too simple in the cycle detector? What is the correct name to use to refer to a library that isn't the one in the current package being built, but rather the name in the top level namespace?See this associated commit to a side-branch for this issue.
The repository should compile with ghc 8.8 and cabal 3. I apologize for not distilling a smaller issue, but basically any example of library name shadowing should do.
This arises for me at least, because I also have about a dozen more of these, each of which would need distinct name mangling conventions.(e.g.
harfbuzz-freetype
,harfbuzz-icu
) and it seems a shame to make the user useharfbuzz:hb-ft
or something rather than remain as clear as the current naming.The text was updated successfully, but these errors were encountered: