toolchain.eclass: tweak Ada, D deps

Without this, we can end up with something like:
```
[ebuild  NS    ] sys-devel/gcc-11.5.0:11::gentoo [13.3.1_p20240614:13::gentoo] USE="(ada*) cet (cxx) (d*) [...]"
[ebuild   R    ]  sys-devel/gcc-13.3.1_p20240614:13::gentoo  USE="(ada*) cet (cxx) (d*) [...]"

Total: 2 packages (1 in new slot, 1 reinstall), Size of downloads: 0 KiB

 * Error: circular dependencies:

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

Portage sees sys-devel/gcc[ada] is queued and tries to use it to satisfy
the dep for 11, which pulls in 13, which pulls in 11 for D.

We can workaround this by depending on older GCC for whatever slot we're
in. This matches upstream documentation and also reality as you usually
need an older version anyway.

See also 370253f008a8922c9aebe8099ab9c34bd6947f66 in binhost.git.

Bug: https://bugs.gentoo.org/880825
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2024-09-30 06:54:07 +01:00
parent 0c8f962849
commit 1bc16717ff

View File

@@ -402,7 +402,7 @@ if tc_has_feature valgrind ; then
fi
if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then
BDEPEND+=" ada? ( || ( sys-devel/gcc[ada] dev-lang/gnat-gpl[ada] ) )"
BDEPEND+=" ada? ( || ( sys-devel/gcc:${SLOT}[ada] <sys-devel/gcc-${SLOT}[ada] dev-lang/gnat-gpl[ada] ) )"
fi
# TODO: Add a pkg_setup & pkg_pretend check for whether the active compiler
@@ -411,7 +411,7 @@ if tc_has_feature d && tc_version_is_at_least 12.0 ; then
# D in 12+ is self-hosting and needs D to bootstrap.
# TODO: package some binary we can use, like for Ada
# bug #840182
BDEPEND+=" d? ( || ( sys-devel/gcc[d(-)] <sys-devel/gcc-12[d(-)] ) )"
BDEPEND+=" d? ( || ( sys-devel/gcc:${SLOT}[d(-)] <sys-devel/gcc-${SLOT}[d(-)] <sys-devel/gcc-12[d(-)] ) )"
fi
if tc_has_feature rust && tc_version_is_at_least 14.0.0_pre20230421 ; then