mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Excluding packages, and dependency info (was:


From: Tony Theodore
Subject: Re: [Mingw-cross-env-list] Excluding packages, and dependency info (was: Qt compilation options)
Date: Wed, 21 Aug 2013 01:52:01 +1000

On 13/08/2013, at 10:44 PM, Volker Grabsch <address@hidden> wrote:
>> 
>> make EXCLUDE_PKGS='glib ocaml% qt'
>> 
>> to exclude packages and all their downstream dependents.
> 
> Looks good!
> 
>> [1]
>> DDEP_PKGS = $(sort \
>>                $(foreach DEP_PKG,$(2),\
>>                    $(if $(filter $(1),$($(DEP_PKG)_DEPS)),\
>>                        $(DEP_PKG) $(call DDEP_PKGS,$(DEP_PKG),$(2)))))
>> 
>> REXCLUDED_PKGS := $(sort $(filter $(EXCLUDE_PKGS),$(PKGS)) \
>>                      $(call DDEP_PKGS,$(filter 
>> $(EXCLUDE_PKGS),$(PKGS)),$(PKGS)))
>> 
>> all: $(filter-out $(REXCLUDED_PKGS),$(PKGS))
> 
> Feel free to add this to the core if you didn't
> already do it.

Unfortunately, it's exponentially slow when there are many downstream 
dependents - even with caching of visited packages, it's still roughly 
quadratic.

I've done a different version which runs in linear time that I'm happy with:

https://github.com/mxe/mxe/pull/228

though it's more code as it walks upstream (very fast) then simply filters on 
the flattened set of dependencies. There's also some convenient info targets 
that I often find myself wanting:

    make show-deps-foo
    make show-upstream-deps-foo
    make show-downstream-deps-foo

The last is useful for something like:

    make clean && make update PKGS='foo' && make `make show-downstream-deps-foo`

Cheers,

Tony




reply via email to

[Prev in Thread] Current Thread [Next in Thread]