Quantcast

Using a private git repository with Stack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using a private git repository with Stack

Damian Nadales
Hi,

I guess is a situation encountered quite often in practice. However
I'm not sure what is the right way of using a private repository in
stack as the source of Haskell packages. This is how far I've come:
    http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack

Which approach do you use?

Thanks in advance!
Damian.

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Erik de Castro Lopo-34
Damian Nadales wrote:

> Which approach do you use?

At Ambiata, we use our own (Open Source) cabal wrapper called mafia:

     https://github.com/ambiata/mafia

which does Nix style binary package management as well as handling git
repos as submodules.

I also use it for some of my own stuff and I know of other people not employed
by Ambiata who also use it.

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Damian Nadales
Thanks for the reply Erik.

> At Ambiata, we use our own (Open Source) cabal wrapper called mafia:
>
>      https://github.com/ambiata/mafia
>
> which does Nix style binary package management as well as handling git
> repos as submodules.
>
Does this complement with Stack, or is it an alternative to it?

> I also use it for some of my own stuff and I know of other people not employed
> by Ambiata who also use it.
>
> Erik
> --
> ----------------------------------------------------------------------
> Erik de Castro Lopo
> http://www.mega-nerd.com/
>
> --
>
>
>
>
>

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Erik de Castro Lopo-34
Damian Nadales wrote:

> Does this complement with Stack, or is it an alternative to it?

Its an alternative to Stack.

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Christopher Allen
In reply to this post by Damian Nadales
I use Stack with private git repos. If your git configuration is
correct (I never do anything manual, it's just ssh keypairs) then it
should work out of the box.

On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
<[hidden email]> wrote:

> Hi,
>
> I guess is a situation encountered quite often in practice. However
> I'm not sure what is the right way of using a private repository in
> stack as the source of Haskell packages. This is how far I've come:
>     http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>
> Which approach do you use?
>
> Thanks in advance!
> Damian.
>
> --
>
>
>
>
>



--
Chris Allen
Currently working on http://haskellbook.com

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Damian Nadales


On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
I use Stack with private git repos. If your git configuration is
correct (I never do anything manual, it's just ssh keypairs) then it
should work out of the box.
It does. I did a small experiment and it works perfectly. The only thing I don't like is that I need to specify the commit in my stack.yml:

This means that updating the package requires updating the commit id at the stack file. 

I don't know if you refer to this approach. 


On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
<[hidden email]> wrote:
> Hi,
>
> I guess is a situation encountered quite often in practice. However
> I'm not sure what is the right way of using a private repository in
> stack as the source of Haskell packages. This is how far I've come:
>     http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>
> Which approach do you use?
>
> Thanks in advance!
> Damian.
>
> --
> > >
>
>


--
Chris Allen
Currently working on http://haskellbook.com

--

--
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Christopher Allen
That's absolutely what we want and is representative of the point of
Stack: deterministic, reproducible builds.

Anything that should have changes tracked collectively (if B uses A,
and B should always use the latest version of A), then it implies it
should be part of a monorepo. Which is what we do for those
components.

Here's a snippet from our stack.yaml:

resolver: lts-6.8
packages:
- hestia/
- thoth/
- friendlyId/
- rosetta/
- location:
    git: https://github.com/mwotton/mandrill
    commit: fd22b874feb76fbb76911b6049b4a89f181857d8
    extra-dep: true

Here mandrill is a fork of a repo. We don't want to this to change
unless we explicitly upgrade.

hestia, thoth, friendlyId, and rosetta are all part of the same repo
because they "belong together."

Does that help?

On Fri, Jan 6, 2017 at 1:55 AM, Damian Nadales <[hidden email]> wrote:

>
>
> On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
>
> I use Stack with private git repos. If your git configuration is
> correct (I never do anything manual, it's just ssh keypairs) then it
> should work out of the box.
>
> It does. I did a small experiment and it works perfectly. The only thing I
> don't like is that I need to specify the commit in my stack.yml:
>
> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>
> This means that updating the package requires updating the commit id at the
> stack file.
>
> I don't know if you refer to this approach.
>
>
> On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
> <[hidden email]> wrote:
>> Hi,
>>
>> I guess is a situation encountered quite often in practice. However
>> I'm not sure what is the right way of using a private repository in
>> stack as the source of Haskell packages. This is how far I've come:
>>
>> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>>
>> Which approach do you use?
>>
>> Thanks in advance!
>> Damian.
>>
>> --
>>
>> "Commercial Haskell" group.
>>
>> email to [hidden email].
>>
>>
>> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXedTsWdQX0U8onuO%2BqMEkc2OBOzw%2BZ5Mo_S_ek2-HuvtJg%40mail.gmail.com.
>>
>
>
>
> --
> Chris Allen
> Currently working on http://haskellbook.com
>
> --
>
> "Commercial Haskell" group.
>
> email to [hidden email].
>
>
> https://groups.google.com/d/msgid/commercialhaskell/CADnndOq_jgdDo8vh3O1_kj%2BU_j68ZxfgJfVOSsVYbmWNvFEboQ%40mail.gmail.com.
>
>
>
> --
>
> "Commercial Haskell" group.
>
> email to [hidden email].
>
>
> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXecHkFpHhWpD2157%3Df_Hju4RtZBEE9pjoNgL9dZx88C1wQ%40mail.gmail.com.
>
>



--
Chris Allen
Currently working on http://haskellbook.com

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Erik Hesselink-2
Another option that falls in between a monorepo and a git dependency is using git submodules. We did this for forks and open sourced libraries. You still need to point to a commit hash (since that's how submodules work) but as mentioned that's a good idea anyway. We then listed those submodule packages as 'extra-dep: true' to not have them treated as part of our own sources.

The stack.yaml would look something like this:

packages:
- local-package-1/
- local-package-2/
- location: forks/submodule-for-fork/
  extra-dep: true

Erik

P.S. Resending with a different 'from' address since it bounced, Christopher/Damian, sorry for the spam.

On 6 January 2017 at 09:11, Christopher Allen <[hidden email]> wrote:
That's absolutely what we want and is representative of the point of
Stack: deterministic, reproducible builds.

Anything that should have changes tracked collectively (if B uses A,
and B should always use the latest version of A), then it implies it
should be part of a monorepo. Which is what we do for those
components.

Here's a snippet from our stack.yaml:

resolver: lts-6.8
packages:
- hestia/
- thoth/
- friendlyId/
- rosetta/
- location:
    git: https://github.com/mwotton/mandrill
    commit: fd22b874feb76fbb76911b6049b4a89f181857d8
    extra-dep: true

Here mandrill is a fork of a repo. We don't want to this to change
unless we explicitly upgrade.

hestia, thoth, friendlyId, and rosetta are all part of the same repo
because they "belong together."

Does that help?

On Fri, Jan 6, 2017 at 1:55 AM, Damian Nadales <[hidden email]> wrote:
>
>
> On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
>
> I use Stack with private git repos. If your git configuration is
> correct (I never do anything manual, it's just ssh keypairs) then it
> should work out of the box.
>
> It does. I did a small experiment and it works perfectly. The only thing I
> don't like is that I need to specify the commit in my stack.yml:
>
> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>
> This means that updating the package requires updating the commit id at the
> stack file.
>
> I don't know if you refer to this approach.
>
>
> On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
> <[hidden email]> wrote:
>> Hi,
>>
>> I guess is a situation encountered quite often in practice. However
>> I'm not sure what is the right way of using a private repository in
>> stack as the source of Haskell packages. This is how far I've come:
>>
>> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>>
>> Which approach do you use?
>>
>> Thanks in advance!
>> Damian.
>>
>> --
>> >> "Commercial Haskell" group.
>> >> email to [hidden email].
>> >> >> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXedTsWdQX0U8onuO%2BqMEkc2OBOzw%2BZ5Mo_S_ek2-HuvtJg%40mail.gmail.com.
>> >
>
>
> --
> Chris Allen
> Currently working on http://haskellbook.com
>
> --
> > "Commercial Haskell" group.
> > email to [hidden email].
> > > https://groups.google.com/d/msgid/commercialhaskell/CADnndOq_jgdDo8vh3O1_kj%2BU_j68ZxfgJfVOSsVYbmWNvFEboQ%40mail.gmail.com.
> >
>
> --
> > "Commercial Haskell" group.
> > email to [hidden email].
> > > https://groups.google.com/d/msgid/commercialhaskell/CAM7nXecHkFpHhWpD2157%3Df_Hju4RtZBEE9pjoNgL9dZx88C1wQ%40mail.gmail.com.
>
>


--
Chris Allen
Currently working on http://haskellbook.com

--

--
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Noon Silk
In reply to this post by Damian Nadales
This means that updating the package requires updating the commit 
> id at the stack file. 

Note that you can just set the `commit` to be `master`, if you'd like (from your SO question):

packages:
- '.'
- location:
    git: ssh://git@urlprivate-git-repo.com:7999/project/subproject.git
    commit: master
  subdirs:
  - subdir-of-the-private-package
  extra-dep: true

--
Noon



On Fri, Jan 6, 2017 at 6:55 PM, Damian Nadales <[hidden email]> wrote:


On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
I use Stack with private git repos. If your git configuration is
correct (I never do anything manual, it's just ssh keypairs) then it
should work out of the box.
It does. I did a small experiment and it works perfectly. The only thing I don't like is that I need to specify the commit in my stack.yml:

This means that updating the package requires updating the commit id at the stack file. 

I don't know if you refer to this approach. 


On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
<[hidden email]> wrote:
> Hi,
>
> I guess is a situation encountered quite often in practice. However
> I'm not sure what is the right way of using a private repository in
> stack as the source of Haskell packages. This is how far I've come:
>     http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>
> Which approach do you use?
>
> Thanks in advance!
> Damian.
>
> --
> > >
>
>


--
Chris Allen
Currently working on http://haskellbook.com

--

--



--
Noon Silk, ن

https://silky.github.io/

"Every morning when I wake up, I experience an exquisite joy — the joy
of being this signature."

--
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Damian Nadales
> Note that you can just set the `commit` to be `master`, if you'd like (from
> your SO question):
>
Oh, nice one. I overlooked that! Thanks.

> packages:
> - '.'
> - location:
>     git: ssh://[hidden email]:7999/project/subproject.git
>     commit: master
>   subdirs:
>   - subdir-of-the-private-package
>   extra-dep: true
>
>
> --
> Noon
>
>
>
> On Fri, Jan 6, 2017 at 6:55 PM, Damian Nadales <[hidden email]>
> wrote:
>>
>>
>>
>> On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
>>
>> I use Stack with private git repos. If your git configuration is
>> correct (I never do anything manual, it's just ssh keypairs) then it
>> should work out of the box.
>>
>> It does. I did a small experiment and it works perfectly. The only thing I
>> don't like is that I need to specify the commit in my stack.yml:
>>
>> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>>
>> This means that updating the package requires updating the commit id at
>> the stack file.
>>
>> I don't know if you refer to this approach.
>>
>>
>> On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
>> <[hidden email]> wrote:
>> > Hi,
>> >
>> > I guess is a situation encountered quite often in practice. However
>> > I'm not sure what is the right way of using a private repository in
>> > stack as the source of Haskell packages. This is how far I've come:
>> >
>> > http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>> >
>> > Which approach do you use?
>> >
>> > Thanks in advance!
>> > Damian.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Commercial Haskell" group.
>> >
>> > an email to [hidden email].
>> >
>> >
>> > https://groups.google.com/d/msgid/commercialhaskell/CAM7nXedTsWdQX0U8onuO%2BqMEkc2OBOzw%2BZ5Mo_S_ek2-HuvtJg%40mail.gmail.com.
>> >
>>
>>
>>
>> --
>> Chris Allen
>> Currently working on http://haskellbook.com
>>
>> --
>>
>> "Commercial Haskell" group.
>>
>> email to [hidden email].
>>
>>
>> https://groups.google.com/d/msgid/commercialhaskell/CADnndOq_jgdDo8vh3O1_kj%2BU_j68ZxfgJfVOSsVYbmWNvFEboQ%40mail.gmail.com.
>>
>>
>>
>> --
>>
>> "Commercial Haskell" group.
>>
>> email to [hidden email].
>>
>>
>> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXecHkFpHhWpD2157%3Df_Hju4RtZBEE9pjoNgL9dZx88C1wQ%40mail.gmail.com.
>>
>>
>
>
>
>
> --
> Noon Silk, ن
>
> https://silky.github.io/
>
> "Every morning when I wake up, I experience an exquisite joy — the joy
> of being this signature."
>
> --
>
> "Commercial Haskell" group.
>
> email to [hidden email].
>
>
> https://groups.google.com/d/msgid/commercialhaskell/CADt_azaiwj49jdWbtbXYmqhrLEiiz9Fes-9zeTGLb1V4zjMpuQ%40mail.gmail.com.
>
>

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Damian Nadales
In reply to this post by Christopher Allen
> Anything that should have changes tracked collectively (if B uses A,
> and B should always use the latest version of A), then it implies it
> should be part of a monorepo. Which is what we do for those
> components.
>
> Here's a snippet from our stack.yaml:
>
> resolver: lts-6.8
> packages:
> - hestia/
> - thoth/
> - friendlyId/
> - rosetta/
> - location:
>     git: https://github.com/mwotton/mandrill
>     commit: fd22b874feb76fbb76911b6049b4a89f181857d8
>     extra-dep: true
>
> Here mandrill is a fork of a repo. We don't want to this to change
> unless we explicitly upgrade.
>
> hestia, thoth, friendlyId, and rosetta are all part of the same repo
> because they "belong together."
>
> Does that help?
>
It does. For now I'm just experimenting a bit, preparing the ground in
case the opportunity pops up to implement a micro-service in Haskell.

You said that hestia, thoth, friendlyId, and rosetta belong together.
But what if you needed to use these libraries in some other repo.
Would you go for the git-submodules approach?

> On Fri, Jan 6, 2017 at 1:55 AM, Damian Nadales <[hidden email]> wrote:
>>
>>
>> On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
>>
>> I use Stack with private git repos. If your git configuration is
>> correct (I never do anything manual, it's just ssh keypairs) then it
>> should work out of the box.
>>
>> It does. I did a small experiment and it works perfectly. The only thing I
>> don't like is that I need to specify the commit in my stack.yml:
>>
>> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>>
>> This means that updating the package requires updating the commit id at the
>> stack file.
>>
>> I don't know if you refer to this approach.
>>
>>
>> On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
>> <[hidden email]> wrote:
>>> Hi,
>>>
>>> I guess is a situation encountered quite often in practice. However
>>> I'm not sure what is the right way of using a private repository in
>>> stack as the source of Haskell packages. This is how far I've come:
>>>
>>> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>>>
>>> Which approach do you use?
>>>
>>> Thanks in advance!
>>> Damian.
>>>
>>> --
>>>
>>> "Commercial Haskell" group.
>>>
>>> email to [hidden email].
>>>
>>>
>>> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXedTsWdQX0U8onuO%2BqMEkc2OBOzw%2BZ5Mo_S_ek2-HuvtJg%40mail.gmail.com.
>>>
>>
>>
>>
>> --
>> Chris Allen
>> Currently working on http://haskellbook.com
>>
>> --
>>
>> "Commercial Haskell" group.
>>
>> email to [hidden email].
>>
>>
>> https://groups.google.com/d/msgid/commercialhaskell/CADnndOq_jgdDo8vh3O1_kj%2BU_j68ZxfgJfVOSsVYbmWNvFEboQ%40mail.gmail.com.
>>
>>
>>
>> --
>>
>> "Commercial Haskell" group.
>>
>> email to [hidden email].
>>
>>
>> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXecHkFpHhWpD2157%3Df_Hju4RtZBEE9pjoNgL9dZx88C1wQ%40mail.gmail.com.
>>
>>
>
>
>
> --
> Chris Allen
> Currently working on http://haskellbook.com
>
> --
>
>
>
>
>

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Damian Nadales
In reply to this post by Christopher Allen
On Fri, Jan 6, 2017 at 11:59 AM, Erik Hesselink <[hidden email]> wrote:
> Another option that falls in between a monorepo and a git dependency is
> using git submodules. We did this for forks and open sourced libraries. You
> still need to point to a commit hash (since that's how submodules work) but
> as mentioned that's a good idea anyway. We then listed those submodule
> packages as 'extra-dep: true' to not have them treated as part of our own
> sources.
>
That also looks like a simple solution. How does this approach works
for you in practice? I've heard people advising against the use of
git-submodules (we don't use them currently).

> The stack.yaml would look something like this:
>
> packages:
> - local-package-1/
> - local-package-2/
> - location: forks/submodule-for-fork/
>   extra-dep: true
>
> Erik
>
> Erik
>
>
> On 6 January 2017 at 09:11, Christopher Allen <[hidden email]> wrote:
>>
>> That's absolutely what we want and is representative of the point of
>> Stack: deterministic, reproducible builds.
>>
>> Anything that should have changes tracked collectively (if B uses A,
>> and B should always use the latest version of A), then it implies it
>> should be part of a monorepo. Which is what we do for those
>> components.
>>
>> Here's a snippet from our stack.yaml:
>>
>> resolver: lts-6.8
>> packages:
>> - hestia/
>> - thoth/
>> - friendlyId/
>> - rosetta/
>> - location:
>>     git: https://github.com/mwotton/mandrill
>>     commit: fd22b874feb76fbb76911b6049b4a89f181857d8
>>     extra-dep: true
>>
>> Here mandrill is a fork of a repo. We don't want to this to change
>> unless we explicitly upgrade.
>>
>> hestia, thoth, friendlyId, and rosetta are all part of the same repo
>> because they "belong together."
>>
>> Does that help?
>>
>> On Fri, Jan 6, 2017 at 1:55 AM, Damian Nadales <[hidden email]>
>> wrote:
>> >
>> >
>> > On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
>> >
>> > I use Stack with private git repos. If your git configuration is
>> > correct (I never do anything manual, it's just ssh keypairs) then it
>> > should work out of the box.
>> >
>> > It does. I did a small experiment and it works perfectly. The only thing
>> > I
>> > don't like is that I need to specify the commit in my stack.yml:
>> >
>> >
>> > http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>> >
>> > This means that updating the package requires updating the commit id at
>> > the
>> > stack file.
>> >
>> > I don't know if you refer to this approach.
>> >
>> >
>> > On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
>> > <[hidden email]> wrote:
>> >> Hi,
>> >>
>> >> I guess is a situation encountered quite often in practice. However
>> >> I'm not sure what is the right way of using a private repository in
>> >> stack as the source of Haskell packages. This is how far I've come:
>> >>
>> >>
>> >> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>> >>
>> >> Which approach do you use?
>> >>
>> >> Thanks in advance!
>> >> Damian.
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Commercial Haskell" group.
>> >>
>> >> an
>> >> email to [hidden email].
>> >>
>> >> [hidden email].
>> >>
>> >>
>> >> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXedTsWdQX0U8onuO%2BqMEkc2OBOzw%2BZ5Mo_S_ek2-HuvtJg%40mail.gmail.com.
>> >>
>> >
>> >
>> >
>> > --
>> > Chris Allen
>> > Currently working on http://haskellbook.com
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Commercial Haskell" group.
>> >
>> > an
>> > email to [hidden email].
>> >
>> >
>> >
>> > https://groups.google.com/d/msgid/commercialhaskell/CADnndOq_jgdDo8vh3O1_kj%2BU_j68ZxfgJfVOSsVYbmWNvFEboQ%40mail.gmail.com.
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Commercial Haskell" group.
>> >
>> > an
>> > email to [hidden email].
>> >
>> >
>> >
>> > https://groups.google.com/d/msgid/commercialhaskell/CAM7nXecHkFpHhWpD2157%3Df_Hju4RtZBEE9pjoNgL9dZx88C1wQ%40mail.gmail.com.
>> >
>> >
>>
>>
>>
>> --
>> Chris Allen
>> Currently working on http://haskellbook.com
>>
>> --
>>
>> "Commercial Haskell" group.
>>
>> email to [hidden email].
>>
>>
>> https://groups.google.com/d/msgid/commercialhaskell/CADnndOrF7LakVAXKcNvXxc63subMt3G2qVGjDAutqg75dD_Bbg%40mail.gmail.com.
>>
>
>

--





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using a private git repository with Stack

Erik Hesselink-2
On 8 January 2017 at 22:03, Damian Nadales <[hidden email]> wrote:
On Fri, Jan 6, 2017 at 11:59 AM, Erik Hesselink <[hidden email]> wrote:
> Another option that falls in between a monorepo and a git dependency is
> using git submodules. We did this for forks and open sourced libraries. You
> still need to point to a commit hash (since that's how submodules work) but
> as mentioned that's a good idea anyway. We then listed those submodule
> packages as 'extra-dep: true' to not have them treated as part of our own
> sources.
>
That also looks like a simple solution. How does this approach works
for you in practice? I've heard people advising against the use of
git-submodules (we don't use them currently).

We've used it ever since we switched to stack about 1.5 years ago, and we've used submodules for about 7 years, so I'd say it works. Submodules are not great (biggest problem is that a pull doesn't update them, so you can accidentally commit a revert of the updated submodule) but they work. If you have things you often want to branch together, I'd put them in the same repo (we do for our normal libraries and apps) but loosely related things like forks of dependencies work well as submodules.

Erik
 
 
> The stack.yaml would look something like this:
>
> packages:
> - local-package-1/
> - local-package-2/
> - location: forks/submodule-for-fork/
>   extra-dep: true
>
> Erik
>
> Erik
>
>
> On 6 January 2017 at 09:11, Christopher Allen <[hidden email]> wrote:
>>
>> That's absolutely what we want and is representative of the point of
>> Stack: deterministic, reproducible builds.
>>
>> Anything that should have changes tracked collectively (if B uses A,
>> and B should always use the latest version of A), then it implies it
>> should be part of a monorepo. Which is what we do for those
>> components.
>>
>> Here's a snippet from our stack.yaml:
>>
>> resolver: lts-6.8
>> packages:
>> - hestia/
>> - thoth/
>> - friendlyId/
>> - rosetta/
>> - location:
>>     git: https://github.com/mwotton/mandrill
>>     commit: fd22b874feb76fbb76911b6049b4a89f181857d8
>>     extra-dep: true
>>
>> Here mandrill is a fork of a repo. We don't want to this to change
>> unless we explicitly upgrade.
>>
>> hestia, thoth, friendlyId, and rosetta are all part of the same repo
>> because they "belong together."
>>
>> Does that help?
>>
>> On Fri, Jan 6, 2017 at 1:55 AM, Damian Nadales <[hidden email]>
>> wrote:
>> >
>> >
>> > On Jan 6, 2017 08:40, "Christopher Allen" <[hidden email]> wrote:
>> >
>> > I use Stack with private git repos. If your git configuration is
>> > correct (I never do anything manual, it's just ssh keypairs) then it
>> > should work out of the box.
>> >
>> > It does. I did a small experiment and it works perfectly. The only thing
>> > I
>> > don't like is that I need to specify the commit in my stack.yml:
>> >
>> >
>> > http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>> >
>> > This means that updating the package requires updating the commit id at
>> > the
>> > stack file.
>> >
>> > I don't know if you refer to this approach.
>> >
>> >
>> > On Wed, Dec 28, 2016 at 4:50 PM, Damian Nadales
>> > <[hidden email]> wrote:
>> >> Hi,
>> >>
>> >> I guess is a situation encountered quite often in practice. However
>> >> I'm not sure what is the right way of using a private repository in
>> >> stack as the source of Haskell packages. This is how far I've come:
>> >>
>> >>
>> >> http://stackoverflow.com/questions/41370813/using-a-private-git-repository-with-stack
>> >>
>> >> Which approach do you use?
>> >>
>> >> Thanks in advance!
>> >> Damian.
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Commercial Haskell" group.
>> >> >> >> an
>> >> email to [hidden email].
>> >> >> >> [hidden email].
>> >> >> >>
>> >> https://groups.google.com/d/msgid/commercialhaskell/CAM7nXedTsWdQX0U8onuO%2BqMEkc2OBOzw%2BZ5Mo_S_ek2-HuvtJg%40mail.gmail.com.
>> >> >> >
>> >
>> >
>> > --
>> > Chris Allen
>> > Currently working on http://haskellbook.com
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Commercial Haskell" group.
>> > >> > an
>> > email to [hidden email].
>> > >> > >> >
>> > https://groups.google.com/d/msgid/commercialhaskell/CADnndOq_jgdDo8vh3O1_kj%2BU_j68ZxfgJfVOSsVYbmWNvFEboQ%40mail.gmail.com.
>> > >> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Commercial Haskell" group.
>> > >> > an
>> > email to [hidden email].
>> > >> > >> >
>> > https://groups.google.com/d/msgid/commercialhaskell/CAM7nXecHkFpHhWpD2157%3Df_Hju4RtZBEE9pjoNgL9dZx88C1wQ%40mail.gmail.com.
>> >
>> > >>
>>
>>
>> --
>> Chris Allen
>> Currently working on http://haskellbook.com
>>
>> --
>> >> "Commercial Haskell" group.
>> >> email to [hidden email].
>> >> >> https://groups.google.com/d/msgid/commercialhaskell/CADnndOrF7LakVAXKcNvXxc63subMt3G2qVGjDAutqg75dD_Bbg%40mail.gmail.com.
>> >
>

--
Loading...