diff options
author | Sam James <sam@gentoo.org> | 2024-10-03 04:41:14 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-10-03 04:43:15 +0100 |
commit | c9f79ed713758a95abea32d9c41f4f2a49f999b2 (patch) | |
tree | 632764e37f521e1fad4a2c568d2285dfd682482a /eclass | |
parent | dev-python/pycryptodome: Bump to 3.21.0 (diff) | |
download | gentoo-c9f79ed713758a95abea32d9c41f4f2a49f999b2.tar.gz gentoo-c9f79ed713758a95abea32d9c41f4f2a49f999b2.tar.bz2 gentoo-c9f79ed713758a95abea32d9c41f4f2a49f999b2.zip |
toolchain.eclass: change iteration strategy for GNAT and GDC
This improves upon the strategy from 9bb87839a6ad66ee7c89837a546fbf2e7f69b577
and d1aa56b6e39f07490021e594920f4a965a968c07.
Earlier, I saw building GCC 15's gdc fail w/ bootstrap from 10, even
though we had 11/12/13/14 installed.
The new logic is as follows, with descending order of preference:
1) Match the version being built;
2) Iterate downwards from the version being built;
3) Iterate upwards from the version being built to the greatest version installed.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/toolchain.eclass | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 1c990f1f1114..3cacc2da31b7 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -844,10 +844,11 @@ toolchain_setup_ada() { # GNAT can usually be built using the last major version and # the current version, at least. # - # We always prefer the version being built if possible - # as it has the greatest chance of success. Failing that, - # try GCC 10 and iterate upwards. - for ada_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do + # Order of preference (descending): + # 1) Match the version being built; + # 2) Iterate downwards from the version being built; + # 3) Iterate upwards from the version being built to the greatest version installed. + for ada_candidate in ${SLOT} $(seq -1 $((${SLOT} - 1)) 10) $(seq $((${SLOT} + 1)) ${latest_gcc}) ; do has_version -b "sys-devel/gcc:${ada_candidate}" || continue ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada" @@ -1005,10 +1006,11 @@ toolchain_setup_d() { local d_bootstrap local d_candidate - # We always prefer the version being built if possible - # as it has the greatest chance of success. Failing that, - # try GCC 10 and iterate upwards. - for d_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do + # Order of preference (descending): + # 1) Match the version being built; + # 2) Iterate downwards from the version being built; + # 3) Iterate upwards from the version being built to the greatest version installed. + for d_candidate in ${SLOT} $(seq -1 $((${SLOT} - 1)) 10) $(seq $((${SLOT} + 1)) ${latest_gcc}) ; do has_version -b "sys-devel/gcc:${d_candidate}" || continue ebegin "Testing sys-devel/gcc:${d_candidate} for D" |