Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 81187 - Allow mixing of targets and atoms with emerge
Summary: Allow mixing of targets and atoms with emerge
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All All
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-07 18:38 UTC by Daniel Robbins (RETIRED)
Modified: 2007-01-11 03:49 UTC (History)
1 user (show)

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


Attachments
emerge REBUILD patch (emerge-rebuild.patch,2.45 KB, patch)
2005-02-07 18:39 UTC, Daniel Robbins (RETIRED)
Details | Diff
updated patch that should speed up the --newuse calculation (emerge-rebuild-1.1.patch,2.68 KB, patch)
2005-02-07 22:33 UTC, Daniel Robbins (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Robbins (RETIRED) gentoo-dev 2005-02-07 18:38:01 UTC
Hello,

This is a patch to emerge from portage 2.0.51-r15, which is to my understanding
needed for the 2005.0 release. Here is a description of the functionality
contained in this patch:

Existing behavior: When "emerge [-u][-p] system" is run, emerge's normal
behavior is to build a tree of packages to merge to ensure that the
dependencies listed in the current system profile are satisfied.

This patch adds a new capability to "emerge system", which causes emerge to scan for the existence of a REBUILD file as it is building the dependency
tree. This file is checked on a per-tree-dependency basis and is located at:

/var/db/pkg/category/package-version[-rev]/REBUILD

It performs this check using the official portage aux_get() call. If REBUILD
exists and is not empty, then Portage will ignore the fact that this package
is installed while it is constructing the tree of packages to merge. This will
have the effect of "rebuilding" (ie recompiling/remerging) the package, even
though the package is already installed and may already satisfy the system 
profile dependency.

Rationale:

This new functionality is intended to be used to allow stage2 tarballs to
have certain packages pre-tagged for rebuilding by the releng team, without
having to resort to forcing a rebuild by actually removing the original package's metadata directory from the stage2 tarball. Historically, rebuilding
was forced by deleting entire package directories from /var/db/pkg. This has
been disabled recently in order to address the stray files problem. However,
the ability for certain packages to be auto-rebuilt is still needed. Thus, this
new functionality was created.

Guidelines for use:

Certain packages on a stage2 tarball need forced rebuilding for one of two
reasons:

1) The package had C++ support disabled to allow itself to be built during bootstrap (when no C++ compiler was present);

2) The package had some other functionality or component disabled (such as
man pages) to allow the package to either be built during bootstrap, or take
up less space on the stage1.

The releng team should create REBUILD files from a catalyst script by using
a technique similar to the following:

echo 1 > /var/db/pkg/dev-lang/python-2*/REBUILD

This will tag the current version of python for rebuilding when the end-user
unpacks the stage2 tarball and runs "emerge system." In this particular case,
this will cause python to be rebuilt using the user's current USE settings, 
and with its C++ API re-enabled due to the "bootstrap" use flag not being set.

NOTE: This REBUILD functionality should only be used on packages that are not
slotted in a fine-grained way. This functionality is generally not suited for
libraries that are meant to co-exist on a system (since the old to-be-rebuilt
package will not get auto-cleaned, and thus will get rebuilt every "emerge
system" call.)
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2005-02-07 18:39:44 UTC
Created attachment 50690 [details, diff]
emerge REBUILD patch
Comment 2 Daniel Robbins (RETIRED) gentoo-dev 2005-02-07 22:33:08 UTC
Created attachment 50698 [details, diff]
updated patch that should speed up the --newuse calculation
Comment 3 Daniel Robbins (RETIRED) gentoo-dev 2005-02-07 22:33:42 UTC
I updated the patch to replace a cpv_exists() call I missed. It should speed up the --newuse calculation section a bit.
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-10-16 08:12:06 UTC
Not much for this method.. Support for mixing targets and atoms would be  
better. `emerge sys-devel/gcc system` for example. 
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2005-10-16 08:29:19 UTC
While I agree that moxing targets and atoms are a good capability to have.  This
bug was to resolve a specific problem.  When we perform our stage1->stage2
bootstrapping, several packages are compiled with the user's CFLAGS/USE, etc.
thata re then all *recompiled* in our stage3 "emerge system" due to our newer
requirement for using "emerge -e system" when going from stage2->stage3.  The
original purpose of this patch was to allow for modification of catalyst to
inject a REBUILD into every package in the stage1 tarball.  Packages that get
rebuilt during the stage1->stage2 bootstrap would be missing this REBUILD file,
since it would not be built by catalyst in such a manner.  Once we got to the
"emerge system" stage, we would not be using "-e" at all... instead, portage
would create the dependency tree for all packages that are not merged already,
plus the packages with a REBUILD file in them.  This way, once the stage3 is
completed, each package will have been only compiled once by the user.
Comment 6 Marius Mauch (RETIRED) gentoo-dev 2006-04-04 13:10:37 UTC
I also don't really like this hack, IMHO it should be handled by a wrapper script.
Comment 7 Chris Gianelloni (RETIRED) gentoo-dev 2006-09-14 05:58:19 UTC
Well, we've been using the "rebuild everything" approach for some time now, and users haven't really been complaining, so I'm going to remove myself from CC on this.  I really don't think it is necessary anymore.
Comment 8 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 03:49:18 UTC
Closing.