[erlang-questions] Including other peoples code in my code in a future proof way

Boris Mühmer <>
Tue Mar 17 15:08:13 CET 2015


Hi Joe,

about Your "how should I fix this" section there may be a way, when You
already use git are "submodules".

With such a submodule You can include a git repository and it will be fixed
at a given commit.

But there is another problem with other's (git-) repositories: what will
happen when the project dies, or is moved to another "namespace". Of course
You can use a fork and use this as a base for a submodule, but with this
approach You may have to keep Your fork in sync with the original one.

[IMHO] On the other hand the "git submodule usage" is somewhat
cumbersome...


Regards,
Boris



2015-03-17 14:53 GMT+01:00 Joe Armstrong <>:

> How do I include another application in my application?
>
> I've written a program that I want to distibute.
> I'll make it available on github.
>
> The problem is that my program uses cowboy and a few other
> things (which are also on github)
>
> I'd like my program to work "out of the box" - just type Make and off
> you go.
>
> I'd also like my to work for a long time so if rebar and
> cowboy change in the future I'd like my program to still build
> correctly.
>
> Now what I could do is:
>
>     use rebar and a rebar.config file that point to cowboy etc.
>
> My rebar-config is like this
>
> {deps, [
>    ...
>   {cowboy, ".*", {git, "git://github.com/extend/cowboy.git", "master"}}
> ]}.
>
> The problem with this is that
>
>    1) my version of rebar might not be the same as on the target machine
>       where the makefile is run
>    2) The cowboy reference is to "the latest version" and not
>       an immutable version that I know works
>
> So How should I fix this? Is the answer:
>
>     a) Include rebar in my distribution
>       (I don't really like this, since I'd just like to have my code in
>        my project archive)
>     b) Point to a absolute version of cowboy - but how do I do this?
>
> Or c)
>       Include all the source code of cowboy etc in my release
>
> I also don't want mutiple versions of rebar and libraries in different
> directories, branches, views or whatever you call them.
>
> What's the best thing to do here?
>
> Cheers
>
> /Joe
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150317/762c7f3d/attachment.html>


More information about the erlang-questions mailing list