Allow private_build_requires in dependency graph

91 views
Skip to first unread message

Ibrahim sani kache

unread,
Jul 28, 2020, 4:33:34 PM7/28/20
to rez-config
Hello,

I would like to propose optionally allowing private_build_requires in get_dependency_graph in rez.resolved_context. This is useful in capturing the full dependency graph of a package. 
e.g:
```
def get_dependency_graph(self, bool_include_private=False):
        . . . .
        for variant in self._resolved_packages:
            . . .
            for request in variant.get_requires(private_build_requires=bool_include_private):
                if not request.conflict:
                    edges.add((variant.name, request.name))
```
Cheers

Allan Johns

unread,
Aug 15, 2020, 1:09:49 AM8/15/20
to rez-c...@googlegroups.com
Hi,

This does not make sense, for two reasons.

First: A context is the result of running the solver algorithm, and the graph is a visual representation of that. Adding edges to it to graft in other data (a package's private build requires in this case) would change the meaning of this graph entirely.

Second: It doesn't make sense to add the private build requirements of all packages in a resolve - only one package (the one that got built) ever has its private build requirements added to an env request (its build env).

If the intent is to see the dependency graph for a real build env, that would contain a package's private-build-requires (as well as standard build-requires, and requires), then what you're actually asking for is a way to create that env, and that's reasonable.

What could be good is to add a new option to rez-env to give you that. For example, currently there is the -b option, but all that does is include all the build_requires of packages in the resolve. Perhaps we could add a -B option (which is more like, recreate the actual build env for a specific package). In this case, rez-env would be restricted to one PKG (the one to recreate the build env for) and would then include its private and public build requires.

Does this describe what you're after?

Thx
A




--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rez-config/c5b8a0c0-ee19-4502-b53c-a37e6d7edd20n%40googlegroups.com.

Ibrahim sani kache

unread,
Aug 15, 2020, 4:23:37 AM8/15/20
to rez-c...@googlegroups.com
Hello Allan,

If the intent is to see the dependency graph for a real build env, that would contain a package's private-build-requires (as well as standard build-requires, and requires), then what you're actually asking for is a way to create that env, and that's reasonable. 

Yes, this is close to what I am after but I want the package build env to ( optionally ) include the private_build_requires of all the packages listed in it's requires if any. 
Here's what I am trying to solve, suppose I have package A with these requirements and some of them have inter-dependency with one another and package 'c' has package 'foo' as private_build_require:
```
requires = [ 'a', 'b', 'c', 'd', 'e'] 
```
If I have a code change that requires package 'foo' and every single package in package A requires to be rebuilt in this order a->d,e->foo->e->A, I need the solver to compute the resolve context by including the private_build_requires for all the packages listed in my package A. Because I need 'foo' rebuilt first before 'c', the graph needs to show 'foo' connected to 'c' ( [('c', 'foo')] ). This was something we were able to achieve in Rez1. 

Thanks 


You received this message because you are subscribed to a topic in the Google Groups "rez-config" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rez-config/IY39RSZ8h8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rez-config+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rez-config/CAGMneOempGumckOaUJTDbOaf%2BKWT-uWmuK2S8Kig%3Dq3a7p1a%2BA%40mail.gmail.com.

Allan Johns

unread,
Aug 17, 2020, 6:02:02 PM8/17/20
to rez-c...@googlegroups.com
Hi Ibrahim,

Ok, I see what you mean.

In that case then I propose we have a -B option that can optionally take a list of package names. If empty, this will then pull in the private build requires of all packages; otherwise, it'll pull in those for the listed packages only. That way we can use this one new option for two different scenarios - the one you point out above, but also to recreate the specific build env for a given package.

Cheers
A



Ibrahim sani kache

unread,
Aug 18, 2020, 12:08:02 AM8/18/20
to rez-c...@googlegroups.com
Great! Sounds good Allan. 
Thanks. 

Ibrahim Sani Kache

unread,
Apr 30, 2021, 9:35:39 PM4/30/21
to rez-config
Hello Allan,

Is there an open issue for this one that I can follow?
Thanks.

Reply all
Reply to author
Forward
0 new messages