Overriding recursive dependencies for a single dep

Brian Rowe rowe at muxspace.com
Fri Jul 22 15:11:40 EDT 2011


Tim,

Thanks for the pointers. This is not the first time I've wanted to
override values in the rebar.config of a dependency. Another situation
I've come across is that if I set erl_opts in a library that is pulled
in as a dep, sometimes I want to override that value in my parent
project. Unfortunately, the erl_opts of a parent are ignored if
erl_opts exist for a dependency (but they are applied if erl_opts was
not declared explicitly). Clearly it's not something you always want
to do, but there are instances where I've found it to be useful (e.g.
defining TEST in all dependencies).

So I'm wondering if this sort of uber-control of dependencies is
generic enough to warrant further investigation versus applying
skip_deps=true during the clean step as a permanent workaround.

Thanks again,
Brian


On Fri, Jul 22, 2011 at 2:29 PM, Tim Watson <watson.timothy at gmail.com> wrote:
> On 22 July 2011 18:00, Brian Rowe <rowe at muxspace.com> wrote:
>> riak_kv, I get about a dozen dependencies pulled with it and a lengthy
>> build process after a clean. Given that I really only want this module
>> (source code doesn't appear to depend on the other libraries), is
>> there a "best practice" for preventing a specific dependency from
>> recursively downloading it's dependencies? I do have other
>> dependencies where I do need their dependencies, so this is the
>> gotcha.
>>
>
> It sounds like the issue with this isn't that you're fetching deps you
> don't need - it's true that you are, but that's not what's causing the
> pain. The real issue (if I've understood you correctly) is that
> running 'clean compile' trounces all the dependencies (including the
> transitive ones) which makes your build process slow. This is a real
> pain that a lot of rebar users have complained about.
>
> Personally, I would suggest for now that you work around it either by
> running 'clean' with 'skip_deps=true' to avoid cleaning the deps, or
> using one of the many alternative forks/patches that exclude deps in
> some way or another. Some that might help are:
>
> - https://github.com/basho/rebar/pull/85 - only recursive into
> sub_dirs and deps when `-r` flag is present
> - https://github.com/basho/rebar/pull/73 - default to skip_deps for
> all destructive commands (e.g., clean, create template, etc)
>
>> I'm considering overwriting riak_kv's rebar.config via my Makefile,
>> but I was hoping somebody had a less brutish method for this.
>>
>
> Hopefully the approach I've suggested will work for you. Let me know
> if it does!
>
> Cheers,
>
> Tim
>



More information about the rebar mailing list