Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 950310 - Inefficient dependencies resolution for sys-devel/gcc[d] (more optimal path is possible)
Summary: Inefficient dependencies resolution for sys-devel/gcc[d] (more optimal path i...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-26 13:54 UTC by Karlson2k
Modified: 2025-03-09 21:54 UTC (History)
4 users (show)

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


Attachments
Pytest output from simplified test case (pytest-output.txt,20.97 KB, text/plain)
2025-02-26 14:37 UTC, Alfred Wingate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karlson2k 2025-02-26 13:54:31 UTC
I'm trying emerge GCC-14 with additional D language.

emerge wants to build gcc-11.5.0, then gcc-12.4.1_p20241219, then gcc-13.3.1_p20241220 and only then gcc-14.2.1_p20241221. All versions from 11 to 14.

However, when I emerged just gcc-11.5.0 manually, emerge is going to build gcc-14 directly.

First attempt: 

---------------------------------------
# emerge -1pv gcc

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

Calculating dependencies... done!
Dependency resolution took 11.86 s (backtrack: 3/20).

[ebuild  NS    ] sys-devel/gcc-11.5.0:11::gentoo [14.2.1_p20241221:14::gentoo] USE="cet (cxx) d* fortran graphite lto nls openmp pgo (pie) sanitize ssp zstd -ada -custom-cflags -debug -doc (-fixed-point) -go -hardened -jit (-libssp) (-multilib) -objc -objc++ -objc-gc (-pch) -systemtap -test -valgrind -vanilla -vtv (-default-stack-clash-protection%*) (-default-znow%*) (-ieee-long-double%) (-modula2%) (-rust%) (-time64%)" 0 KiB
[ebuild  NS    ] sys-devel/gcc-12.4.1_p20241219:12::gentoo [14.2.1_p20241221:14::gentoo] USE="cet (cxx) d* (default-stack-clash-protection) (default-znow) fortran graphite lto nls openmp pgo (pie) sanitize ssp zstd -ada -custom-cflags -debug -doc (-fixed-point) -go -hardened (-ieee-long-double) -jit (-libssp) (-multilib) -objc -objc++ -objc-gc (-pch) -systemtap -test -valgrind -vanilla -vtv (-modula2%) (-rust%) (-time64%)" 78 065 KiB
[ebuild  NS    ] sys-devel/gcc-13.3.1_p20241220:13::gentoo [14.2.1_p20241221:14::gentoo] USE="cet (cxx) d* (default-stack-clash-protection) (default-znow) fortran graphite lto nls openmp pgo (pie) sanitize ssp zstd -ada -custom-cflags -debug -doc (-fixed-point) -go -hardened (-ieee-long-double) -jit (-libssp) -modula2 (-multilib) -objc -objc++ -objc-gc (-pch) -systemtap -test -valgrind -vanilla -vtv (-rust%) (-time64%)" 82 524 KiB
[ebuild   R    ] sys-devel/gcc-14.2.1_p20241221:14::gentoo  USE="cet (cxx) d* (default-stack-clash-protection) (default-znow) fortran graphite lto nls openmp pgo (pie) sanitize ssp zstd -ada -custom-cflags -debug -doc (-fixed-point) -go -hardened (-ieee-long-double) -jit (-libssp) -modula2(-multilib) -objc -objc++ -objc-gc (-pch) -rust -systemtap -test (-time64) -valgrind -vanilla -vtv" 0 KiB

Total: 4 packages (3 in new slots, 1 reinstall), Size of downloads: 160 589 KiB
=======================================

All versions, from gcc-11 up to the current stable gcc-14.

Then, after successfully performing "emerge -1av =sys-devel/gcc-11.5.0":

---------------------------------------
# emerge -1pv gcc

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

Calculating dependencies... done!
Dependency resolution took 5.16 s (backtrack: 1/20).

[ebuild   R    ] sys-devel/gcc-14.2.1_p20241221:14::gentoo  USE="cet (cxx) d* (default-stack-clash-protection) (default-znow) fortran graphite lto nls openmp pgo (pie) sanitize ssp zstd -ada -custom-cflags -debug -doc (-fixed-point) -go -hardened (-ieee-long-double) -jit (-libssp) -modula2(-multilib) -objc -objc++ -objc-gc (-pch) -rust -systemtap -test (-time64) -valgrind -vanilla -vtv" 0 KiB

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

=======================================
Comment 1 Alfred Wingate 2025-02-26 14:09:07 UTC
Looks a like a dumber https://bugs.gentoo.org/947587
Comment 2 Karlson2k 2025-02-26 14:12:09 UTC
It looks like gcc-12 and gcc-13 could be skipped.

Seems that gcc-11 is the only version that can build D language with C compiler. Later versions needs D compiler to build D language.

However, CDG-11 is enough to build CDG-14 and extra steps (CDG-12 and CDG-13) would be just wasted.
Comment 3 Karlson2k 2025-02-26 14:21:38 UTC
Seems that this bug is related to https://bugs.gentoo.org/947587, but a bit different.

In this case gcc-11 is required to bootstrap CDG, but intermediate gcc-12 and gcc-13 are NOT reqruired and must not be built.
Comment 4 Alfred Wingate 2025-02-26 14:37:15 UTC
Created attachment 919934 [details]
Pytest output from simplified test case

Made a PR documenting these failures, attachment is pytest output from this (with xfail removed).

https://github.com/gentoo/portage/pull/1428
Comment 5 Larry the Git Cow gentoo-dev 2025-03-09 21:54:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f6afc11b91a9f327476593086cfa2bf16f205f4

commit 3f6afc11b91a9f327476593086cfa2bf16f205f4
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2025-02-26 14:29:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-03-09 21:54:05 +0000

    tests: resolver: Add xfail test for D bootstrap chain (bug #950310)
    
    Bug: https://bugs.gentoo.org/950310
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/portage/pull/1428
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/portage/tests/resolver/test_bootstrap_deps.py | 58 +++++++++++++++++++++++
 1 file changed, 58 insertions(+)