Skip to content

Offer uninstalled compiler as fallback with warning#1508

Merged
mosteo merged 8 commits into
alire-project:masterfrom
mosteo:feat/auto-compiler
Nov 21, 2023
Merged

Offer uninstalled compiler as fallback with warning#1508
mosteo merged 8 commits into
alire-project:masterfrom
mosteo:feat/auto-compiler

Conversation

@mosteo

@mosteo mosteo commented Nov 15, 2023

Copy link
Copy Markdown
Member

This one may be controversial.

Currently, we will not try to satisfy a gnat dependency with an uninstalled compiler (specific dependencies like gnat_arm_elf do not fall into this case, only the abstract gnat ones), instead reporting a missing dependency:

$ alr with gnat^12
Requested changes:

   ✓ gnat ^12 (add)
                                                                         
Changes to dependency solution:

   New solution is incomplete.
   +↪ gnat ^12 (new,external)

Do you want to proceed?
[Y] Yes  [N] No  (default is No) 

This doesn't seem very intuitive, as nothing says that installing the proper compiler version would fix the issue. With this PR an installed compiler is still chosen first for the dependency but, when none fits, this will happen:

$ alr with gnat^12
Requested changes:

   ✓ gnat ^12 (add)
                                                                         
Changes to dependency solution:

   +📦 gnat 12.2.1 (new,gnat_native,binary)
   
   ❗ The solution requires the download of
      a toolchain not currently installed.

Do you want to proceed?
[Y] Yes  [N] No  (default is Yes) 

@mosteo mosteo force-pushed the feat/auto-compiler branch from c8f2673 to 100fc0b Compare November 16, 2023 08:32
@mosteo mosteo marked this pull request as ready for review November 16, 2023 08:53
@Fabien-Chouteau

Copy link
Copy Markdown
Member

Hi @mosteo ,

❗ The solution requires the download of
a toolchain not currently installed.

I am not sure about this error message because it doesn't provide a way forward.
In which situations a user would get this message?

@mosteo

mosteo commented Nov 16, 2023

Copy link
Copy Markdown
Member Author

Hi @mosteo ,

❗ The solution requires the download of
a toolchain not currently installed.

I am not sure about this error message because it doesn't provide a way forward. In which situations a user would get this message?

The way forward is simply accepting the solution, and the dependency will be installed normally as a toolchain (as happens currently for explicit compiler dependencies like gnat_native. The message could be rephrased, of course.

This situation happens when a solution (alr with, alr get) requires necessarily a compiler that isn't already installed.

@Fabien-Chouteau

Copy link
Copy Markdown
Member

The way forward is simply accepting the solution, and the dependency will be installed normally as a toolchain (as happens currently for explicit compiler dependencies like gnat_native.

Ok so right now Alire would just show an incomplete solution, but not download the compiler even if it knows how to.
And with this change Alire will download the compiler?

The message could be rephrased, of course.

To me this message is telling the user that something went wrong and there's nothing Alire can do about it.

So maybe we should remove the exclamation mark and the message could be The solution requires a toolchain that is not installed yet. Alire with now proceed to download and install this toolchain.

@mosteo

mosteo commented Nov 16, 2023

Copy link
Copy Markdown
Member Author

Yeah, that's the gist of it.

@mosteo

mosteo commented Nov 16, 2023

Copy link
Copy Markdown
Member Author

New message:

Changes to dependency solution:

   +📦 gnat 12.2.1 (new,gnat_native,binary)
   
   🛈  The solution requires a toolchain that is
      not yet installed. Accepting the solution
      will download and install this toolchain.

@mosteo mosteo merged commit 9864809 into alire-project:master Nov 21, 2023
@mosteo mosteo deleted the feat/auto-compiler branch November 21, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants