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
Binary crates, toolchain management and use #775
Conversation
Essentially, we have a second location for dependencies at ${ALR_CONFIG}/cache. In following PRs the releases therein will be available during dependency resolution, to be reused. `alr install` for manual crate installation Installed crates are used by the solver Autodiscover installed releases Show differences due to changed install status Install: implement release removal
Menu for choosing among multiple options Show actual compiler versions to the user Install and remember the user choice User_Input: Take a possible Ctrl-D into account
New, more flexible provides type WIP: going back to provides as list of deps All but loading of "provides" Loading of provides Installed provides are used during solving They're not yet used for regular dependencies Display provider in the `alr with` variants Prevent solving of conflicting dependencies If two releases provide the same crate, they cannot be simultaneously in a solution. solver tweaks for provides + externals Improvements to solution space by reusing releases When adding a release to a solution, check whether other dependencies can be satisfied by this same release. Not a big deal, could be disabled if too costly in the future.
Insert explicit dependency on the configured gnat Do not explicitly insert dependency on toolchain Instead, we simply coerce when given a generic gnat dependency into the configured one. This is less intrusive as the user does not see unexpected dependencies on the compiler in the solution (unless explicitly requested). Extra info in `alr install` list Generalized assistant for all tools in toolchain
For now this is restricted to a single alternate crate name. By necessity, the equivalence has to be to the same version, whereas provides for regular releases are more general as they can rely on precise versions which are known in advance.
This is logical because these are always available in all configurations. But the important benefit is that the solver can use them in preference to a remote native compiler.
d27e2b5
to
4eb06cb
Compare
ff45b3f
to
3f4db3e
Compare
655e4f9
to
d10355d
Compare
5b084c1
to
8462f71
Compare
8353758
to
56639f5
Compare
Hi @Fabien-Chouteau . I still have to see what's going on with Windows, but this one is ready for review. I apologize in advance because on top of being a large PR in itself, I had to do a couple of refactors towards the end to break circularities that mud things even more. I'll try to compartmentalize things better next time 😓 |
57ed3a5
to
78c87fb
Compare
1. A cross-compiler from the index, that will be deployed with the rest of dependencies. | ||
|
||
- Solution with dependencies on a target-specific GNAT (`gnat_native`, `gnat_ricv_elf`, | ||
etc.): The `alr` solver will provide one compiler in the environment, applying the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have both an explicit dependency on gnat_native
and gnat_riscv64_elf
? It should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simultaneously in a crate? How's that supposed to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one video game crate (shoot_n_loot
) that builds both the embedded version of the game and a native simulator to play it on the computer. But maybe that's a very bad idea ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually was worried about this use case but I guess I didn't traslate it properly in our talks. This is the one where I saw your idea on conditional dependencies on something provided via command line/dependent crate configuration could be useful:
alr build target:=native # arbitrary name, not predefined (or defined in the configuration section of the crate)
and then we can have in the toml:
[[depends-on."case(crate.target)".native]]
gnat_native = "*"
[[depends-on."case(crate.target)".riscv]]
gnat_riscv_elf = "*"
There should be a default somehow for automated builds though.
For a later date obviously...
Otherwise, I guess we can do an exception about the gnat
crate not being conflicting among compilers. But something nags me at that being unkind to people not interested in all targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it simple for now and only allow one compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that is a legitimate situation that we ought to support. I'll try to come up with a solution in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #780
function Is_Provided (This : State) return Boolean; | ||
-- True when the release name is different from the dependency crate | ||
|
||
function Is_Shared (This : State) return Boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be Is_Installed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started using the idea of 'shared releases' internally, as these are just regular releases in a shared location. But it can be changed if confusing (likewise then for the Alire.Shared
package).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will depend on how and if we implement an alr install
I guess. We can keep shared for now, up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My current mood is to avoid install
entirely. I was thinking of using alr share
for non-toolchain crates shared in the configuration, and alr export
for the gprinstall-in-common-prefix
idea. So we convey that exported crates are something the user wants to use out of Alire. But I'm easy to sway on these naming things.
For now if you don't mind I'll leave it as is then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user wants to make some application available system-wide, I would say the usual keyword used by package managers and build systems is install
instead of export
. export
sounds like an action to extract data from an application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we would be "extracting" binaries from the Alire ecosystem. But I see your point. alr share
for shared dependencies across workspaces and alr install
for deploying crates to a common prefix can also work for me.
Another possibility is to have it under get
, e.g., alr get --install
. The operation in itself is essentially an alr get + alr build + gprinstall
.
1710baa
to
8cca83d
Compare
In particular, the avoidance of downloading a compiler for a generic gnat dependency. This is tested in testsuite/tests/solver/compiler-installed
Hi @Fabien-Chouteau , with #780 and #781 in the pipeline I think we are ready feature-wise for this one. There is the matter of whether to disable sha256, and the reworded explanation in |
Thanks @mosteo
Maybe we can do a release candidate and ask for feedback. Based on the feedback we could be able to improve the doc... |
OK then, in fact I should update the doc in #780 at least to match the current situation. |
This PR implements a variety of changes to support the use of binary compilers packaged through Alire:
provides
property to allow mixedgnat
/gnat_xxx
dependencies.alr toolchain
to inspect/[un]install/select toolchains.Still missing:
Documentation might be a bit sparse yet, and require some tweaking.
@Fabien-Chouteau , now the toolchain selection assistant is run the first time a valid alire folder is required. We might disable this entirely, or run it only if there is no gnat/gprbuild in the PATH, or something else if you see fit.