Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 681308 - emerge --pretend does not honor the --emptytree flag
Summary: emerge --pretend does not honor the --emptytree flag
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-22 16:47 UTC by nednguyen
Modified: 2019-03-22 17:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nednguyen 2019-03-22 16:47:08 UTC
In ChromeOS project, we uses "emerge --pretend --emptytree --sysroot=<path> <package X>" to query the dependency graph of the packages.

I recently found out that this command does include the obsolete packages (built, but no longer exist in the portage tree) in its output.

For example, in ChromeOS chroot, I run:

$ emerge --pretend --emptytree sys-devel/lld

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

Calculating dependencies... done!
[ebuild   R    ] virtual/libintl-0-r2 
[ebuild   R    ] sys-libs/ncurses-5.9-r7 
[ebuild   R    ] app-arch/bzip2-1.0.6-r9 
[ebuild   R    ] sys-devel/gnuconfig-20161104 
[ebuild   R    ] virtual/libiconv-0-r1 
[ebuild   R    ] app-misc/mime-types-9 
[ebuild   R    ] sys-apps/gentoo-functions-0.11 
[ebuild   R    ] sys-devel/automake-wrapper-10 
[ebuild   R    ] app-misc/c_rehash-1.7-r1 
[ebuild   R    ] sys-devel/autoconf-wrapper-13 
[ebuild   R    ] dev-util/re2c-1.0.3 
[ebuild   R    ] sys-apps/install-xattr-0.5 
[ebuild   R    ] sys-devel/binutils-config-3-r3 
[ebuild   R    ] sys-libs/ncurses-5.9-r99 
[ebuild   R    ] app-arch/unzip-6.0_p21-r2 
[ebuild   R    ] sys-apps/debianutils-4.4 
[ebuild   R    ] virtual/libffi-3.0.13-r1 
[ebuild   R    ] virtual/acl-0-r1 
[ebuild   R    ] app-text/docbook-xsl-stylesheets-1.79.1-r2 
[ebuild   R    ] app-text/build-docbook-catalog-1.20 
[ebuild   R    ] virtual/perl-ExtUtils-MakeMaker-7.100.100_rc-r2 
[ebuild   R    ] virtual/os-headers-0 
[ebuild   R    ] app-eselect/eselect-python-20140125-r1 
[ebuild   R    ] virtual/perl-Test-Harness-3.360.0-r1 
[ebuild   R    ] virtual/perl-libnet-3.80.0-r1 
[ebuild   R    ] virtual/perl-IO-Compress-2.60.0-r1 
[ebuild   R    ] virtual/perl-Scalar-List-Utils-1.420.200_rc-r1 
[ebuild   R    ] virtual/perl-ExtUtils-CBuilder-0.280.225-r1 
[ebuild   R    ] virtual/perl-Parse-CPAN-Meta-1.441.700-r2 
[ebuild   R    ] virtual/perl-CPAN-Meta-YAML-0.18.0-r1 
[ebuild   R    ] virtual/perl-File-Spec-3.400.0-r2 
[ebuild   R    ] app-admin/python-updater-0.11 
[ebuild   R    ] app-admin/perl-cleaner-2.20 
[ebuild   R    ] virtual/perl-Data-Dumper-2.160.0-r1 
[ebuild   R    ] virtual/perl-File-Temp-0.230.400-r4 
[ebuild   R    ] virtual/perl-File-Path-2.130.0 
[ebuild   R    ] virtual/perl-IO-1.360.100_rc-r4 
[ebuild   R    ] virtual/perl-Module-Build-0.400.300-r1 
[ebuild   R    ] virtual/perl-version-0.991.600-r1 
[ebuild   R    ] virtual/perl-Archive-Tar-1.900.0-r2 
[ebuild   R    ] virtual/perl-Package-Constants-0.20.0-r4 
[ebuild   R    ] virtual/perl-Compress-Raw-Bzip2-2.60.0-r2 
[ebuild   R    ] virtual/perl-Compress-Raw-Zlib-2.60.0-r2 
[ebuild   R    ] virtual/perl-IO-Zlib-1.100.0-r4 
[ebuild   R    ] virtual/perl-ExtUtils-ParseXS-3.180.0-r2 
[ebuild   R    ] virtual/perl-Perl-OSType-1.9.0-r1 
[ebuild   R    ] virtual/perl-Module-Metadata-1.0.31-r1 
[ebuild   R    ] virtual/perl-CPAN-Meta-2.150.5-r1 
[ebuild   R    ] virtual/perl-Digest-SHA-5.820.0 
[ebuild   R    ] virtual/perl-Digest-MD5-2.540.0-r2 
[ebuild   R    ] dev-lang/perl-5.24.4 
[ebuild   R    ] dev-perl/Text-Unidecode-0.40.0-r1 
[ebuild   R    ] dev-perl/libintl-perl-1.200.0-r1 
[ebuild   R    ] dev-perl/Unicode-EastAsianWidth-1.330.0-r1 
[ebuild   R    ] dev-perl/Error-0.170.210 
[ebuild   R    ] dev-perl/Digest-HMAC-1.30.0-r1 
[ebuild   R    ] dev-perl/TimeDate-2.300.0 
[ebuild   R    ] perl-core/File-Temp-0.230.400-r1 
[ebuild   R    ] perl-core/File-Path-2.130.0 
[ebuild   R    ] perl-core/Module-Build-0.400.300-r1 
[ebuild   R    ] perl-core/Archive-Tar-1.900.0-r1 
[ebuild   R    ] perl-core/Package-Constants-0.20.0-r1 
[ebuild   R    ] perl-core/IO-Compress-2.60.0 
[ebuild   R    ] perl-core/Compress-Raw-Bzip2-2.60.0 
[ebuild   R    ] perl-core/IO-Zlib-1.100.0 
[ebuild   R    ] perl-core/ExtUtils-ParseXS-3.180.0-r1 
[ebuild   R    ] virtual/perl-JSON-PP-2.273.0-r4 
[ebuild   R    ] perl-core/Digest-SHA-5.820.0 
[ebuild   R    ] perl-core/File-Spec-3.400.0 
[ebuild   R    ] dev-perl/MailTools-2.190.0 
[ebuild   R    ] dev-perl/Authen-SASL-2.160.0-r1 
[ebuild   R    ] app-portage/elt-patches-20170815 
[ebuild   R    ] sys-libs/zlib-1.2.11 
[ebuild   R    ] app-arch/xz-utils-5.2.3 
[ebuild   R    ] dev-lang/python-exec-2.0.1-r1 
[ebuild   R    ] sys-libs/gdbm-1.11 
[ebuild   R    ] dev-libs/libffi-3.1-r6 
[ebuild   R    ] sys-devel/m4-1.4.16 
[ebuild   R    ] sys-kernel/linux-headers-4.14-r5 
[ebuild   R    ] dev-libs/libltdl-2.4.6 
[ebuild   R    ] perl-core/Compress-Raw-Zlib-2.60.0 
[ebuild   R    ] sys-devel/autoconf-2.69 
[ebuild   R    ] dev-libs/openssl-1.0.2r 
[ebuild   R    ] dev-perl/Net-SSLeay-1.650.0-r1 
[ebuild   R    ] dev-perl/IO-Socket-SSL-2.24.0 
[ebuild   R    ] dev-perl/Net-SMTP-SSL-1.30.0 
[ebuild   R    ] virtual/pkgconfig-0-r1 
[ebuild   R    ] sys-libs/readline-6.3_p8-r2 
[ebuild   R    ] dev-util/gtk-doc-am-1.25-r1 
[ebuild   R    ] dev-libs/libpcre-8.41-r1 
[ebuild   R    ] sys-devel/automake-1.15.1-r2 
[ebuild   R    ] sys-devel/libtool-2.4.6-r6 
[ebuild   R    ] dev-libs/expat-2.2.5 
[ebuild   R    ] dev-db/sqlite-3.23.1-r2 
[ebuild   R    ] app-text/sgml-common-0.6.3-r5 
[ebuild   R    ] net-misc/curl-7.62.0 
[ebuild   R    ] dev-libs/libuv-1.20.0 
[ebuild   R    ] dev-libs/iniparser-3.1-r1 
[ebuild   R    ] dev-lang/python-2.7.10-r8 
[ebuild   R    ] dev-lang/python-3.4.7-r2 
[ebuild   R    ] dev-lang/python-3.6.5-r1 
[ebuild   R    ] app-portage/portage-utils-0.63 
[ebuild   R    ] dev-perl/XML-Parser-2.410.0-r2 
[ebuild   R    ] dev-libs/libxml2-2.9.8-r2 
[ebuild   R    ] dev-util/ninja-1.8.2 
[ebuild   R    ] app-misc/ca-certificates-20180409.3.37 
[ebuild   R    ] dev-python/pyelftools-0.24 
[ebuild   R    ] sys-devel/gettext-0.19.8.1 
[ebuild   R    ] app-misc/pax-utils-1.2.2 
[ebuild   R    ] app-text/docbook-xml-dtd-4.1.2-r6 
[ebuild   R    ] sys-apps/attr-2.4.47-r2 
[ebuild   R    ] sys-apps/util-linux-2.32-r3 
[ebuild   R    ] sys-devel/make-4.2.1-r4 
[ebuild   R    ] sys-apps/sed-4.4-r1 
[ebuild   R    ] sys-devel/flex-2.5.39-r1 
[ebuild   R    ] sys-apps/texinfo-6.1 
[ebuild   R    ] dev-util/intltool-0.50.2-r2 
[ebuild   R    ] sys-libs/e2fsprogs-libs-1.44.1 
[ebuild   R    ] dev-perl/Locale-gettext-1.50.0-r2 
[ebuild   R    ] sys-apps/findutils-4.4.2-r2 
[ebuild   R    ] sys-apps/sandbox-2.11-r3 
[ebuild   R    ] dev-libs/popt-1.16-r2 
[ebuild   R    ] dev-libs/libgpg-error-1.12 
[ebuild   R    ] sys-devel/bison-3.0.4-r1 
[ebuild   R    ] sys-apps/acl-2.2.52-r1 
[ebuild   R    ] sys-apps/help2man-1.46.6 
[ebuild   R    ] sys-fs/e2fsprogs-1.44.1 
[ebuild   R    ] dev-libs/libpcre2-10.30 
[ebuild   R    ] app-arch/tar-1.29-r3 
[ebuild   R    ] net-misc/rsync-3.1.3 
[ebuild   R    ] sys-devel/patch-2.7.5 
[ebuild   R    ] dev-vcs/git-2.20.1 
[ebuild   R    ] sys-apps/coreutils-8.25 
[ebuild   R    ] app-arch/libarchive-3.3.1 
[ebuild   R    ] virtual/yacc-0 
[ebuild   R    ] sys-devel/automake-1.14.1 
[ebuild   R    ] dev-util/cmake-3.7.2 
[ebuild   R    ] app-shells/bash-4.3_p48-r1 
[ebuild   Rf   ] sys-devel/binutils-2.27.0-r12 
[ebuild   R    ] dev-libs/libgcrypt-1.6.3-r3 
[ebuild   R    ] dev-libs/libxslt-1.1.32 
[ebuild   R    ] dev-python/setuptools-36.7.2-r1 
[ebuild   R    ] sys-apps/file-5.34 
[ebuild   R    ] dev-python/certifi-2017.4.17-r2 
[ebuild   R    ] dev-python/pyblake2-1.1.2-r1 
[ebuild   R    ] dev-python/pyxattr-0.5.5-r1 
[ebuild   R    ] app-admin/eselect-1.4.8 
[ebuild   R    ] sys-apps/portage-2.3.49-r27 
[ebuild   R    ] dev-libs/glib-2.52.3-r2 
[ebuild   R    ] dev-util/pkgconfig-0.28-r2 
[ebuild   R    ] x11-misc/shared-mime-info-1.4 
[ebuild     U  ] sys-devel/llvm-8.0_pre349610_p20190109-r13 [8.0_pre349610_p20190109-r12]
[ebuild     U  ] sys-devel/lld-8.0_pre349610-r6 [8.0_pre349610-r5]
[blocks b      ] <=sys-devel/lld-8.0_pre349610-r5 ("<=sys-devel/lld-8.0_pre349610-r5" is blocking sys-devel/llvm-8.0_pre349610_p20190109-r13)


