]> _ Git - alire.git/commit
Pins in the manifest (#743)
authorAlejandro R Mosteo <alejandro@mosteo.com>
Tue, 22 Jun 2021 15:55:12 +0000 (17:55 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 15:55:12 +0000 (17:55 +0200)
commit13acd704b57845d67f189c3a9691e82c5c9dac5c
treea5d78fae3dbcda2b291c5027e97f0a5e28a97aa5
parent8ed8d8d127f4c26b9f5bd4f5415cb0a5410f8605
Pins in the manifest (#743)

* Added data structures

* Pins may appear in manifest, being ignored

* Loading of user pins complete

* Pins are downloaded or skipped as needed

* Pins are properly pruned, and info displayed

Minor testsuite tweak for a change in logging format

* Added new-format pins to alire.toml for self-build

* Allow selective update of pins as for regular deps

* Local pins work with new manifest syntax

* Fixed bug in which version pins were not used

* Make version explicit key in user pin

* Fix bug about confirming empty updates

* Roots: Conflated dep updating into single Sync

We had two confusing Update_Dependencies and Update_And_Deploy_Dependencies
that were in practice doing almost the same. There is now a single
Sync_Dependencies.

* Disable tests that rely on `alr pin`

For now, these cannot work as we are going to remove the ability to edit pins
via `alr with`/`alr pin`. This functionality could be reintroduced at a later
time.

* More tests temporarily disabled

Most of those should be reimplemented in their manual edition alternative

* Disable code for pin edition in command-line

* Changes to allow pins to non-dependencies

This is purely for user comfort and will probably result in dependencies having
to be added at publish time. However, if we manage to restore command-line
pinning, we can remove that pain by adding missing dependencies at that time.

* Tests in tests/pin using new pins

Some tests are not easily portable without support from `alr with --use`. Since
that should be easy to implement later, they are disabled for now and will be
enabled in a subsequent patch.

* Documentation on new pins

* Fix for testcase on Windows using path separators

* Spelling fixes, and exclude lockfiles from check

* New test for various invalid pin entries in manifest

Also the required code changes to pass the test

* Fixes from code self-review

* Fixes suggested during code review

* Fix for missed update when there is no lockfile

We were creating an empty lockfile, which was newer than the manifest, and thus
not triggering the expected automatic update.

* Test to check pins are applied with no prior lockfile

This was a bug detected and corrected in the previous commit
152 files changed:
.github/workflows/spellcheck.yml
.gitmodules
alire.gpr
alire.lock
alire.toml
alr_env.gpr
config/alr_config.ads [new file with mode: 0644]
config/alr_config.gpr [new file with mode: 0644]
config/alr_config.h [new file with mode: 0644]
deps/optional [new submodule]
dev/edit.sh [new file with mode: 0755]
doc/catalog-format-spec.md
doc/user-changes.md
src/alire/alire-crate_configuration.adb
src/alire/alire-crates.adb
src/alire/alire-dependencies-containers.ads
src/alire/alire-dependencies-states.ads
src/alire/alire-environment.adb
src/alire/alire-externals-softlinks-holders.ads [new file with mode: 0644]
src/alire/alire-externals.adb
src/alire/alire-milestones-holders.ads [new file with mode: 0644]
src/alire/alire-optional.ads [new file with mode: 0644]
src/alire/alire-releases.adb
src/alire/alire-releases.ads
src/alire/alire-roots.adb
src/alire/alire-roots.ads
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.ads
src/alire/alire-toml_keys.ads
src/alire/alire-toml_load.adb
src/alire/alire-toml_load.ads
src/alire/alire-user_pins-maps.adb [new file with mode: 0644]
src/alire/alire-user_pins-maps.ads [new file with mode: 0644]
src/alire/alire-user_pins.adb [new file with mode: 0644]
src/alire/alire-user_pins.ads [new file with mode: 0644]
src/alr/alr-commands-pin.adb
src/alr/alr-commands-pin.ads
src/alr/alr-commands-update.adb
src/alr/alr-commands-withing.adb
src/alr/alr-commands.adb
testsuite/disabled/get/indirect-link/my_index/index/index.toml [new file with mode: 0644]
testsuite/disabled/get/indirect-link/my_index/index/ti/tier1/tier1-1.0.0.toml [new file with mode: 0644]
testsuite/disabled/get/indirect-link/my_index/index/ti/tier2/tier2-1.0.0.toml [new file with mode: 0644]
testsuite/disabled/get/indirect-link/my_index/index/ti/tier3/tier3-1.0.0.toml [new file with mode: 0644]
testsuite/disabled/get/indirect-link/test.py [new file with mode: 0644]
testsuite/disabled/get/indirect-link/test.yaml [new file with mode: 0644]
testsuite/disabled/pin/all/my_index/index/he/hello1/hello1-0.1.0.toml [new file with mode: 0644]
testsuite/disabled/pin/all/my_index/index/he/hello2/hello2-0.1.0.toml [new file with mode: 0644]
testsuite/disabled/pin/all/my_index/index/index.toml [new file with mode: 0644]
testsuite/disabled/pin/all/test.py [new file with mode: 0644]
testsuite/disabled/pin/all/test.yaml [new file with mode: 0644]
testsuite/disabled/pin/dir-mismatch/test.py [new file with mode: 0644]
testsuite/disabled/pin/dir-mismatch/test.yaml [new file with mode: 0644]
testsuite/disabled/pin/remote/test.py [new file with mode: 0644]
testsuite/disabled/pin/remote/test.yaml [new file with mode: 0644]
testsuite/disabled/printenv/linked-paths/my_index/crates/crate_1234/.emptydir [new file with mode: 0644]
testsuite/disabled/printenv/linked-paths/my_index/crates/crate_1234/alire.toml [new file with mode: 0644]
testsuite/disabled/printenv/linked-paths/my_index/crates/crate_1234/alire/.emptydir [new file with mode: 0644]
testsuite/disabled/printenv/linked-paths/my_index/index/index.toml [new file with mode: 0644]
testsuite/disabled/printenv/linked-paths/test.py [new file with mode: 0644]
testsuite/disabled/printenv/linked-paths/test.yaml [new file with mode: 0644]
testsuite/disabled/with/changes-info/test.py [new file with mode: 0644]
testsuite/disabled/with/changes-info/test.yaml [new file with mode: 0644]
testsuite/disabled/with/pin-dir-crate-autodetect/test.py [new file with mode: 0644]
testsuite/disabled/with/pin-dir-crate-autodetect/test.yaml [new file with mode: 0644]
testsuite/disabled/with/pin-dir-crate/test.py [new file with mode: 0644]
testsuite/disabled/with/pin-dir-crate/test.yaml [new file with mode: 0644]
testsuite/disabled/with/pin-dir-mismatch/test.py [new file with mode: 0644]
testsuite/disabled/with/pin-dir-mismatch/test.yaml [new file with mode: 0644]
testsuite/disabled/with/pin-dir/my_index/crates/libhello_1.0.0/libhello.gpr [new file with mode: 0644]
testsuite/disabled/with/pin-dir/my_index/crates/libhello_1.0.0/src/libhello.ads [new file with mode: 0644]
testsuite/disabled/with/pin-dir/my_index/index/index.toml [new file with mode: 0644]
testsuite/disabled/with/pin-dir/my_index/index/li/libhello/libhello-1.0.0.toml [new file with mode: 0644]
testsuite/disabled/with/pin-dir/test.py [new file with mode: 0644]
testsuite/disabled/with/pin-dir/test.yaml [new file with mode: 0644]
testsuite/disabled/with/pin-transitive/test.py [new file with mode: 0644]
testsuite/disabled/with/pin-transitive/test.yaml [new file with mode: 0644]
testsuite/disabled/with/tree-switch/test.py [new file with mode: 0644]
testsuite/disabled/with/tree-switch/test.yaml [new file with mode: 0644]
testsuite/disabled/with/versions-switch/test.py [new file with mode: 0644]
testsuite/disabled/with/versions-switch/test.yaml [new file with mode: 0644]
testsuite/drivers/alr.py
testsuite/tests/get/indirect-link/my_index/index/index.toml [deleted file]
testsuite/tests/get/indirect-link/my_index/index/ti/tier1/tier1-1.0.0.toml [deleted file]
testsuite/tests/get/indirect-link/my_index/index/ti/tier2/tier2-1.0.0.toml [deleted file]
testsuite/tests/get/indirect-link/my_index/index/ti/tier3/tier3-1.0.0.toml [deleted file]
testsuite/tests/get/indirect-link/test.py [deleted file]
testsuite/tests/get/indirect-link/test.yaml [deleted file]
testsuite/tests/pin/all/my_index/index/he/hello1/hello1-0.1.0.toml [deleted file]
testsuite/tests/pin/all/my_index/index/he/hello2/hello2-0.1.0.toml [deleted file]
testsuite/tests/pin/all/my_index/index/index.toml [deleted file]
testsuite/tests/pin/all/test.py [deleted file]
testsuite/tests/pin/all/test.yaml [deleted file]
testsuite/tests/pin/change-type/test.py
testsuite/tests/pin/dir-crate/test.py
testsuite/tests/pin/dir-mismatch/test.py [deleted file]
testsuite/tests/pin/dir-mismatch/test.yaml [deleted file]
testsuite/tests/pin/downgrade/test.py
testsuite/tests/pin/manifest-invalid-pins/my_index/crates/crate/.emptydir [new file with mode: 0644]
testsuite/tests/pin/manifest-invalid-pins/my_index/index/cr/crate/crate-1.0.0.toml [new file with mode: 0644]
testsuite/tests/pin/manifest-invalid-pins/my_index/index/index.toml [new file with mode: 0644]
testsuite/tests/pin/manifest-invalid-pins/test.py [new file with mode: 0644]
testsuite/tests/pin/manifest-invalid-pins/test.yaml [new file with mode: 0644]
testsuite/tests/pin/missing-version/test.py
testsuite/tests/pin/pin-dir-with-regular/test.py
testsuite/tests/pin/pin-dir/test.py
testsuite/tests/pin/post-update/test.py
testsuite/tests/pin/remote/test.py [deleted file]
testsuite/tests/pin/remote/test.yaml [deleted file]
testsuite/tests/pin/twice-in-manifest/my_index/index.toml [new file with mode: 0644]
testsuite/tests/pin/twice-in-manifest/my_index/li/libhello/libhello-1.0.0.toml [new file with mode: 0644]
testsuite/tests/pin/twice-in-manifest/test.py [new file with mode: 0644]
testsuite/tests/pin/twice-in-manifest/test.yaml [new file with mode: 0644]
testsuite/tests/pin/unneeded-held/test.py
testsuite/tests/pin/unpin/test.py
testsuite/tests/pin/without-lockfile/test.py [new file with mode: 0644]
testsuite/tests/pin/without-lockfile/test.yaml [new file with mode: 0644]
testsuite/tests/printenv/linked-paths/my_index/crates/crate_1234/.emptydir [deleted file]
testsuite/tests/printenv/linked-paths/my_index/crates/crate_1234/alire.toml [deleted file]
testsuite/tests/printenv/linked-paths/my_index/crates/crate_1234/alire/.emptydir [deleted file]
testsuite/tests/printenv/linked-paths/my_index/index/index.toml [deleted file]
testsuite/tests/printenv/linked-paths/test.py [deleted file]
testsuite/tests/printenv/linked-paths/test.yaml [deleted file]
testsuite/tests/printenv/with-external/test.py
testsuite/tests/update/manual-once/test.py
testsuite/tests/update/missing-deps/test.py
testsuite/tests/update/pinned/test.py
testsuite/tests/with/changes-info/test.py [deleted file]
testsuite/tests/with/changes-info/test.yaml [deleted file]
testsuite/tests/with/pin-dir-crate-autodetect/test.py [deleted file]
testsuite/tests/with/pin-dir-crate-autodetect/test.yaml [deleted file]
testsuite/tests/with/pin-dir-crate/test.py [deleted file]
testsuite/tests/with/pin-dir-crate/test.yaml [deleted file]
testsuite/tests/with/pin-dir-mismatch/test.py [deleted file]
testsuite/tests/with/pin-dir-mismatch/test.yaml [deleted file]
testsuite/tests/with/pin-dir/my_index/crates/libhello_1.0.0/libhello.gpr [deleted file]
testsuite/tests/with/pin-dir/my_index/crates/libhello_1.0.0/src/libhello.ads [deleted file]
testsuite/tests/with/pin-dir/my_index/index/index.toml [deleted file]
testsuite/tests/with/pin-dir/my_index/index/li/libhello/libhello-1.0.0.toml [deleted file]
testsuite/tests/with/pin-dir/test.py [deleted file]
testsuite/tests/with/pin-dir/test.yaml [deleted file]
testsuite/tests/with/pin-transitive/test.py [deleted file]
testsuite/tests/with/pin-transitive/test.yaml [deleted file]
testsuite/tests/with/tree-switch/test.py [deleted file]
testsuite/tests/with/tree-switch/test.yaml [deleted file]
testsuite/tests/with/versions-switch/test.py [deleted file]
testsuite/tests/with/versions-switch/test.yaml [deleted file]
testsuite/tests/workflows/init-with-pin/test.py