Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880825 - sys-devel/gcc[ada] may fail to build with a newer version of sys-devel/gcc[ada]
Summary: sys-devel/gcc[ada] may fail to build with a newer version of sys-devel/gcc[ada]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-10 20:22 UTC by Tupone Alfredo
Modified: 2024-09-30 05:57 UTC (History)
0 users

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 Tupone Alfredo gentoo-dev 2022-11-10 20:22:53 UTC
Ada has a strict rules on dependency between its modules. Sometimes is impossible to build from source the gcc[ada] for an older version with a newer gcc[ada]. That depends a lot on when the ada part is updated. I think gentoo should raise a warning, but not block, the gcc build when this condition apply

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-29 00:42:05 UTC
In 799693623d76c89e8b04d2434d0dfece44bb49f9, I used the following rule: 
>    * Iterate over installed GCC slots (preferring ${SLOT}, then iterating
>      from the latest version installed down to GCC 10) to find a copy of
>      GNAT;

We can refine it if needed later.
Comment 2 Larry the Git Cow gentoo-dev 2024-09-29 11:22:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bb87839a6ad66ee7c89837a546fbf2e7f69b577

commit 9bb87839a6ad66ee7c89837a546fbf2e7f69b577
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-29 11:17:33 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-29 11:21:25 +0000

    toolchain.eclass: start with oldest GNAT and work upwards instead
    
    Per https://gcc.gnu.org/install/prerequisites.html
    """
    Similarly, it is strongly recommended to use an older version of GNAT to build GNAT.
    
    More recent versions of GNAT than the version built are not guaranteed to work
    and will often fail during the build with compilation errors.
    """
    
    Bug: https://gcc.gnu.org/PR103357
    Bug: https://bugs.gentoo.org/880825
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2024-09-29 11:28:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c118fbbefc7ab5340c98179908fab2e6fca6b8a

commit 6c118fbbefc7ab5340c98179908fab2e6fca6b8a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-29 11:27:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-29 11:27:39 +0000

    toolchain.eclass: attempt to use gnat-gpl if the bootstrap GNAT is too new
    
    Bug: https://bugs.gentoo.org/880825
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-30 02:50:58 UTC
I think this is probably done-enough.
Comment 5 Larry the Git Cow gentoo-dev 2024-09-30 05:57:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bc16717ffb9819d1f5f03c1fe413be04d378246

commit 1bc16717ffb9819d1f5f03c1fe413be04d378246
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-30 05:54:07 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-30 05:57:22 +0000

    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>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)