Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 865829 - ada.eclass currently supports only gnat_2021 and gnat_2020. For Ada 2022 support, GCC >= 12 will be required.
Summary: ada.eclass currently supports only gnat_2021 and gnat_2020. For Ada 2022 supp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Linux ADA team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-08-19 21:48 UTC by Andrew Athalye
Modified: 2022-09-17 13:59 UTC (History)
2 users (show)

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


Attachments
Patch to be applied to the current ada.eclass for gnat_2022 support (ada-eclass-gnat_2022.diff,1.32 KB, patch)
2022-08-19 21:49 UTC, Andrew Athalye
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Athalye 2022-08-19 21:48:01 UTC
ada.eclass currently does not have support for GNAT-FSF. I propose adding a new Ada Target, "gnat_2022", that pulls in sys-devel/gcc:12 [ada] to provide Ada 2022 support, since GNAT-GPL will not be receiving further updates.

Reproducible: Always

Steps to Reproduce:
N/A
Actual Results:  
N/A


A patch for ada.eclass will be attached shortly. This works with existing Ada packages without any modifications, and allows compatible apps to support ADA_TARGET="gnat_2022" to use GNAT FSF. With this setup, GPRBuild works out of the box - I did not check any other apps, but I have no reason to suspect that they wouldn't work.
Comment 1 Andrew Athalye 2022-08-19 21:49:04 UTC
Created attachment 800201 [details, diff]
Patch to be applied to the current ada.eclass for gnat_2022 support

Added patch. The patch will only be functional once gcc [ada] is unmasked, however if that is done than it can be used even now.
Comment 2 Andrew Athalye 2022-08-22 21:42:14 UTC
After some additional thought, I'd like to note a few issues with Gentoo's current Ada support:

1. GNAT does not have a stable ABI between major GCC versions. This could be addressed by forcing a rebuild of all Ada packages when the GCC slot is changed.

2. Related to the above, defining an annual gnat_ version doesn't make much sense. Instead, we could use ADA_COMPAT to refer to the minimum Ada language specification required. Then something like:

dev-ada/gprbuild - ADA_TARGET="gnat_95" will automatically select a GCC version with full support for that Ada feature level.

Hypothetically, app-arch/unkompress - ADA_TARGET="gnat_2022" should pull the latest available GCC or fail, since Ada 2022 is not yet ratified. GCC 12 has ~90% support for it, but even still that would be unacceptable for a stable package, so all packages requiring gnat_2022 would be put in ~arch.

We could define "gnat_2020" and "gnat_2021" as equivalent to "gnat_2012" for the sake of compatibility, and make.conf could be used to select the Ada implementations you are willing to use, just as now.
Comment 3 Tupone Alfredo gentoo-dev 2022-09-01 19:12:41 UTC
why not adding something like gcc_12_1_1 together with gnat_2020 and gnat_2021.

I do not mean to add gcc_x_y_z for any gcc version, but only for those that we choose as possible target, and for which the ada packages in the portage tree are tested.
Comment 4 Tupone Alfredo gentoo-dev 2022-09-01 20:00:20 UTC
or maybe fsf_2022_r1.

Annual releases will not work anymore, I agree
Comment 5 Tupone Alfredo gentoo-dev 2022-09-17 13:59:24 UTC
sys-devel/gcc-12.2.0* is used now by set ADA_TARGET="gcc_12_2_0"