Skip to content

Commit

Permalink
doc: fix obsolete toolchain --install references (alire-project#1765)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Oct 8, 2024
1 parent 1510aa8 commit 95374c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 10 additions & 14 deletions doc/toolchains.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

Toolchains are comprised by a GNAT compiler and a `gprbuild` project file
processor. Alire strives to simplify the availability of GNAT releases, which
are packaged to be retrieved and used with ease.
are packaged to be retrieved and used with ease.

The user can now select a preferred compiler via `alr toolchain --select`.
Releases may still override this selection (for example to use a
cross-compiler).
cross-compiler). Several compilers can be installed simultaneously, but only
the last one `--select`ed will be used by default. The rest will be used in
preference to uninstalled compilers, if the default one does not match some
crate's dependencies.

There are two kinds of dependencies on GNAT compilers: generic dependencies on
the `gnat` crate, which apply to every compiler, and dependencies on a precise
Expand All @@ -27,35 +30,28 @@ They will also be shown by the selection assistant,
Running `alr toolchain` without arguments will show the installed compilers and
the preferred compiler, if any.

## Manual compiler installation

Besides selecting a default compiler with `alr toolchain --select`, the user
may install other compilers via `alr toolchain --install`. Installed but
unselected compilers will not be used, though, unless a crate explicitly
requests them via dependencies.

Compilers can be removed with `alr toolchain --uninstall`.

## Automatic compiler installation

If a crate requires a target-specific compiler via its dependencies, `alr` will
attempt to use first a matching installed compiler. Otherwise, a matching
compiler will be automatically downloaded.

Generic dependencies on `gnat` will never cause a compiler download.

## Automatic compiler selection by Alire

When a build is launched, or `alr printenv` is run to obtain a build environment,
`alr` will use the available compilers as follows:

1. Any target-specific compiler needed due to dependencies will be
1. A target-specific compiler needed due to dependencies will be
selected.
1. Otherwise, if the user has defined a preferred compiler, it will be
selected.
1. If no preferred compiler has been defined, Alire will rely on the existing
user environment.

Within these conditions, a compiler already downloaded will be preferred.
Downloading a new compiler will be attempted only if no matching compiler is
already available.

## Specifying dependencies on GNAT compilers for crate publishing

From the point of view of a user preparing a release for publication, these
Expand Down
7 changes: 6 additions & 1 deletion testsuite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ You also must have [GNAT](https://www.gnu.org/software/gnat) and
[GPRBuild](https://github.com/AdaCore/gprbuild) in your `PATH`. You can install
these with, for example:
```sh
alr toolchain --install --install-dir=<dir> gnat_native=<version_x> gprbuild=<version_y>
alr install gnat_native=<version_x> gprbuild=<version_y> --prefix=<dir>
```
and add `<dir>/bin` to your `PATH`, or
```sh
cd <dir>
alr get gnat_native=<version_x> gprbuild=<version_y>
```
and add `<dir>/gnat_native_<version_x>_(...)/bin` and
`<dir>/gprbuild_<version_y>_(...)/bin` to your `PATH`.
Expand Down

0 comments on commit 95374c3

Please sign in to comment.