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

Improve `alr toolchain` detection of complete toolchain #1752

Open simonjwright opened 2 months ago

simonjwright commented 2 months ago

See here

Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
NEEDRESTART-VER: 3.5
NEEDRESTART-KCUR: 6.5.0-1025-azure
NEEDRESTART-KEXP: 6.5.0-1025-azure
NEEDRESTART-KSTA: 1
Note: gprbuild=2021.0.0+0778 set as default in global configuration.
ERROR: Release within requested version not found: gnat_native*
ERROR: Use --force to override compatibility checks between installed toolchain components
mosteo commented 2 months ago

It looks like the external gprbuild is being picked up.

It would be still a bug, but could you try to reverse the order of the crates requested? I.e., gnat_native gprbuild rather than the other way around.

simonjwright commented 2 months ago

Quite right.

Having reversed the order, picks up gprbuild 22.0.1 and proceeds to the build (which fails, because of an unaasigned-but-unread variable; so not the fault of this issue!)

mosteo commented 2 months ago

The reason for the issue is that crates are resolved in order and compatibility is checked against the ones already resolved. I guess we can do better, at least if no complete toolchain is found.