Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951296 - sys-apps/portage: gcc[ada,d]:SLOT ignores gcc[d]:SLOT when trying to satisfy dependencies
Summary: sys-apps/portage: gcc[ada,d]:SLOT ignores gcc[d]:SLOT when trying to satisfy ...
Status: UNCONFIRMED
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-03-13 15:07 UTC by Andrei Horodniceanu
Modified: 2025-03-13 17:07 UTC (History)
2 users (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 Andrei Horodniceanu 2025-03-13 15:07:06 UTC
Extracted from https://bugs.gentoo.org/947587#c7.

Starting from an installed sys-devel/gcc[d] and trying to turn on the ada use flag leads to portage trying to pull in older gcc slots like in https://bugs.gentoo.org/950310:

-----------
# cat /etc/portage/package.use
sys-devel/gcc d
sys-devel/gcc:14 ada

# quse -IDvp gcc | grep -E 'ada|\bd\b|^sys-devel'
sys-devel/gcc-14.2.1_p20241116
  ada                              <no description found>
  d*                               <no description found>

# emerge -pv gcc \=ada-bootstrap-14

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

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

[ebuild     U  ] app-portage/elt-patches-20250306::gentoo [20241121::gentoo] 0 KiB
[ebuild  N     ] dev-lang/ada-bootstrap-14::gentoo  45,550 KiB
[ebuild  NS    ] sys-devel/gcc-11.5.0:11::gentoo [14.2.1_p20241116:14::gentoo] USE="cet (cxx) d fortran hardened (multilib) nls openmp (pie) sanitize (ssp) zstd -ada (-custom-cflags) -debug -doc (-fixed-point) -go -graphite -jit (-libssp) -lto -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv (-default-stack-clash-protection%*) (-default-znow%*) (-ieee-long-double%) (-modula2%) (-rust%) (-time64%)" 14 KiB
[ebuild  NS    ] sys-devel/gcc-12.4.1_p20241219:12::gentoo [14.2.1_p20241116:14::gentoo] USE="cet (cxx) d (default-stack-clash-protection) (default-znow) fortran hardened (multilib) nls openmp (pie) sanitize (ssp) zstd -ada (-custom-cflags) -debug -doc (-fixed-point) -go -graphite (-ieee-long-double) -jit (-libssp) -lto -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv (-modula2%) (-rust%) (-time64%)" 78,062 KiB
[ebuild  NS    ] sys-devel/gcc-13.3.1_p20241220:13::gentoo [14.2.1_p20241116:14::gentoo] USE="cet (cxx) d (default-stack-clash-protection) (default-znow) fortran hardened (multilib) nls openmp (pie) sanitize (ssp) zstd -ada (-custom-cflags) -debug -doc (-fixed-point) -go -graphite (-ieee-long-double) -jit (-libssp) -lto -modula2 -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv (-rust%) (-time64%)" 0 KiB
[ebuild     U  ] sys-devel/gcc-14.2.1_p20241221:14::gentoo [14.2.1_p20241116:14::gentoo] USE="ada* cet (cxx) d (default-stack-clash-protection) (default-znow) fortran hardened (multilib) nls openmp (pie) sanitize (ssp) zstd (-custom-cflags) -debug -doc (-fixed-point) -go -graphite (-ieee-long-double) -jit (-libssp) -lto -modula2 -objc -objc++ -objc-gc (-pch) -pgo -rust -systemtap -test (-time64) -valgrind -vanilla -vtv" 0 KiB

Total: 6 packages (2 upgrades, 1 new, 3 in new slots), Size of downloads: 123,625 KiB
-----------

Satisfying <sys-devel/gcc-14[d] leads to the correct result:
-----------
# cat /etc/portage/package.use
sys-devel/gcc d
sys-devel/gcc:14 ada

# quse -IDvp gcc | grep -E 'ada|\bd\b|^sys-devel'
sys-devel/gcc-14.2.1_p20241116
  ada                              <no description found>
  d*                               <no description found>
sys-devel/gcc-13.3.1_p20241220
  ada                              <no description found>
  d*                               <no description found>

# emerge -pv gcc \=ada-bootstrap-14

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

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

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

Total: 3 packages (2 upgrades, 1 new), Size of downloads: 45,550 KiB
-----------

\=ada-bootstrap-14 has been used to help portage figure out the more optimal build path (https://bugs.gentoo.org/947587).


Also, adding the ada use flag to all versions of gcc leads to a broken depgraph:
-----------
# cat /etc/portage/package.use
sys-devel/gcc d
sys-devel/gcc ada

# quse -IDvp gcc | grep -E 'ada|\bd\b|^sys-devel'
sys-devel/gcc-14.2.1_p20241116
  ada                              <no description found>
  d*                               <no description found>
sys-devel/gcc-13.3.1_p20241220
  ada                              <no description found>
  d*                               <no description found>

# emerge -pv gcc \=ada-bootstrap-14

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

Calculating dependencies... done!
Dependency resolution took 4.79 s (backtrack: 4/20).



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

Total: 4 packages (1 upgrade, 2 in new slots, 1 reinstall), Size of downloads: 78,075 KiB

 * Error: circular dependencies:

(sys-devel/gcc-11.5.0:11/11::gentoo, ebuild scheduled for merge) depends on
 (sys-devel/gcc-11.5.0:11/11::gentoo, ebuild scheduled for merge) (buildtime)

 * Note that circular dependencies can often be avoided by temporarily
 * disabling USE flags that trigger optional dependencies.
-----------
Comment 1 Larry the Git Cow gentoo-dev 2025-03-13 17:06:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=899fa83063acb0561e9ccde48627d5f135fc552b

commit 899fa83063acb0561e9ccde48627d5f135fc552b
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2025-03-13 16:38:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-03-13 17:06:29 +0000

    tests: resolver: Add xfail test for ada/D bootstrap chain (bug #951296)
    
    Two tests for cases where the shortcut is first and last in the any-of-many
    dependency respectively.
    
    With current behavior portage can correctly handle it if its first but not
    if its last.
    
    Bug: https://bugs.gentoo.org/951296
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/portage/pull/1430
    Signed-off-by: Sam James <sam@gentoo.org>

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