alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
288 stars 49 forks source link

Set a explicit Ada version in the default `alire.toml` #1361

Closed mosteo closed 1 year ago

mosteo commented 1 year ago

I have realized that we are currently using the compiler default for the Ada version in our generated config. So, when at some point GNAT compilers default to Ada 2022, this may break crates as is usual in corner cases with ambiguities, access checks...

It would be safer if we fixed the version to be used with the crate at the point of creation. This would mean to add to our default alire.toml the following:

[build-switches]
"*".ada_version = "Ada12"

This probably can be incorporated to the questions we ask during alr init, so the user can pick another version at that time without needing to edit the manifest.

Any drawbacks with this plan?

In regard to existing crates, I guess it would be preferable for the version used in generated config/ to default forever to Ada12, as current crates without override in the manifest will I guess all be using that default.

Fabien-Chouteau commented 1 year ago

The new language version is backwards compatible, so even in Ada22 mode Alire should compile as is. The only potential problem will be when building in dev or validation modes because of warnings and style checks. But that's also the case for any new version of the compiler.

As long as we don't plan to use Ada22 feature, I think it's ok to leave it as is.

mosteo commented 1 year ago

I was thinking for example of the reported problems with ambiguities with new subprograms in the containers library, but I see that that should be fixed at some point by AI12-0400-1.

And indeed it's true that compiler version changes are a more usual source of corner cases, but as you say in release mode it shouldn't be that critical, and we don't want to pin compilers anyway.