Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer uninstalled compiler as fallback with warning #1508

Merged
merged 8 commits into from
Nov 21, 2023

Conversation

mosteo
Copy link
Member

@mosteo mosteo commented Nov 15, 2023

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 marked this pull request as ready for review November 16, 2023 08:53
@Fabien-Chouteau
Copy link
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
Copy link
Member Author

mosteo commented Nov 16, 2023

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
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
Copy link
Member Author

mosteo commented Nov 16, 2023

Yeah, that's the gist of it.

@mosteo
Copy link
Member Author

mosteo commented Nov 16, 2023

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
13 checks passed
@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.

None yet

2 participants