Re: [gentoo-portage-dev] [PATCH] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)

2017-03-04 Thread Zac Medico
On 03/04/2017 02:30 AM, Zac Medico wrote:
> On 03/04/2017 01:59 AM, Michał Górny wrote:
>> W dniu 04.03.2017, sob o godzinie 01∶34 -0800, użytkownik Zac Medico
>> napisał:
>>> It's useful to enable --with-bdeps by default so that @world updates
>>> will update all packages that are not eligible for removal by
>>> emerge --depclean. However, many users of binary packages do not want
>>> unnecessary build time dependencies installed, therefore do not
>>> auto-enable --with-bdeps for installation actions when the --usepkg
>>> option is enabled.
>>>
>>> X-Gentoo-bug: 598444
>>> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=598444
>>> ---
>>>  man/emerge.1 |  18 ++-
>>>  pym/_emerge/create_depgraph_params.py|   4 +
>>>  pym/_emerge/depgraph.py  |   4 +-
>>>  pym/portage/tests/resolver/ResolverPlayground.py |   5 +
>>>  pym/portage/tests/resolver/test_bdeps.py | 197 
>>> +++
>>>  5 files changed, 223 insertions(+), 5 deletions(-)
>>>  create mode 100644 pym/portage/tests/resolver/test_bdeps.py
>>
>> Just to be clear, this will break stuff for people who have more than
>> one slot of LLVM enabled since different slots build-depend on colliding
>> packages.
> 
> Hmm, that's unfortunate, because putting --with-bdeps=n in
> EMERGE_DEFAULT_OPTS is not good for --depclean. I'll have to think about
> a better way to handle this case. We've already got a bug open for this
> sort of situation here:
> 
> https://bugs.gentoo.org/show_bug.cgi?id=427938

For people who want --with-bdeps disabled for installation actions, and
--with-bdeps enabled for removal actions like --depclean, putting
--with-bdeps=n in EMERGE_DEFAULT_OPTS is going to do the wrong thing for
removal actions. So, we'll need to introduce some kind of flag that can
be used to disable the automatic --with-bdeps behavior. For example,
when can introduce --with-bdeps-auto=n as a means to disable the
automatic --with-bdeps behavior.
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)

2017-03-04 Thread Michał Górny
W dniu 04.03.2017, sob o godzinie 02∶30 -0800, użytkownik Zac Medico
napisał:
> On 03/04/2017 01:59 AM, Michał Górny wrote:
> > W dniu 04.03.2017, sob o godzinie 01∶34 -0800, użytkownik Zac Medico
> > napisał:
> > > It's useful to enable --with-bdeps by default so that @world updates
> > > will update all packages that are not eligible for removal by
> > > emerge --depclean. However, many users of binary packages do not want
> > > unnecessary build time dependencies installed, therefore do not
> > > auto-enable --with-bdeps for installation actions when the --usepkg
> > > option is enabled.
> > > 
> > > X-Gentoo-bug: 598444
> > > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=598444
> > > ---
> > >  man/emerge.1 |  18 ++-
> > >  pym/_emerge/create_depgraph_params.py|   4 +
> > >  pym/_emerge/depgraph.py  |   4 +-
> > >  pym/portage/tests/resolver/ResolverPlayground.py |   5 +
> > >  pym/portage/tests/resolver/test_bdeps.py | 197 
> > > +++
> > >  5 files changed, 223 insertions(+), 5 deletions(-)
> > >  create mode 100644 pym/portage/tests/resolver/test_bdeps.py
> > 
> > Just to be clear, this will break stuff for people who have more than
> > one slot of LLVM enabled since different slots build-depend on colliding
> > packages.
> 
> Hmm, that's unfortunate, because putting --with-bdeps=n in
> EMERGE_DEFAULT_OPTS is not good for --depclean. I'll have to think about
> a better way to handle this case. We've already got a bug open for this
> sort of situation here:
> 
> https://bugs.gentoo.org/show_bug.cgi?id=427938

Eventually I want to try to accept more lit versions for LLVM. However,
it kinda fails when LLVM upgrades gtest and lit is bound to a specific
output.

-- 
Best regards,
Michał Górny


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-portage-dev] [PATCH] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)

2017-03-04 Thread Michał Górny
W dniu 04.03.2017, sob o godzinie 01∶34 -0800, użytkownik Zac Medico
napisał:
> It's useful to enable --with-bdeps by default so that @world updates
> will update all packages that are not eligible for removal by
> emerge --depclean. However, many users of binary packages do not want
> unnecessary build time dependencies installed, therefore do not
> auto-enable --with-bdeps for installation actions when the --usepkg
> option is enabled.
> 
> X-Gentoo-bug: 598444
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=598444
> ---
>  man/emerge.1 |  18 ++-
>  pym/_emerge/create_depgraph_params.py|   4 +
>  pym/_emerge/depgraph.py  |   4 +-
>  pym/portage/tests/resolver/ResolverPlayground.py |   5 +
>  pym/portage/tests/resolver/test_bdeps.py | 197 
> +++
>  5 files changed, 223 insertions(+), 5 deletions(-)
>  create mode 100644 pym/portage/tests/resolver/test_bdeps.py

