Skip to content

bootstrap-prefix: stop special USE flags for @system#44

Open
bartoldeman wants to merge 1 commit into
gentoo:masterfrom
ComputeCanada:use-flag-cleanup
Open

bootstrap-prefix: stop special USE flags for @system#44
bartoldeman wants to merge 1 commit into
gentoo:masterfrom
ComputeCanada:use-flag-cleanup

Conversation

@bartoldeman

Copy link
Copy Markdown
Contributor

This change simplifies USE flag handling because all circular dependencies are resolved before the emerge @system.

Since USE is then no longer exported in the script, it also makes sure USE is not set by the user before starting the bootstrap.

This avoids a time-consuming rebuild of GCC during stage3 @world; in fact emerge @world does nothing, but I kept it for now.

Some additional analysis:
from reading the script I saw it does the following (I could not find it documented elsewhere in detail) for RAP specifically:

stage1: build a temporary portage and its dependencies manually
stage2: use that temporary portage to build GCC (+deps)
stage3: build
a) glibc
b) binutils
c) gcc
d) portage
e) @system
f) @world
(+ deps)

up so far stage2 and 3a)-3d) use a long list of USE flags in do_emerge_pkgs() (local myuse), and additionally a set of flags in DISABLE_USE; stage 3e) then only uses DISABLE_USE. This patch merges the DISABLE_USE flags into myuse and stops using DISABLE_USE in stage 3e).

Circular dependencies:

there are 4 documented:

 - nghttp2 -> cmake -> curl -> nghttp2  (http2)      #901101
 - binutils -> zstd -> meson -> python  (zstd)       #967234
 - ensurepip -> python -> ensurepip     (ensurepip)
 - >=python-3.14 -> zstd -> ... python  (build)

The nghttp2 one does not apply anymore since nghttp2 uses autotools again since March 2025:
https://gitweb.gentoo.org/repo/gentoo.git/commit/net-libs/nghttp2?id=a7716d6ed1fbff2e7c27618aa2f7d24bc748f7d1
Of course a cmake user could return in the future. But cmake could then be resolved during stage3d)

The other ones already need to be resolved during stage 3b (binutils) and 3d (python), so no use still doing it during @system.

Comparison:

before:

@system: Total: 166 packages (145 new, 21 reinstalls)
@world: Total: 27 packages (18 new, 9 reinstalls)

after:

@system: Total: 187 packages (163 new, 24 reinstalls)
@world: Total: 0 packages

time for stage3 install (4 cores on a laptop): 5h32 vs 4h21.

I did not check this on non-RAP, it's possible I'm not aware of a gotcha somewhere.

This change simplifies USE flag handling because all circular
dependencies are resolved before the `emerge @system`.

Since USE is then no longer exported in the script, it also makes sure
USE is not set by the user before starting the bootstrap.

This avoids a time-consuming rebuild of GCC during stage3 @world;
in fact emerge @world does nothing, but I kept it for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant