Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 658648

Summary: sys-apps/portage: make autounmask only allow package.use and package.license changes by default
Product: Portage Development Reporter: Brian Evans (RETIRED) <grknight>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: bkohler, esigra, pacho
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://archives.gentoo.org/gentoo-dev/message/a9752d65f0b2a315d5d1520d9bd3943d
See Also: https://bugs.gentoo.org/show_bug.cgi?id=622462
https://bugs.gentoo.org/show_bug.cgi?id=667132
https://bugs.gentoo.org/show_bug.cgi?id=766773
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 376695, 699030, 547332, 697734    

Description Brian Evans (RETIRED) gentoo-dev 2018-06-21 13:25:46 UTC
The support team in #gentoo constantly is dealing with users who mistakenly take the autounmask advice for 9999 and hard masked files when they are the wrong answer.

When resolving dependencies, autounmask-keep-masks should always be on.
Those that want to live on the edge can disable it.

It may be worth automatically disabling if a user specifically asks for a masked version, but otherwise it should be on for most users.
Comment 1 Zac Medico gentoo-dev 2018-06-21 17:26:55 UTC
(In reply to Brian Evans from comment #0)
> The support team in #gentoo constantly is dealing with users who mistakenly
> take the autounmask advice for 9999 and hard masked files when they are the
> wrong answer.

Please have them report bugs, because this behavior is not normal. For example, see bug 622462 where this sort of abnormal behavior was triggered by unsatisfied REQUIRED_USE.

> When resolving dependencies, autounmask-keep-masks should always be on.
> Those that want to live on the edge can disable it.

I'd prefer to have bug reports, since this behavior is abnormal. The intended behavior is to use package.unmask or ** package.accept_keywords only when there is no other viable solution.

> It may be worth automatically disabling if a user specifically asks for a
> masked version, but otherwise it should be on for most users.

This already matches the intended behavior.
Comment 2 Ben Kohler gentoo-dev 2018-09-26 15:10:28 UTC
Unpack a fresh stage3 (eg stage3-amd64-20180925T214502Z.tar.xz), and unpack or binmount a current snapshot/repo, then chroot in.  Just to illustrate what autounmask can do, run:

USE="gost" emerge -av bind-tools

And the result:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U #] dev-libs/openssl-1.1.1:0/1.1::gentoo [1.0.2p:0/0::gentoo] USE="asm zlib -bindist* -rfc3779 -sctp -sslv3* -static-libs -test -tls-heartbeat* -vanilla (-gmp%) (-kerberos%) (-sslv2%)" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="(sse2)" 8143 KiB
[ebuild  N     ] net-dns/bind-tools-9.11.2_p1::gentoo  USE="gost ipv6 readline seccomp ssl -doc -gssapi -idn -libressl -urandom -xml" 9555 KiB

Total: 2 packages (1 upgrade, 1 new), Size of downloads: 17697 KiB

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

dev-libs/openssl:0

  (dev-libs/openssl-1.1.1:0/1.1::gentoo, ebuild scheduled for merge) pulled in by
    >=dev-libs/openssl-1.0.0:0=[-bindist] required by (net-dns/bind-tools-9.11.2_p1:0/0::gentoo, ebuild scheduled for merge)
                                ^^^^^^^^                                                                                                                        

  (dev-libs/openssl-1.0.2p:0/0::gentoo, installed) pulled in by
    dev-libs/openssl:0/0= required by (net-misc/iputils-20171016_pre:0/0::gentoo, installed)
                    ^^^^^                                                                                                       
    >=dev-libs/openssl-1.0.1:0=[bindist=] required by (net-misc/openssh-7.7_p1-r9:0/0::gentoo, installed)
                                ^^^^^^^^                                                                                                     
    (and 6 more with the same problems)

NOTE: Use the '--verbose-conflicts' option to display parents omitted above

It may be possible to solve this problem by using package.mask to
prevent one of those packages from being selected. However, it is also
possible that conflicting dependencies exist such that they are
impossible to satisfy simultaneously.  If such a conflict exists in
the dependencies of two different packages, then those packages can
not be installed simultaneously.

For more information, see MASKED PACKAGES section in the emerge man
page or refer to the Gentoo Handbook.

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by dev-lang/python-2.7.15::gentoo[ssl,-libressl]
# required by dev-python/pyblake2-1.1.2::gentoo[python_targets_python2_7]
# required by app-portage/gemato-14.0::gentoo[python_targets_python2_7,-python_targets_python3_4,-python_targets_python3_5,blake2]
# required by sys-apps/portage-2.3.49::gentoo[rsync-verify,-build]
# required by app-admin/perl-cleaner-2.25::gentoo
# required by dev-lang/perl-5.24.3-r1::gentoo
# required by dev-libs/openssl-1.0.2p::gentoo
# required by net-misc/wget-1.19.5::gentoo[-gnutls,ssl,-libressl,-static]
# required by @system
# required by @world (argument)
=dev-libs/openssl-1.1.1 ~amd64

The following mask changes are necessary to proceed:
 (see "package.unmask" in the portage(5) man page for more details)
# required by dev-lang/python-2.7.15::gentoo[ssl,-libressl]
# required by dev-python/pyblake2-1.1.2::gentoo[python_targets_python2_7]
# required by app-portage/gemato-14.0::gentoo[python_targets_python2_7,-python_targets_python3_4,-python_targets_python3_5,blake2]
# required by sys-apps/portage-2.3.49::gentoo[rsync-verify,-build]
# required by app-admin/perl-cleaner-2.25::gentoo
# required by dev-lang/perl-5.24.3-r1::gentoo
# required by dev-libs/openssl-1.0.2p::gentoo
# required by net-misc/wget-1.19.5::gentoo[-gnutls,ssl,-libressl,-static]
# required by @system
# required by @world (argument)
# /usr/portage/profiles/package.mask:
# Lars Wendler <polynomial-c@gentoo.org> (26 Aug 2016)
# Masked while being tested and reverse deps aren't fully compatible
=dev-libs/openssl-1.1.1

NOTE: The --autounmask-keep-masks option will prevent emerge
      from creating package.unmask or ** keyword changes.

Would you like to add these changes to your config files? [Yes/No]
Comment 3 Zac Medico gentoo-dev 2018-09-26 19:24:54 UTC
(In reply to Ben Kohler from comment #2)
> Unpack a fresh stage3 (eg stage3-amd64-20180925T214502Z.tar.xz), and unpack
> or binmount a current snapshot/repo, then chroot in.  Just to illustrate
> what autounmask can do, run:
> 
> USE="gost" emerge -av bind-tools

Thanks, reported as bug 667132.
Comment 4 Zac Medico gentoo-dev 2019-10-10 18:27:53 UTC
I would like to do something like this:

Add --autounmask-use=<y|n> option that's enabled by default when --autounmask is unspecified.

When --autounmask=y is specified, we'll have full autounmask behavior.

When --autounmask=n is specified, we'll have --autounmask-use=n behavior.

Proposed here:

https://archives.gentoo.org/gentoo-dev/message/1877e567bb19585c2b34d05b3ee56b67
Comment 5 Zac Medico gentoo-dev 2019-10-11 04:54:53 UTC
I'm working on a patch, and I've found that we'll also need an --autounmask-license option for completeness.
Comment 7 Larry the Git Cow gentoo-dev 2019-10-14 22:51:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=979f9f47cce27092e528321ccafd7a649adbc7b3

commit 979f9f47cce27092e528321ccafd7a649adbc7b3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-10-11 03:58:15 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-10-14 22:26:58 +0000

    Default disable autounmask package.accept_keywords/mask changes (bug 658648)
    
    Add emerge --autounmask-license and --autounmask-use options which are
    enabled by default, and disable package.accept_keywords/mask changes by
    default. For backward compatibility, previous behavior of
    --autounmask=y and --autounmask=n is entirely preserved. Users can
    get the old behavior simply by adding --autounmask to the make.conf
    EMERGE_DEFAULT_OPTS variable.
    
    Bug: https://bugs.gentoo.org/658648
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/create_depgraph_params.py         | 35 +++++++++++++++++++++++++++
 lib/_emerge/depgraph.py                       | 20 +++++++++------
 lib/_emerge/main.py                           | 10 ++++++++
 lib/portage/tests/resolver/test_autounmask.py | 35 ++++++++++++++++++++++++++-
 man/emerge.1                                  | 23 +++++++++++++++---
 5 files changed, 110 insertions(+), 13 deletions(-)
Comment 8 Larry the Git Cow gentoo-dev 2019-10-14 23:01:25 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e18292c54af86bee8299b6a925d25eb6c55fd77b

commit e18292c54af86bee8299b6a925d25eb6c55fd77b
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-10-14 22:53:35 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-10-14 23:01:06 +0000

    sys-apps/portage: Bump to version 2.3.77
    
     #220533 Fix FEATURES=skiprocheck read-only DISTDIR support
     #646898 Support GLEP 75 mirror structure
     #658648 Disable emerge --autounmask by default, except for package.use
             and package.license changes
     #695870 Improvements to ebuild(5) man page
    
    Bug: https://bugs.gentoo.org/697734
    Bug: https://bugs.gentoo.org/220533
    Bug: https://bugs.gentoo.org/646898
    Bug: https://bugs.gentoo.org/658648
    Bug: https://bugs.gentoo.org/695870
    Package-Manager: Portage-2.3.77, Repoman-2.3.17
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.77.ebuild | 261 +++++++++++++++++++++++++++++++++
 2 files changed, 262 insertions(+)
Comment 9 Michal Privoznik 2019-12-07 20:28:42 UTC
I know it may be a bit late, but this surprised me as I was using this feature. And I had to go through git log to learn about this bug. Is it worth mentioning in news/elog?
Comment 10 Larry the Git Cow gentoo-dev 2019-12-08 00:27:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa1a392e5a4d93359b1e681621f80a6748311103

commit aa1a392e5a4d93359b1e681621f80a6748311103
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-12-08 00:14:15 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-12-08 00:21:09 +0000

    sys-apps/portage: elog for default autounmask behavior
    
    Suggested-by: Michal Privoznik <miso.privoznik@gmail.com>
    Bug: https://bugs.gentoo.org/658648#c9
    Package-Manager: Portage-2.3.81, Repoman-2.3.20
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/portage-2.3.79.ebuild | 10 ++++++++++
 sys-apps/portage/portage-2.3.81.ebuild | 10 ++++++++++
 2 files changed, 20 insertions(+)