You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment it seems possible to do with verbatim: visibility: public as below, but it seems nasty to have to put these libraries in internal-libraries.
internal-libraries:
foo:
source-dirs: fooverbatim:
visibility: publicdependencies:
- base < 4.14
@Ptival I didn't have the need for this myself, but if having a dependency on a public library doesn't work then this is probably something we want to fix. If you can provide a minimal test case (as I understand it, we would need two packages for this, one that exports the library and one that depends on it), then I'll try to find the time to fix it.
cabal-version: 3.0
-- This file has been generated from package.yaml by hpack version 0.34.1.
--
-- see: https://github.com/sol/hpack
name: my-other-package
version: 0.0.0
build-type: Simple
library
build-depends:
base
, package
default-language: Haskell2010
When it should be:
cabal-version: 3.0
-- This file has been generated from package.yaml by hpack version 0.34.1.
--
-- see: https://github.com/sol/hpack
name: my-other-package
version: 0.0.0
build-type: Simple
library
build-depends:
base
, package
, package:library
default-language: Haskell2010
Without it, my-other-package will not be able to import modules from package:library.
Activity
sol commentedon Apr 30, 2020
@expipiplus1 can you please try #385? Does this work for you?
expipiplus1 commentedon May 3, 2020
@sol, works great, thanks!
Ptival commentedon May 29, 2020
@expipiplus1 have you been able to import the exposed public library though?
When I try putting
package:libraryin a dependency field, hpack outputspackageonly.sol commentedon May 29, 2020
@Ptival I didn't have the need for this myself, but if having a dependency on a public library doesn't work then this is probably something we want to fix. If you can provide a minimal test case (as I understand it, we would need two packages for this, one that exports the library and one that depends on it), then I'll try to find the time to fix it.
expipiplus1 commentedon May 30, 2020
Ptival commentedon May 30, 2020
Yes, it is indeed the other side of the picture.
@sol
In terms of minimal example, if you write a
package.yamllike:The output is:
When it should be:
Without it,
my-other-packagewill not be able to import modules frompackage:library.sol commentedon Jun 2, 2020
For me
results in a parse error. @Ptival what version of
hpackare you using?We want to address this, but for the meantime, this can be used as a workaround:
sol commentedon Jun 2, 2020
Ok, so the current behavior depends on the version of
Cabalthathpackwas built against.Accept subcomponents as dependencies (close #382)
Ptival commentedon Jun 2, 2020
hpack-0.34.1, built with GHC 8.8.2 againstCabal-3.0.0.0.Thanks for the workaround! (it works)
sol commentedon Jun 2, 2020
On Hackage as
hpack-0.34.2. @Ptival you won't need to specifycabal-version: 3.0anymore,hpackshould infer it.Ptival commentedon Jun 2, 2020
Sorry, turns out overriding
hpackin nix is a bit of an adventure!I can confirm that it works, and inserts
cabal-versionproperly.