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

doc: fix obsolete toolchain --install references #1765

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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