Just to be clear, this will break stuff for people who have more than
one slot of LLVM enabled since different slots build-depend on colliding
packages.

-- 
Best regards,
Michał Górny


signature.asc
Description: This is a digitally signed message part


[gentoo-portage-dev] [PATCH] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)

2017-03-04 Thread Zac Medico
It's useful to enable --with-bdeps by default so that @world updates
will update all packages that are not eligible for removal by
emerge --depclean. However, many users of binary packages do not want
unnecessary build time dependencies installed, therefore do not
auto-enable --with-bdeps for installation actions when the --usepkg
option is enabled.

X-Gentoo-bug: 598444
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=598444
---
 man/emerge.1 |  18 ++-
 pym/_emerge/create_depgraph_params.py|   4 +
 pym/_emerge/depgraph.py  |   4 +-
 pym/portage/tests/resolver/ResolverPlayground.py |   5 +
 pym/portage/tests/resolver/test_bdeps.py | 197 +++
 5 files changed, 223 insertions(+), 5 deletions(-)
 create mode 100644 pym/portage/tests/resolver/test_bdeps.py

diff --git a/man/emerge.1 b/man/emerge.1
index 5b61220..970bb5b 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -986,9 +986,21 @@ The default is set to "y" (on).
 .TP
 .BR "\-\-with\-bdeps < y | n >"
 In dependency calculations, pull in build time dependencies
-that are not strictly required. This defaults to \'n\' for
-installation actions, meaning they will not be installed, and
-\'y\' for the \fB\-\-depclean\fR action, meaning they will not be removed.
+that are not strictly required. This option is enabled automatically for
+installation actions, meaning they will be installed, and is also enabled
+automatically for the \fB\-\-depclean\fR action, meaning they will not be
+removed. In order to prevent this option from being enabled automatically,
+\fB\-\-with-bdeps=n\fR must be specified either in the command line or
+via \fBEMERGE_DEFAULT_OPTS\fR.
+
+Since many users of binary packages do not want unnecessary build time
+dependencies installed, this option is not enabled automatically for
+installation actions when the \fB\-\-usepkg\fR option is enabled. In
+order to pull in build time dependencies for binary packages with
+\fB\-\-usepkg\fR, \fB\-\-with-bdeps=y\fR must be specified explicitly.
+This also applies to options that enable the \fB\-\-usepkg\fR option
+implicitly, such as \fB\-\-getbinpkg\fR.
+
 This setting can be added to
 \fBEMERGE_DEFAULT_OPTS\fR (see make.conf(5)) and later overridden via the
 command line.
diff --git a/pym/_emerge/create_depgraph_params.py 
b/pym/_emerge/create_depgraph_params.py
index 2c64928..676aac5 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -13,6 +13,8 @@ def create_depgraph_params(myopts, myaction):
# deep:  go into the dependencies of already merged packages
# empty: pretend nothing is merged
# complete:  completely account for all known dependencies
+   # bdeps: satisfy build time dependencies of packages that are
+   #   already built, even though they are not strictly required
# remove:build graph for use in removing packages
# rebuilt_binaries: replace installed packages with rebuilt binaries
# rebuild_if_new_slot: rebuild or reinstall packages when
@@ -32,6 +34,8 @@ def create_depgraph_params(myopts, myaction):
bdeps = myopts.get("--with-bdeps")
if bdeps is not None:
myparams["bdeps"] = bdeps
+   elif myaction == "remove" or "--usepkg" not in myopts:
+   myparams["bdeps"] = "auto"
 
ignore_built_slot_operator_deps = 
myopts.get("--ignore-built-slot-operator-deps")
if ignore_built_slot_operator_deps is not None:
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ce0fde1..02a3226 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2362,7 +2362,7 @@ class depgraph(object):
if ebuild is None:
changed = False
else:
-   if self._dynamic_config.myparams.get("bdeps", "n") == 
"y":
+   if self._dynamic_config.myparams.get("bdeps") in ("y", 
"auto"):
depvars = Package._dep_keys
else:
depvars = Package._runtime_keys
@@ -2998,7 +2998,7 @@ class depgraph(object):
 
ignore_build_time_deps = False
if pkg.built and not removal_action:
-   if self._dynamic_config.myparams.get("bdeps", "n") == 
"y":
+   if self._dynamic_config.myparams.get("bdeps") in ("y", 
"auto"):
# Pull in build time deps as requested, but 
marked them as
# "optional" since they are not strictly 
required. This allows
# more freedom in the merge order calculation 
for solving
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py 
b/pym/portage/tests/resolver/ResolverPlayground.py
index d1434f7..d803719 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++