]> _ Git - alire.git/commit
Binary crates, toolchain management and use (#775)
authorAlejandro R Mosteo <alejandro@mosteo.com>
Wed, 18 Aug 2021 10:28:45 +0000 (12:28 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Aug 2021 10:28:45 +0000 (12:28 +0200)
commitd6ea245a32bcc74383dc71c2ef933206d471a69e
tree4326b0486e0a7b6d2c555b7e12e598f5c8223d11
parent14c3ecd4571d1e95cf81dc2934c3ae080dc1256d
Binary crates, toolchain management and use (#775)

* Implement sha256 and hash use test (#765)

* Implement binary origins and their deployment

* `alr install` for shared installations

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

* Toolchain configuration assistant

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

* Re-enable "provides" in index and use them in alr

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.

* Use toolchain in solve/build/environment

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

* Rename install command to toolchain

* Implement "provides" for external detectors

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.

* Tweaks for new GNAT crate names

* Solver: reuse known GNAT on generic gnat= dep

* Integrate external gnats in shared releases

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.

* Documentation in doc/, `alr help`

* Fixed circularity, Config.Edit is now untangled

* Tweaks to pass existing tests

* Self-review fixes and clean-up

* New tests for toolchains and related features

* Windows-specific testsuite fixes

* Review fixes

In particular, the avoidance of downloading a compiler for a generic gnat
dependency. This is tested in testsuite/tests/solver/compiler-installed
218 files changed:
.gitmodules
alire.gpr
alire.toml
alr_env.gpr
config/alr_config.gpr
deps/aaa
deps/si_units [new submodule]
doc/catalog-format-spec.md
doc/toolchains.md [new file with mode: 0644]
doc/user-changes.md
scripts/alr-completion.bash
src/alire/alire-conditional_trees-case_nodes.adb
src/alire/alire-conditional_trees.adb
src/alire/alire-conditional_trees.ads
src/alire/alire-config-edit.ads
src/alire/alire-config.ads
src/alire/alire-containers.adb [deleted file]
src/alire/alire-containers.ads
src/alire/alire-crates.adb
src/alire/alire-crates.ads
src/alire/alire-dependencies-containers.adb
src/alire/alire-dependencies-containers.ads
src/alire/alire-dependencies-graphs.adb
src/alire/alire-dependencies-states.adb
src/alire/alire-dependencies-states.ads
src/alire/alire-dependencies.ads
src/alire/alire-directories.adb
src/alire/alire-directories.ads
src/alire/alire-environment.adb
src/alire/alire-environment.ads
src/alire/alire-expressions-maps.adb
src/alire/alire-expressions-maps.ads
src/alire/alire-externals-from_output.adb
src/alire/alire-externals-from_output.ads
src/alire/alire-externals-from_system.adb
src/alire/alire-externals-from_system.ads
src/alire/alire-externals-lists.adb
src/alire/alire-externals-lists.ads
src/alire/alire-externals-unindexed.ads
src/alire/alire-externals.adb
src/alire/alire-externals.ads
src/alire/alire-hashes-sha256_impl.ads [new file with mode: 0644]
src/alire/alire-hashes.ads
src/alire/alire-index.adb
src/alire/alire-index.ads
src/alire/alire-milestones-containers.ads [new file with mode: 0644]
src/alire/alire-milestones-holders.ads [deleted file]
src/alire/alire-milestones.ads
src/alire/alire-origins-deployers-source_archive.adb
src/alire/alire-origins-deployers-system-apt.adb
src/alire/alire-origins-deployers-system-pacman.adb
src/alire/alire-origins-deployers-system-rpm_wrappers.adb
src/alire/alire-origins-deployers-system.adb
src/alire/alire-origins-deployers.adb
src/alire/alire-origins-deployers.ads
src/alire/alire-origins.adb
src/alire/alire-origins.ads
src/alire/alire-paths.ads
src/alire/alire-platform.ads
src/alire/alire-properties-actions-executor.adb
src/alire/alire-provides.adb [new file with mode: 0644]
src/alire/alire-provides.ads [new file with mode: 0644]
src/alire/alire-releases-containers.adb [new file with mode: 0644]
src/alire/alire-releases-containers.ads [new file with mode: 0644]
src/alire/alire-releases.adb
src/alire/alire-releases.ads
src/alire/alire-root.adb
src/alire/alire-root.ads
src/alire/alire-roots-editable.adb
src/alire/alire-roots-editable.ads
src/alire/alire-roots-optional.adb
src/alire/alire-roots.adb
src/alire/alire-roots.ads
src/alire/alire-shared.adb [new file with mode: 0644]
src/alire/alire-shared.ads [new file with mode: 0644]
src/alire/alire-solutions-diffs.adb
src/alire/alire-solutions.adb
src/alire/alire-solutions.ads
src/alire/alire-solver.adb
src/alire/alire-solver.ads
src/alire/alire-toml_adapters.adb
src/alire/alire-toml_index.adb
src/alire/alire-toml_load.adb
src/alire/alire-toml_load.ads
src/alire/alire-toolchains-solutions.adb [new file with mode: 0644]
src/alire/alire-toolchains-solutions.ads [new file with mode: 0644]
src/alire/alire-toolchains.adb [new file with mode: 0644]
src/alire/alire-toolchains.ads [new file with mode: 0644]
src/alire/alire-uri.adb [new file with mode: 0644]
src/alire/alire-uri.ads
src/alire/alire-user_pins.adb
src/alire/alire-user_pins.ads
src/alire/alire-utils-tty.ads
src/alire/alire-utils-user_input.adb
src/alire/alire-utils-user_input.ads
src/alire/alire-utils.ads
src/alire/alire-vcss-git.adb
src/alire/alire-vcss-git.ads
src/alire/alire-vcss-hg.ads
src/alire/alire.adb
src/alire/alire.ads
src/alire/os_windows/alire-platform.adb
src/alr/alr-commands-help.adb
src/alr/alr-commands-search.adb
src/alr/alr-commands-show.adb
src/alr/alr-commands-test.adb
src/alr/alr-commands-toolchain.adb [new file with mode: 0644]
src/alr/alr-commands-toolchain.ads [new file with mode: 0644]
src/alr/alr-commands.adb
src/alr/alr-commands.ads
testsuite/drivers/alr.py
testsuite/drivers/asserts.py
testsuite/drivers/helpers.py
testsuite/fix-versions.sh
testsuite/fixtures/basic_index/index.toml
testsuite/fixtures/cases_index/index.toml
testsuite/fixtures/checked_index/index.toml
testsuite/fixtures/git_index/index.toml
testsuite/fixtures/native_index/index.toml
testsuite/fixtures/run_index/index.toml
testsuite/fixtures/solver_index/index.toml
testsuite/fixtures/toolchain_index/cr/crate_clash/crate_clash-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/cr/crate_equiv/crate_equiv-2.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/cr/crate_lone/crate_lone-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/cr/crate_lone/crate_lone-2.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/gn/gnat_cross_1/gnat_cross_1-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/gn/gnat_cross_1/gnat_cross_1-9999.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/gn/gnat_cross_2/gnat_cross_2-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/gn/gnat_external/gnat_external-external.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/gn/gnat_native/gnat_native-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/gn/gnat_native/gnat_native-2.0.0.toml [new file with mode: 0644]
testsuite/fixtures/toolchain_index/index.toml [new file with mode: 0644]
testsuite/skels/local-index/my_index/index/index.toml
testsuite/tests/crate_config/basic/my_index/index/index.toml
testsuite/tests/crate_config/gen_control/my_index/index/index.toml
testsuite/tests/get/backup-user-manifest/my_index/index/index.toml
testsuite/tests/get/build/my_index/index/index.toml
testsuite/tests/get/external-tool-dependency/my_index/index.toml
testsuite/tests/get/external-tool-dependency/test.py
testsuite/tests/get/indirect-link/my_index/index/index.toml
testsuite/tests/index/bad-action-command/my_index/index/index.toml
testsuite/tests/index/bad-config-vars/my_index/index/index.toml
testsuite/tests/index/bad-index-metadata/my_index/index/index.toml
testsuite/tests/index/bad-license-too-long/my_index/index/index.toml
testsuite/tests/index/bad-license/my_index/index/index.toml
testsuite/tests/index/bad-tag/my_index/index/index.toml
testsuite/tests/index/check-enums/my_index/index/index.toml
testsuite/tests/index/empty-tag/my_index/index/index.toml
testsuite/tests/index/environment/my_index/index/index.toml
testsuite/tests/index/external-available/my_index/index.toml
testsuite/tests/index/external-from-output/my_index/index/index.toml
testsuite/tests/index/external-hint/my_index/index.toml
testsuite/tests/index/external-msys2/my_index/index.toml
testsuite/tests/index/external-unindexed/my_index/index/index.toml
testsuite/tests/index/long-description/my_index/index/index.toml
testsuite/tests/index/long-tag/my_index/index/index.toml
testsuite/tests/index/maint-bad-email/my_index/index/index.toml
testsuite/tests/index/maint-bad-login/my_index/index/index.toml
testsuite/tests/index/mismatched-crate/my_index/index/index.toml
testsuite/tests/index/mismatched-parent/my_index/index/index.toml
testsuite/tests/index/origin-filesystem-bad-path/bad_index_1/index.toml
testsuite/tests/index/origin-filesystem-bad-path/bad_index_2/index.toml
testsuite/tests/index/origin-no-archive-name/my_index/index/index.toml
testsuite/tests/index/origin-unknown-kind/my_index/index/index.toml
testsuite/tests/index/too-long-short-description/my_index/index/index.toml
testsuite/tests/index/unexpected-contents/my_index/index/index.toml
testsuite/tests/misc/hashes/my_index/index/cr/crate/crate-1.0.0.toml [new file with mode: 0644]
testsuite/tests/misc/hashes/my_index/index/cr/crate/crate-2.0.0.toml [new file with mode: 0644]
testsuite/tests/misc/hashes/my_index/index/index.toml [new file with mode: 0644]
testsuite/tests/misc/hashes/test.py [new file with mode: 0644]
testsuite/tests/misc/hashes/test.yaml [new file with mode: 0644]
testsuite/tests/pin/all/my_index/index/index.toml
testsuite/tests/pin/change-type/my_index/index.toml
testsuite/tests/pin/downgrade/my_index/index/index.toml
testsuite/tests/pin/manifest-invalid-pins/my_index/index/index.toml
testsuite/tests/pin/pin-dir-with-regular/my_index/index.toml
testsuite/tests/pin/pin-dir/my_index/index.toml
testsuite/tests/pin/post-update/my_index/index/index.toml
testsuite/tests/pin/twice-in-manifest/my_index/index.toml
testsuite/tests/pin/unneeded-held/my_index/index/index.toml
testsuite/tests/printenv/double-set/my_index/index/index.toml
testsuite/tests/printenv/env-during-fetch/my_index/index/index.toml
testsuite/tests/printenv/linked-paths/my_index/index/index.toml
testsuite/tests/publish/check-build/my_index/index/index.toml
testsuite/tests/publish/check-properties/my_index/index/index.toml
testsuite/tests/publish/tarball-plaindir-nonstd/my_index/index/index.toml
testsuite/tests/publish/tarball-plaindir/my_index/index/index.toml
testsuite/tests/publish/tarball-repo-nonstd/my_index/index/index.toml
testsuite/tests/publish/tarball-repo/my_index/index/index.toml
testsuite/tests/solver/compiler-installed/test.py [new file with mode: 0644]
testsuite/tests/solver/compiler-installed/test.yaml [new file with mode: 0644]
testsuite/tests/solver/compiler-mixing/test.py [new file with mode: 0644]
testsuite/tests/solver/compiler-mixing/test.yaml [new file with mode: 0644]
testsuite/tests/solver/compiler-priorities/test.py [new file with mode: 0644]
testsuite/tests/solver/compiler-priorities/test.yaml [new file with mode: 0644]
testsuite/tests/solver/compiler-selected/test.py [new file with mode: 0644]
testsuite/tests/solver/compiler-selected/test.yaml [new file with mode: 0644]
testsuite/tests/solver/equivalences-conflict/test.py [new file with mode: 0644]
testsuite/tests/solver/equivalences-conflict/test.yaml [new file with mode: 0644]
testsuite/tests/solver/equivalences/test.py [new file with mode: 0644]
testsuite/tests/solver/equivalences/test.yaml [new file with mode: 0644]
testsuite/tests/test/action-test/my_index/index/index.toml
testsuite/tests/toolchain/bad-switches/test.py [new file with mode: 0644]
testsuite/tests/toolchain/bad-switches/test.yaml [new file with mode: 0644]
testsuite/tests/toolchain/basic/test.py [new file with mode: 0644]
testsuite/tests/toolchain/basic/test.yaml [new file with mode: 0644]
testsuite/tests/toolchain/directories/test.py [new file with mode: 0644]
testsuite/tests/toolchain/directories/test.yaml [new file with mode: 0644]
testsuite/tests/toolchain/select/test.py [new file with mode: 0644]
testsuite/tests/toolchain/select/test.yaml [new file with mode: 0644]
testsuite/tests/update/selective/my_index/index/index.toml
testsuite/tests/update/selective/my_index/updated/index/index.toml
testsuite/tests/with/auto-gpr-with/basic/my_index/index.toml
testsuite/tests/with/auto-gpr-with/gpr_in_subdir/my_index/index.toml
testsuite/tests/with/narrow-pre1/my_index/index/index.toml
testsuite/tests/with/pin-dir/my_index/index/index.toml
testsuite/tests/workflows/action-command/my_index/index/index.toml
testsuite/tests/workflows/edit/my_index/index.toml