]> _ Git - alire.git/commit
Ability to use a local folder to fulfill a dependency (#439)
authorAlejandro R Mosteo <alejandro@mosteo.com>
Fri, 19 Jun 2020 17:01:46 +0000 (19:01 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Jun 2020 17:01:46 +0000 (19:01 +0200)
commitdcd7b6605db80a8a6ea6921fa7ca141efe57991b
treeca5c49d6308187c314ac61f408039155923cd7ba
parentcd734cd1de528c4245dba8f50ab1e8e7f7a1da0e
Ability to use a local folder to fulfill a dependency (#439)

* New Alire.Externals.Softlink to support WIP crates

* Implement alr with --url to add/pin in one step

A dependency can now be added simultaneously with a target directory that
fulfils it. Minimal check of the folder existing is performed; the buildability
of the whole is now the responsibility of the user.

* Implement softlinks in Alr.Dependencies.States

The placeholder `linked` fulfilment is now properly implemented to
hold/load/save the information about a directory to be used to fulfill a
dependency.

* Implement softlinks in Alire.Solutions.Solution

Add a Alire.Solutions.Linking subprogram that includes a linked dependency into
a solution.

* Modify solver to use soflinks for dependencies

When a softlink for the dependency being solved exists in the starting
solution, that dependency can be considered fulfilled without further ado.

* Implement `alr pin --url` to pin existing dep

This is the delayed counterpart to `alr with --url`; i.e., users can add the
dependency normally with `alr with` and later decide to pin it to a folder with
`alr pin`, without needing to remove it completely first with `alr with --del`.

We present pinning to versions and to folders to users under the same idea of
pinning. Internally, alr distinguishes between pinning (to versions) and
linking (to URLs). Currently only local paths can be used for links, but in the
future we may add remote files to fetch or repositories to clone.

* New Alire.URI to centralize URL knowledge

* Include pinned dirs' paths in project paths

The logic of collecting all necessary paths has been moved from Alr.Build_Env
to Alire.Roots.Project_Paths. A Root was already necessary to collect the
paths, and furthermore the root has all the necessary information: the root
release and the complete solution, which includes releases and linked dirs.

To make Roots self-contained, the platform properties are copied during startup
to Alire.Root. This is a temporary measure until these properties are
refactored from Alr into Alire.

* New tests for within/pinning to folders

* Testsuite fixes for minor changes in output

Information shown for external (lacking a release) dependencies is more
comprehensive now, showing transitivity, pin information, hinting status.

* Crate log of user-visible changes

* Spelling fixes

* Review: rename --url to --use
59 files changed:
.gitmodules
alire.gpr
alr.gpr
alr_env.gpr
deps/uri-ada [new submodule]
doc/user-changes.md [new file with mode: 0644]
src/alire/alire-conditional_trees.ads
src/alire/alire-dependencies-graphs.adb
src/alire/alire-dependencies-states.adb
src/alire/alire-dependencies-states.ads
src/alire/alire-externals-softlinks.adb [new file with mode: 0644]
src/alire/alire-externals-softlinks.ads [new file with mode: 0644]
src/alire/alire-externals.adb
src/alire/alire-externals.ads
src/alire/alire-pinning.adb
src/alire/alire-pinning.ads
src/alire/alire-root.adb
src/alire/alire-root.ads
src/alire/alire-roots.adb [new file with mode: 0644]
src/alire/alire-roots.ads
src/alire/alire-solutions-diffs.adb
src/alire/alire-solutions-diffs.ads
src/alire/alire-solutions.adb
src/alire/alire-solutions.ads
src/alire/alire-solver.adb
src/alire/alire-uri.ads [new file with mode: 0644]
src/alire/alire-utils-tty.ads
src/alire/alire-workspace.adb
src/alire/alire.adb
src/alire/alire.ads
src/alr/alr-build_env.adb
src/alr/alr-commands-init.adb
src/alr/alr-commands-pin.adb
src/alr/alr-commands-pin.ads
src/alr/alr-commands-withing.adb
src/alr/alr-commands-withing.ads
src/alr/alr-main.adb
testsuite/drivers/alr.py
testsuite/drivers/helpers.py
testsuite/tests/index/external-hint/test.py
testsuite/tests/pin/change-type/my_index/crates/libhello_1.0.0/libhello.gpr [new file with mode: 0644]
testsuite/tests/pin/change-type/my_index/crates/libhello_1.0.0/src/libhello.ads [new file with mode: 0644]
testsuite/tests/pin/change-type/my_index/index/index.toml [new file with mode: 0644]
testsuite/tests/pin/change-type/my_index/index/li/libhello.toml [new file with mode: 0644]
testsuite/tests/pin/change-type/test.py [new file with mode: 0644]
testsuite/tests/pin/change-type/test.yaml [new file with mode: 0644]
testsuite/tests/pin/pin-dir/my_index/crates/libhello_1.0.0/libhello.gpr [new file with mode: 0644]
testsuite/tests/pin/pin-dir/my_index/crates/libhello_1.0.0/src/libhello.ads [new file with mode: 0644]
testsuite/tests/pin/pin-dir/my_index/index/index.toml [new file with mode: 0644]
testsuite/tests/pin/pin-dir/my_index/index/li/libhello.toml [new file with mode: 0644]
testsuite/tests/pin/pin-dir/test.py [new file with mode: 0644]
testsuite/tests/pin/pin-dir/test.yaml [new file with mode: 0644]
testsuite/tests/with/external/test.py
testsuite/tests/with/pin-dir/my_index/crates/libhello_1.0.0/libhello.gpr [new file with mode: 0644]
testsuite/tests/with/pin-dir/my_index/crates/libhello_1.0.0/src/libhello.ads [new file with mode: 0644]
testsuite/tests/with/pin-dir/my_index/index/index.toml [new file with mode: 0644]
testsuite/tests/with/pin-dir/my_index/index/libhello/libhello.toml [new file with mode: 0644]
testsuite/tests/with/pin-dir/test.py [new file with mode: 0644]
testsuite/tests/with/pin-dir/test.yaml [new file with mode: 0644]