Discussion:
[Haskell-cafe] external git dependency source in .cabal
Fabien R
2018-11-18 11:53:50 UTC
Permalink
Hello,
I'm trying to reference an external source of a package within a sandbox, using cabal 2.0.0.1:

source-repository head
type: git
location: <git URL of pack1>

executable myExe
build-depends: base==4.10.1.0, pack1 -any

But "cabal -v install --only-dependencies" fails:

cabal: Encountered missing dependencies:
pack1 -any

Any hint ?

--
Fabien
Ivan Perez
2018-11-18 14:56:43 UTC
Permalink
If you can do this, this is news to me.

See: https://www.haskell.org/cabal/users-guide/developing-packages.html

From what I understand, you cannot use this to point to repos for
dependencies, only to indicate the repo for the package you are defining.

You'd have to publish pack1 somewhere (on hackage or in your own hackage
server), or use a different tool to declare the dependency. I don't know if
cabal's new-build system addresses this at all.

Ivan
Post by Fabien R
Hello,
I'm trying to reference an external source of a package within a sandbox,
source-repository head
type: git
location: <git URL of pack1>
executable myExe
build-depends: base==4.10.1.0, pack1 -any
pack1 -any
Any hint ?
--
Fabien
_______________________________________________
Haskell-Cafe mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Brandon Allbery
2018-11-18 15:05:39 UTC
Permalink
It doesn't. The source repo is for hackage documentation, not package
retrieval.
Post by Ivan Perez
If you can do this, this is news to me.
See: https://www.haskell.org/cabal/users-guide/developing-packages.html
From what I understand, you cannot use this to point to repos for
dependencies, only to indicate the repo for the package you are defining.
You'd have to publish pack1 somewhere (on hackage or in your own hackage
server), or use a different tool to declare the dependency. I don't know if
cabal's new-build system addresses this at all.
Ivan
Post by Fabien R
Hello,
I'm trying to reference an external source of a package within a sandbox,
source-repository head
type: git
location: <git URL of pack1>
executable myExe
build-depends: base==4.10.1.0, pack1 -any
pack1 -any
Any hint ?
--
Fabien
_______________________________________________
Haskell-Cafe mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
***@gmail.com
Vanessa McHale
2018-11-18 19:45:52 UTC
Permalink
In your .cabal file, yes, but the cabal.project file can reference
external packages. It has a slightly different syntax, though.

I don't think it's supported with cabal-install 2.0.0.1. You may have to
use HEAD instead of 2.4.0.0, I don't know.
Post by Brandon Allbery
It doesn't. The source repo is for hackage documentation, not package
retrieval.
On Sun, Nov 18, 2018 at 9:57 AM Ivan Perez
If you can do this, this is news to me.
https://www.haskell.org/cabal/users-guide/developing-packages.html
From what I understand, you cannot use this to point to repos for
dependencies, only to indicate the repo for the package you are defining.
You'd have to publish pack1 somewhere (on hackage or in your own
hackage server), or use a different tool to declare the
dependency. I don't know if cabal's new-build system addresses
this at all.
Ivan
Hello,
I'm trying to reference an external source of a package within
source-repository head
   type: git
   location: <git URL of pack1>
executable myExe
    build-depends: base==4.10.1.0, pack1 -any
pack1 -any
Any hint ?
--
Fabien
_______________________________________________
Haskell-Cafe mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
_______________________________________________
Haskell-Cafe mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Vanessa McHale
2018-11-18 19:34:53 UTC
Permalink
Here's an example:

source-repository-package
    type: git
    location: https://github.com/well-typed/cborg
    tag: 3d274c14ca3077c3a081ba7ad57c5182da65c8c1
    subdir: cborg

Maybe you forgot to specify a subdirectory?

Cheers,
Vanessa McHale
Fabien R
2018-11-19 10:48:12 UTC
Permalink
Post by Vanessa McHale
source-repository-package
    type: git
    location: https://github.com/well-typed/cborg
    tag: 3d274c14ca3077c3a081ba7ad57c5182da65c8c1
    subdir: cborg
I could not make it work with my version of cabal.
So, I ended up with installing the package and referencing it in the sandbox with:
cabal sandbox add-source <path-to-pack1>

--
Fabien

Loading...