So even though with the "--emptytree" flag, the output still include "sys-devel/lld-8.0_pre349610-r5" package, whose ebuild has been deleted from ChromeOS source.
$ ls sys-devel/lld/
lld-8.0_pre349610.ebuild  lld-8.0_pre349610-r6.ebuild  metadata.xml


(Fuller context is in crbug.com/938605)



**************************** EXTRA INFOS ***********************************

Emerge info's output:
 $ emerge --info sys-devel/lld
Portage 2.3.49 (python 2.7.10-final-0, !/usr/local/portage/chromiumos/profiles/default/linux/amd64/10.0/sdk, gcc-4.9.2, glibc-2.27-r8, 4.19.12-1rodete1-amd64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.12-1rodete1-amd64-x86_64-Intel-R-_Xeon-R-_Gold_6154_CPU_@_3.00GHz-with-glibc2.2.5
KiB Mem:   196726080 total,   5570684 free
KiB Swap:  199884796 total, 199789308 free
sh bash 4.3_p48-r1
ld GNU ld (binutils-2.27.0-r12-cce69c1b1bfc46de5e1cdd4923f87215c0edb884_cos_gg) 2.27.0.20170315
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p48-r1::portage-stable
dev-java/java-config:     2.2.0-r3::portage-stable
dev-lang/python:          2.7.10-r8::chromiumos, 3.4.7-r2::chromiumos, 3.6.5-r1::chromiumos
dev-util/ccache:          3.2.4::portage-stable
dev-util/cmake:           3.7.2::portage-stable
dev-util/pkgconfig:       0.28-r2::portage-stable
sys-apps/baselayout:      2.2-r1::chromiumos
sys-apps/sandbox:         2.11-r3::chromiumos
sys-devel/autoconf:       2.69::portage-stable
sys-devel/automake:       1.10.3-r1::portage-stable, 1.11.6-r1::portage-stable, 1.14.1::portage-stable, 1.15.1-r2::portage-stable
sys-devel/binutils:       2.27.0-r12::chromiumos
sys-devel/gcc:            4.9.2-r203::chromiumos
sys-devel/gcc-config:     1.7.3::portage-stable
sys-devel/libtool:        2.4.6-r6::chromiumos
sys-devel/make:           4.2.1-r4::portage-stable
sys-kernel/linux-headers: 4.14-r5::chromiumos (virtual/os-headers)
sys-libs/glibc:           2.27-r8::chromiumos
Repositories:

portage-stable
    location: /mnt/host/source/src/third_party/portage-stable
    masters: eclass-overlay
    priority: -1000

crossdev
    location: /usr/local/portage/crossdev
    masters: portage-stable eclass-overlay chromiumos
    priority: 0

chromiumos
    location: /mnt/host/source/src/third_party/chromiumos-overlay
    masters: portage-stable eclass-overlay
    priority: 1

eclass-overlay
    location: /mnt/host/source/src/third_party/eclass-overlay
    priority: 2

chromeos-partner
    location: /mnt/host/source/src/private-overlays/chromeos-partner-overlay
    masters: portage-stable chromiumos eclass-overlay
    priority: 3

chromeos
    location: /mnt/host/source/src/private-overlays/chromeos-overlay
    masters: portage-stable chromiumos eclass-overlay
    priority: 4

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA @CHROMEOS"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc/hosts /etc/locale.gen /etc/localtime /etc/make.conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/lib/portage/distfiles"
EMERGE_DEFAULT_OPTS="--oneshot"
FCFLAGS=""
FEATURES="allow-missing-manifests assume-digests binpkg-logs buildpkg clean-logs config-protect-if-modified distlocks fixlafiles force-mirror multilib-strict network-sandbox news parallel-fetch parallel-install protect-owned sandbox sfperms unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
GENTOO_MIRRORS="https://commondatastorage.googleapis.com/chromeos-localmirror https://commondatastorage.googleapis.com/chromeos-mirror/gentoo"
INSTALL_MASK="   /usr/lib*/*.la   /etc/init.d /etc/conf.d   /etc/logrotate.d "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,-O2 -Wl,--as-needed"
MAKEOPTS="-j72"
PKGDIR="/var/lib/portage/pkgs"
PORTAGE_BINHOST="gs://chromeos-prebuilt/host/amd64/tatl/paladin-R73-11408.0.0-rc2/packages/ gs://chromeos-prebuilt/host/amd64/amd64-generic/paladin-R73-11408.0.0-rc2/packages/ gs://chromeos-prebuilt/host/amd64/tael/paladin-R73-11408.0.0-rc2/packages/ gs://chromeos-prebuilt/host/amd64/moblab-generic-vm/paladin-R73-11408.0.0-rc2/packages/ gs://chromeos-prebuilt/host/amd64/arm-generic/paladin-R73-11408.0.0-rc2/packages/ gs://chromeos-prebuilt/host/amd64/amd64-host/chroot-2019.03.20.100611/packages/"
PORTAGE_BUNZIP2_COMMAND="pbunzip2 --ignore-trailing-garbage=1"
PORTAGE_BZIP2_COMMAND="pbzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 bzip2 cros_host crypt cxx dri fortran hardened iconv internal ipv6 mmx mmxext modules mudflap multilib ncurses nls nptl nptlonly openmp pic pie python readline sse sse2 ssl sysfs transparent_hugepage unicode vaapi xattr xorg zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="aarch64 arm i386 mips mips64 mips64el mipsel x86_64" QEMU_USER_TARGETS="aarch64 arm i386 mips mips64 mips64el mipsel x86_64" RUBY_TARGETS="ruby19 ruby18" TTY_CONSOLE="tty2" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, ENV_UNSET, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/lld-8.0_pre349610-r5::chromiumos was built with the following:
USE="-llvm-next" ABI_X86="(64)"
CFLAGS="-O2 -pipe -stdlib=libc++"
CXXFLAGS="-O2 -pipe -stdlib=libc++"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,-O2 -Wl,--as-needed -stdlib=libc++"
Comment 1 Brian Evans (RETIRED) gentoo-dev 2019-03-22 16:58:37 UTC
(In reply to nednguyen from comment #0)
> In ChromeOS project, we uses "emerge --pretend --emptytree --sysroot=<path>
> <package X>" to query the dependency graph of the packages.
> 
> I recently found out that this command does include the obsolete packages
> (built, but no longer exist in the portage tree) in its output.
> 
> For example, in ChromeOS chroot, I run:
> 
> $ emerge --pretend --emptytree sys-devel/lld
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
...
> [ebuild     U  ] sys-devel/llvm-8.0_pre349610_p20190109-r13
> [8.0_pre349610_p20190109-r12]
> [ebuild     U  ] sys-devel/lld-8.0_pre349610-r6 [8.0_pre349610-r5]
> [blocks b      ] <=sys-devel/lld-8.0_pre349610-r5
> ("<=sys-devel/lld-8.0_pre349610-r5" is blocking
> sys-devel/llvm-8.0_pre349610_p20190109-r13)
> 
> 
> So even though with the "--emptytree" flag, the output still include
> "sys-devel/lld-8.0_pre349610-r5" package, whose ebuild has been deleted from
> ChromeOS source.
> $ ls sys-devel/lld/
> lld-8.0_pre349610.ebuild  lld-8.0_pre349610-r6.ebuild  metadata.xml
> 


This looks to be normal and expected.

The line '[blocks b      ] <=sys-devel/lld-8.0_pre349610-r5 ("<=sys-devel/lld-8.0_pre349610-r5" is blocking'  is saying a version less than or equal to -r5 is blocking, but the little 'b' means it is auto-resolved via the previous line (aka the upgrade).  It is *not* referring to wanting to install -r5
Comment 2 nednguyen 2019-03-22 17:02:22 UTC
Hi Brian,
Thanks for your quick response. Though with the "--emptytree" flag, I expect emerge to ignore the current status of the build root, so the line "[blocks b      ] <=sys-devel/lld-8.0_pre349610-r5 ("<=sys-devel/lld-8.0_pre349610-r5" is blocking sys-devel/llvm-8.0_pre349610_p20190109-r13)" shouldn't exist to begin with.

Lemme know if I misinterpret the meaning of "--emptytree" flag