external git dependency source in .cabal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

external git dependency source in .cabal

Fabien R
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
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: external git dependency source in .cabal

Ivan Perez
If you can do this, this is news to me.


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

On Sun, 18 Nov 2018 at 06:54, Fabien R <[hidden email]> wrote:
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
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
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
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: external git dependency source in .cabal

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 <[hidden email]> wrote:
If you can do this, this is news to me.


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

On Sun, 18 Nov 2018 at 06:54, Fabien R <[hidden email]> wrote:
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
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
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
To (un)subscribe, modify options or view archives go to:
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
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: external git dependency source in .cabal

Vanessa McHale
In reply to this post by Fabien R
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


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: external git dependency source in .cabal

Vanessa McHale
In reply to this post by Brandon Allbery

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.

On 11/18/18 9:05 AM, Brandon Allbery wrote:
It doesn't. The source repo is for hackage documentation, not package retrieval.

On Sun, Nov 18, 2018 at 9:57 AM Ivan Perez <[hidden email]> wrote:
If you can do this, this is news to me.


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

On Sun, 18 Nov 2018 at 06:54, Fabien R <[hidden email]> wrote:
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
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
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
To (un)subscribe, modify options or view archives go to:
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
To (un)subscribe, modify options or view archives go to:
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
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: external git dependency source in .cabal

Fabien R
In reply to this post by Vanessa McHale
On 18/11/2018 20:34, Vanessa McHale wrote:
> Here's an example:
>
> 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
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.