Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 105231 - unexpected behavior of emerge -k in conjunction with -uDN
Summary: unexpected behavior of emerge -k in conjunction with -uDN
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 105232 111210 (view as bug list)
Depends on:
Blocks: 108082
  Show dependency tree
 
Reported: 2005-09-08 02:20 UTC by Sascha Lucas
Modified: 2009-10-08 14:53 UTC (History)
2 users (show)

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


Attachments
output of emerge -uDNkvp world on the target (tmp,147 bytes, text/plain)
2005-09-08 02:33 UTC, Sascha Lucas
Details
output of emerge -kpv catalyst on the target (tmp,215 bytes, text/plain)
2005-09-08 02:35 UTC, Sascha Lucas
Details
output from emerge -uDNvp world on the target (tmp,669 bytes, text/plain)
2005-09-08 02:40 UTC, Sascha Lucas
Details
Heavy handed fix (fix-newuse-with-binaries.patch,4.06 KB, patch)
2005-09-29 06:17 UTC, Jason Stubbs (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Lucas 2005-09-08 02:20:02 UTC
I have one machine called the buildhost and other called targethosts. On the 
buildhost I make binarys for the targets. build and targethost are nearly 
identical (same portage, same /etc/portage/*, same profile, same make.conf). The 
only exception is in USE flags and FEATURES. On the buildhost I have USE="3dnow 
mmxext" + FEATURES="buildpkg" and on the target USE="-3dnow -mmxext sse". This 
flags affect only some ebuilds (i.e. xorg, mplayer, ...). If I change a USE 
flage (on both build and target), then remerge via "emerge -uDN world" on the 
buildhost, new binarys are created with the new USE flags. Using this binarys on 
the target via "emerge -kuDNpv world" would not show the changed USE flag. 
However if I know pkg_A was affected by the new USE flag I can do "emerge -1kpv 
pkg_A". Then the change is shown and used (without -pv).

Reproducible: Always
Steps to Reproduce:
I take catalyst as an example

1. verify current USE flags of catalyst (build and target are identical)
   # equery uses catalyst
    U I
    + + doc      : Adds extra documentation (API, Javadoc, etc)
    + + ccache   : Enables ccache support
    - + cdr      : Adds support for CD writer hardware
    + + examples : Install example source code
2. change a USE flage on both i.e. via /etc/portage/package.use
   #dev-util/catalyst              doc ccache examples
   dev-util/catalyst               ccache examples

3. reflect the change on both with "emerge -uDNpv world". On the buildhost 
remerge and create new binary with "emerge -uDN world" (--buildpkg is in 
FEATURES).

4. make the new binary accessable for the targethost (mount PKGDIR via nfs, or 
copy over binary,...). I use "mount -o ro -t nfs buildhost:/usr/portage/packages 
/usr/portage/packages/"

5. try to update the target with "emerge -kuDNpv world". This will _not_ show 
the changed USE flag.

6. use "emerge -kpv catalyst" to get what you want with 5.
Actual Results:  
emerge -kuDNpv world on target makes not the right thing if USE flags have 
changed. Even if the binary is aviable with right USE flags.

Expected Results:  
"emerge -kuDNpv world" should behave like without -k (expect for build 
dependencies). It should use binary if aviable or fallback to ebuild.

I hope I could expres my problem. Perhaps there is only a missunderstanding. We 
discussed it at the user-ml, but no one seems to know a solution.
Comment 1 Jason Stubbs (RETIRED) gentoo-dev 2005-09-08 02:23:19 UTC
Can you attach the output of `emerge -uDNkvp world` on a target host please?
Comment 2 Sascha Lucas 2005-09-08 02:33:34 UTC
Created attachment 67909 [details]
output of emerge -uDNkvp world  on the target
Comment 3 Sascha Lucas 2005-09-08 02:35:13 UTC
Created attachment 67910 [details]
output of emerge -kpv catalyst on the target
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-09-08 02:36:07 UTC
*** Bug 105232 has been marked as a duplicate of this bug. ***
Comment 5 Sascha Lucas 2005-09-08 02:40:45 UTC
Created attachment 67911 [details]
output from emerge -uDNvp world on the target

you can ignore build-deps (the target is a pure binary pkg installed system).
But the change in catalyst is shown.
Comment 6 Sascha Lucas 2005-09-29 03:02:13 UTC
Hi,

I have new steps to reproduce this bug. It can be reproduced by everyone running 
gentoo without the build->target setup, just on a single machine. I'll take dev-
util/catalyst as the example again.

Step 1: If not already, install dev-util/catalyst regardless of any use flag.

Step 2: check your current use flags of dev-util/catalyst with equery from 
gentoolkit. Example:

# equery uses dev-util/catalyst
[ Searching for packages matching dev-util/catalyst... ]
[ Colour Code : set unset ]
[ Legend    : Left column  (U) - USE flags from make.conf              ]
[           : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for dev-util/catalyst-1.1.10.10 ]
 U I
 - - doc      : Adds extra documentation (API, Javadoc, etc)
 - - ccache   : Enables ccache support
 - - cdr      : Adds support for CD writer hardware
 - - examples : Install example source code

Step 3: make a binary package. It doesn't matter if you use 
emerge --buildpkgonly or quickpkg. Example using quickpkg:

# quickpkg catalyst
 * Building package for catalyst-1.1.10.10 ...                                   
                                                   [ ok ]

 * Packages now in /usr/portage/packages:
 * catalyst-1.1.10.10: 589K

Step 4: change a use flag of catalyst. it doesn't matter where you change it 
(make.conf, portage.use, env-var USE). However in this example I prefer the per 
package use flags in /etc/portage/package.use, because later I will run emerge -
uDN world and this should affect only catalyst not anything else in world. 
Example:

echo 'dev-util/catalyst doc' >> /etc/portage/package.use

Step 5: update your world with the new use flag (emerge -uDN world). The output 
of -pv should look like this:

# emerge -uDNpv world

These are the packages that I would merge, in order:

Calculating world dependencies ...done!
[ebuild   R   ] dev-util/catalyst-1.1.10.10  -ccache -cdr +doc* -examples 0 kB

NOTE: the changed use flage is represented by +doc*
NOTE: you may also use emerge -uDNpv catalyst if your world has more changes 
then just these in catalyst
NOTE: make sure you have not FEATURES="buildpkg" in your make.conf
NOTE: do not merge with --buildpkg or --buildpkgonly (-b/-B)

Step 6: revert back to the old use flage before Step 5. using the binary package 
created in Step 3. Uncomment in /etc/portage/package.use (should look like this
):

#dev-util/catalyst doc

update your world/catalyst using binary if possible: emerge -uDNk world does 
nothing. The output of -pv shows nothing. Thats the bug.

NOTE: again you may also just run emerge -uDNk catalyst if world has to much 
changes

===============================

The interesting thing is you can remerge the binary and then the changed flags 
will be respected. Example output:

# emerge -kpv catalyst

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[binary   R   ] dev-util/catalyst-1.1.10.10  -ccache -cdr -doc* -examples

NOTE: the [binary   R   ] and -doc*

===============================

This is how it works now for me and for some other too. I interpret the options 
-uDNk in this way that it should catch the new use flag from binary package. If 
this is not the intention of -uDNk then it is immpossible for me to manage 100/
1000s of gentoo machines.
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2005-09-29 04:57:29 UTC
# emerge -vp eselect 
[ebuild   R   ] app-admin/eselect-0.9.6  -bash-completion -doc 0 kB 
 
# emerge -kvp eselect 
[binary   R   ] app-admin/eselect-0.9.6  -bash-completion +doc* 
 
# grep eselect /var/lib/portage/world 
app-admin/eselect 
 
# USE="doc" emerge -uDNkvp world | grep eselect 
[nothing] 
 
 
(Just a note to show clearly how it's reproducable.) 
Comment 8 Jason Stubbs (RETIRED) gentoo-dev 2005-09-29 06:17:25 UTC
Created attachment 69485 [details, diff]
Heavy handed fix

This kills of a lot of duplication and effectively fixes it by handing
processing to another copy of the algorithm that works just a little bit
better.
Comment 9 Jason Stubbs (RETIRED) gentoo-dev 2005-10-04 08:39:43 UTC
Fixed in portage-2.0.53_rc3 
Comment 10 Sascha Lucas 2005-10-10 03:47:55 UTC
(In reply to comment #9)
> Fixed in portage-2.0.53_rc3 

Hi, 

sorry for beeing late, I was offline for a week. In between I played with your 
patch and it seems to do the job well (just added some packages and changed some 
USE flags). It takes binary when ever possible (and estimated), else it falls 
back to ebuild. Thats what I need. Thanks a lot.
Comment 11 Zac Medico gentoo-dev 2005-11-02 00:04:12 UTC
*** Bug 111210 has been marked as a duplicate of this bug. ***
Comment 12 onip 2009-10-08 09:42:44 UTC
I'm experiencing this problem. I've got my desktop pc (an old p4) used as a buildhost and sharing /usr/portage/packages in my lan with nfs. This packages are used (after mounting the dir) on the laptop too, which is newer and has some USE differences (smp, laptop for example)

# emerge -pkv sys-apps/hal

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

Calculating dependencies... done!
[binary   R   ] sys-apps/hal-0.5.13-r2  USE="X acpi consolekit -apm -crypt -debug -dell -disk-partition -doc -laptop* -policykit (-selinux)" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB


as you can see it wants to install binary package even if use doesn't match.

I'm using stable portage (2.1.6.13)
Comment 13 Zac Medico gentoo-dev 2009-10-08 14:53:48 UTC
(In reply to comment #12)
> as you can see it wants to install binary package even if use doesn't match.

You can use --newuse to avoid that. Current 2.2_rc* releases also have a --binpkg-respect-use option to trigger equivalent behavior. It will be included in portage-2.1.7.