]> _ Git - alire.git/log
alire.git
3 years agoFull update of msys2 after first install (#923)
Alejandro R Mosteo [Wed, 26 Jan 2022 17:59:38 +0000 (18:59 +0100)]
Full update of msys2 after first install (#923)

* Full update of msys2 after first install

* Update msys installer to the latest stable release

4 years agoBump version for 1.1.1 bugfix release (#883)
Alejandro R Mosteo [Tue, 26 Oct 2021 09:00:42 +0000 (11:00 +0200)]
Bump version for 1.1.1 bugfix release (#883)

4 years agoDo not exit with error on external failed detection (#876)
Alejandro R Mosteo [Tue, 5 Oct 2021 10:10:06 +0000 (12:10 +0200)]
Do not exit with error on external failed detection (#876)

4 years agoBugfix for improper check related to virtual crates (#875)
Alejandro R Mosteo [Mon, 4 Oct 2021 12:15:35 +0000 (14:15 +0200)]
Bugfix for improper check related to virtual crates (#875)

4 years agoBugfix when there is external gnat but not gprbuild (#866)
Alejandro R Mosteo [Wed, 22 Sep 2021 16:05:07 +0000 (18:05 +0200)]
Bugfix when there is external gnat but not gprbuild (#866)

4 years agoDisable assistant on --select <release> (#862)
Alejandro R Mosteo [Tue, 21 Sep 2021 09:17:15 +0000 (11:17 +0200)]
Disable assistant on --select <release> (#862)

4 years agoMove the 1.1 marker up to the top of changes
Alejandro R. Mosteo [Thu, 16 Sep 2021 15:02:37 +0000 (17:02 +0200)]
Move the 1.1 marker up to the top of changes

4 years agoBump version for 1.1 release (#856)
Alejandro R Mosteo [Thu, 16 Sep 2021 15:00:14 +0000 (17:00 +0200)]
Bump version for 1.1 release (#856)

* Bump version for 1.1 release

* Switch index branch to stable-1.1

4 years agoMerge up to On_Demand action into release/1.1
Alejandro R. Mosteo [Thu, 16 Sep 2021 14:05:13 +0000 (16:05 +0200)]
Merge up to On_Demand action into release/1.1

4 years agoFix 1.1 Is_TTY (#855)
Fabien Chouteau [Thu, 16 Sep 2021 13:58:45 +0000 (15:58 +0200)]
Fix 1.1 Is_TTY (#855)

* Update CLIC to v0.1.1

* Alr.Commands: use CLIC.TTY selection/detection of Is_TTY for the Trace package

4 years agoNew On_Demand action type (#847)
Alejandro R Mosteo [Wed, 15 Sep 2021 11:44:03 +0000 (13:44 +0200)]
New On_Demand action type (#847)

* New On_Demand action for future-proofing

* Test for on-demand actions

4 years agoAlire.Config.Edit: fix for --config with relative path (#848)
Fabien Chouteau [Tue, 14 Sep 2021 13:58:16 +0000 (15:58 +0200)]
Alire.Config.Edit: fix for --config with relative path (#848)

4 years agoChecks on compatibility of tools given via `--select <release>` (#846)
Alejandro R Mosteo [Tue, 14 Sep 2021 08:04:43 +0000 (10:04 +0200)]
Checks on compatibility of tools given via `--select <release>` (#846)

* Don't present incompatible tools in the assistant

* Sort gnats by version in the assistant

Rather than by name

* Detect origin conflicts in `alr toolchain --select <>`

* Use already configured tool origin as filter

* New test for checks on --select <releases>

* Self-review tweaks

4 years agoDon't present incompatible tools in the assistant (#844)
Alejandro R Mosteo [Tue, 14 Sep 2021 08:03:54 +0000 (10:03 +0200)]
Don't present incompatible tools in the assistant (#844)

4 years agoSort GNATs by version in the assistant (#845)
Alejandro R Mosteo [Tue, 14 Sep 2021 08:00:38 +0000 (10:00 +0200)]
Sort GNATs by version in the assistant (#845)

Rather than by name

4 years agoMerge changes since rc2 into 1.1 branch for rc3
Alejandro R Mosteo [Fri, 10 Sep 2021 11:14:58 +0000 (13:14 +0200)]
Merge changes since rc2 into 1.1 branch for rc3

Merge changes since rc2 into 1.1 branch for rc3

4 years agoBump version for 1.1 rc3 (#838)
Alejandro R Mosteo [Fri, 10 Sep 2021 11:12:41 +0000 (13:12 +0200)]
Bump version for 1.1 rc3 (#838)

4 years agoAlr.Commands.Toolchain: tweak for multiple components and install dir (#822)
Fabien Chouteau [Thu, 9 Sep 2021 10:31:42 +0000 (12:31 +0200)]
Alr.Commands.Toolchain: tweak for multiple components and install dir (#822)

* Alr.Commands.Toolchain: tweak for multiple components and install dir

This patch adds support of multiple components and allow
--disable-assistant with all commands so that it is possible to
configure all the toolchain stuff in one command:
$ alr toolchain --select gnat_native gprbuild --disable-assistant

The patch also introduces a --install-dir switch to allow installation
in any directory. This can be useful for people willing to use the Alire
toolchain outside of an Alire workflow. It would be better if the root
dir of the archive (e.g. gprbuild_21.0.0_349f6f95) was skipped so that
all the tools would be available from <INSTALL_DIR>/bin/.

* tests: increase gnat_native version in fixture index and add more tests

* Alr.Commands.Toolchain: print list only when no command is specified

* tests/toolchain/custom_install_dir: fix paths for Windows and second dir

* Fix PR comments

4 years agoAlr.Commands: disable simple_logging TTY (#827)
Fabien Chouteau [Mon, 6 Sep 2021 09:37:16 +0000 (11:37 +0200)]
Alr.Commands: disable simple_logging TTY (#827)

Fix #823

4 years agoFix typo in generated project file in init alire.toml (#824)
Paul Jarrett [Mon, 6 Sep 2021 08:15:02 +0000 (04:15 -0400)]
Fix typo in generated project file in init alire.toml (#824)

4 years agoMark binaries with the x86_64 arch (#821)
Alejandro R Mosteo [Thu, 2 Sep 2021 14:52:25 +0000 (16:52 +0200)]
Mark binaries with the x86_64 arch (#821)

4 years agoMerge remote-tracking branch 'alire/master' into release/1.1
Alejandro R. Mosteo [Thu, 2 Sep 2021 08:25:39 +0000 (10:25 +0200)]
Merge remote-tracking branch 'alire/master' into release/1.1

4 years agoMove version out of root package (#818)
Alejandro R Mosteo [Thu, 2 Sep 2021 08:21:56 +0000 (10:21 +0200)]
Move version out of root package (#818)

This way changing it does not require recompiling absolutely everything.

4 years agoFix bug when $XDG_CONFIG_HOME is defined (#816)
Alejandro R Mosteo [Thu, 2 Sep 2021 07:14:57 +0000 (09:14 +0200)]
Fix bug when $XDG_CONFIG_HOME is defined (#816)

4 years agoExtract sub-command handling (alr <command>) (#806)
Fabien Chouteau [Wed, 1 Sep 2021 08:52:41 +0000 (10:52 +0200)]
Extract sub-command handling (alr <command>) (#806)

* Extract sub-command handling (alr <command>)

The goal of this big refactoring is to extract the handling of
sub-commands to make it available for other projects.

The SubCommander packages (name open to changes) can be extracted to a
dedicated crate or to AAA.

There is at least one regression which is the support of -X for alr
build.

* Alr.Commands.Toolchain: Fix comparison typo from refactoring

* Alr.Commands|SubCommander: Fix exception raise and handling

* Typo

* Address review comments and minor changes

* Another big refactoring on command line handling

The switches are not parsed several times like before.  The global
switches parsing is done once, the command specific switch parsing is
done only on the command arguments.

Handling of -X scenario variable switches is now done with regular
GNAT.Command_Line switch handling.

There is a issue with command arguments that contain spaces, it looks
like they are split in multiple arguments. I don't know why.

* Fix args filtering

The concatenation of arguments and re-splitting with
GNAT.OS_Lib.Argument_String_To_List breaks when arguments have
whitespaces: 'alr' 'show' 'a b c' becomes 'alr 'show' 'a' 'b' 'c'.

* Wrap the GNAT Commnand_Line_Configuration to add required features

This was previously done with a GNAT.Command_Line.Extra package that
exploited the internals of GNAT.Command_Line.

This is more portable because less exposed to changes in the internals
of GNAT.Command_Line.

* Rename SubCommander to CLIC.Subcommander and move it to alire/

* Move Alire.Utils.User_Input and Alire.Utils.TTY to CLIC

* Alr.Platforms.Windows: Fix builds

* Import CLIC as submodule

4 years agoSeparate dependency recursion from deployment (#815)
Alejandro R Mosteo [Wed, 1 Sep 2021 08:25:22 +0000 (10:25 +0200)]
Separate dependency recursion from deployment (#815)

* Bump aaa to latest version

* Provide a safe traversal proc for dependencies

Migrate deployment of releases to this call

4 years agoSolver timeout to prevent runaway situations (#813)
Alejandro R Mosteo [Mon, 30 Aug 2021 15:25:51 +0000 (17:25 +0200)]
Solver timeout to prevent runaway situations (#813)

4 years agoAlire.Crate_Configuration: generate a constant with the version of the crate (#810)
Fabien Chouteau [Mon, 30 Aug 2021 09:08:54 +0000 (11:08 +0200)]
Alire.Crate_Configuration: generate a constant with the version of the crate (#810)

With this addition users only have to worry about the version in
alire.toml and it will be propagated to code and gpr files.

4 years agoMore thorough error on index version mismatch (#809)
Alejandro R Mosteo [Fri, 27 Aug 2021 07:45:09 +0000 (09:45 +0200)]
More thorough error on index version mismatch (#809)

4 years agoNon-interactive toolchain selection with `alr toolchain --select <release>` (#804)
Alejandro R Mosteo [Thu, 26 Aug 2021 09:14:43 +0000 (11:14 +0200)]
Non-interactive toolchain selection with `alr toolchain --select <release>` (#804)

* Allow to select toolchain non-interactively

* Enhance toolchain selection test

Now we test the non-interactive selection, and the local selection

4 years agoMake `alr index` default to --list and cosmetic retouching (#808)
Alejandro R Mosteo [Thu, 26 Aug 2021 08:14:23 +0000 (10:14 +0200)]
Make `alr index` default to --list and cosmetic retouching (#808)

* Make `alr index` default to `--list`

* list indexes with same header format as elsewhere

4 years agoFix iteration with cursors in search command (#807)
Alejandro R Mosteo [Wed, 25 Aug 2021 09:58:02 +0000 (11:58 +0200)]
Fix iteration with cursors in search command (#807)

4 years agoHide alr-deployed releases from external detection (#805)
Alejandro R Mosteo [Wed, 25 Aug 2021 09:57:46 +0000 (11:57 +0200)]
Hide alr-deployed releases from external detection (#805)

This is done so when a regular compiler from Alire is put in the path, it won't
be doubly available as a regular release and as an external release, which may
be confusing.

4 years agoImplement `alr toolchain --disable-assistant` (#803)
Alejandro R Mosteo [Mon, 23 Aug 2021 11:57:01 +0000 (13:57 +0200)]
Implement `alr toolchain --disable-assistant` (#803)

* Implement `alr toolchain --disable-assistant`

* Disable the assistant in testsuite using new swithc

4 years agoImprovements to cleanup of temp files (#799)
Alejandro R Mosteo [Mon, 23 Aug 2021 08:25:54 +0000 (10:25 +0200)]
Improvements to cleanup of temp files (#799)

* Clean temporaries in config cache too

* Show size of freed temporary files

* Track and delete temp files on Ctrl-C

* CI fix

* Ensure all paths are absolute

4 years agoUpdate README to reflect current build situation (#797)
Alejandro R Mosteo [Thu, 19 Aug 2021 12:36:44 +0000 (14:36 +0200)]
Update README to reflect current build situation (#797)

4 years agoFix compilation with GNAT FSF 7.5 (#793)
onox [Thu, 19 Aug 2021 07:45:29 +0000 (09:45 +0200)]
Fix compilation with GNAT FSF 7.5 (#793)

4 years agoMove the lockfile inside `$crate/alire` (#789)
Alejandro R Mosteo [Thu, 19 Aug 2021 07:44:58 +0000 (09:44 +0200)]
Move the lockfile inside `$crate/alire` (#789)

* Lockfile silently migrated to $crate/alire

* testsuite: new test for the silent migration

* testsuite: fixes for existing tests

* user-changes.md: document the new lock location

4 years agoAllow to configure toolchain locally (#788)
Alejandro R Mosteo [Wed, 18 Aug 2021 17:04:15 +0000 (19:04 +0200)]
Allow to configure toolchain locally (#788)

4 years agoBump version to 1.1.0-rc1
Alejandro R. Mosteo [Wed, 18 Aug 2021 11:35:29 +0000 (13:35 +0200)]
Bump version to 1.1.0-rc1

4 years agoMerge toolchain PRs into master
Alejandro R Mosteo [Wed, 18 Aug 2021 11:30:53 +0000 (13:30 +0200)]
Merge toolchain PRs into master

Toolchains-related PRs

4 years agoReinstate "forbids" property (#781)
Alejandro R Mosteo [Wed, 18 Aug 2021 11:11:06 +0000 (13:11 +0200)]
Reinstate "forbids" property (#781)

* Load "forbids" property, and test

* Update catalog spec document

* doc/user-changes.md: documented "forbids" property

4 years agoReleases providing the same 3rd crate no longer implicitly conflict (#780)
Alejandro R Mosteo [Wed, 18 Aug 2021 10:59:22 +0000 (12:59 +0200)]
Releases providing the same 3rd crate no longer implicitly conflict (#780)

* Crates that "provides" the same no longer conflict

This allows having several compilers in the same crate

* Remove assumptions derived from implicit conflicts

* Speed-ups in solver for the gnat dependency

* doc/toolchains.md: Update to reflect current status

* Typo

4 years agoBinary crates, toolchain management and use (#775)
Alejandro R Mosteo [Wed, 18 Aug 2021 10:28:45 +0000 (12:28 +0200)]
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

4 years agoAlr.Commands.Init: config.gpr project should be abstract (#785)
Fabien Chouteau [Tue, 17 Aug 2021 10:38:14 +0000 (12:38 +0200)]
Alr.Commands.Init: config.gpr project should be abstract (#785)

4 years agoUnreferenced warnings building for macOS (#782)
Simon Wright [Tue, 17 Aug 2021 08:55:52 +0000 (09:55 +0100)]
Unreferenced warnings building for macOS (#782)

* src/alr/os_macos/alr-platforms-macos.adb: removed unreferenced unit
      Alire.Origins.Deployers.
  * src/alr/os_macos/alr-platforms-macos.ads: likewise, Alire.Origins.

4 years agoAlr.Commands.Init: change defaults for init project to release mode (#777)
Fabien Chouteau [Tue, 3 Aug 2021 15:39:38 +0000 (17:39 +0200)]
Alr.Commands.Init: change defaults for init project to release mode (#777)

I first decided to make the default better for developers (to catch as many errors as possible), but they end up in release crates which means that the performance is bad as well as the compatibility between compiler versions.

This patch set the defaults to max performance and compatibility.

This system is clearly not very user friendly, maybe we have too many options here.
Profiles like in Cargo could be better.

4 years agoDeploy dependencies atomically and related cleanup subcommand (#768)
Alejandro R Mosteo [Tue, 20 Jul 2021 16:08:18 +0000 (18:08 +0200)]
Deploy dependencies atomically and related cleanup subcommand (#768)

* Use a temporary to fetch & deploy releases

This is done to avoid an interrupted download (for example with Ctrl-C) to
mistake our deployer, which considers an existing directory as a successfully
deployed dependency.

* Cmd.Clean: implement --temp option

To remove any dangling temporaries

* Improve clean --cache to avoid useless downloads

* Test for `alr clean --temp`

4 years agoFix obsolete reference to `alr list` (#773)
Alejandro R Mosteo [Tue, 20 Jul 2021 14:51:53 +0000 (16:51 +0200)]
Fix obsolete reference to `alr list` (#773)

4 years agoFix corner case when pinning to a not available version (#767)
Alejandro R Mosteo [Fri, 2 Jul 2021 07:38:57 +0000 (09:38 +0200)]
Fix corner case when pinning to a not available version (#767)

* Less confusing user feedback for existing pin

* Typo in comment

* Fix for corner case in which no solution was found

The solution is impossible, but still an incomplete solution should be
returned. In essence, when the user requested an impossible situation by
applying a pin to a non-existent version for a crate already in the
dependencies, the solver reused the old version assuming it would succeed,
which was not the case if the pin is impossible.

* Better pin info separation

* Extra test case for pinning to unavailable version

4 years agoAllow loading manifests with broken pins (#766)
Alejandro R Mosteo [Fri, 2 Jul 2021 07:20:46 +0000 (09:20 +0200)]
Allow loading manifests with broken pins (#766)

4 years agoFixed cycle detection (#764)
Alejandro R Mosteo [Wed, 30 Jun 2021 07:16:31 +0000 (09:16 +0200)]
Fixed cycle detection (#764)

4 years agoMerge all pin-related recent PRs into master
Alejandro R Mosteo [Mon, 28 Jun 2021 15:43:07 +0000 (17:43 +0200)]
Merge all pin-related recent PRs into master

Merge all pin-related recent PRs into master

4 years agoFix pinning with explicit version (#762)
Alejandro R Mosteo [Mon, 28 Jun 2021 15:19:58 +0000 (17:19 +0200)]
Fix pinning with explicit version (#762)

* Fix validation of version pins

* Testsuite: test for more cases of version pins

4 years agoFix conversion of references to commits (#761)
Alejandro R Mosteo [Mon, 28 Jun 2021 14:20:45 +0000 (16:20 +0200)]
Fix conversion of references to commits (#761)

* Completed Roots.Editable commands for removal

* Completed Alr.Commands.Pin

* Reinstated all `alr pin` functionality

* Reinstated remaining disabled pin tests

* Reinstated remaining disabled tests

* Testsuite: fix platform-independent path on Windows

* Implement pin commands in alr driver

* Testsuite: Implement with command in alr driver

* Testsuite: equivalence between manual and cmd-line

* Fix git folder deletion on Windows

* Fix reference to commit mode

4 years agoImplement `--branch` in `alr with`, `alr pin` (#760)
Alejandro R Mosteo [Mon, 28 Jun 2021 14:07:05 +0000 (16:07 +0200)]
Implement `--branch` in `alr with`, `alr pin` (#760)

* Completed Roots.Editable commands for removal

* Completed Alr.Commands.Pin

* Reinstated all `alr pin` functionality

* Reinstated remaining disabled pin tests

* Reinstated remaining disabled tests

* Testsuite: fix platform-independent path on Windows

* Implement pin commands in alr driver

* Testsuite: Implement with command in alr driver

* Testsuite: equivalence between manual and cmd-line

* Fix git folder deletion on Windows

4 years agoRe-enable pin removal option and related tests (#759)
Alejandro R Mosteo [Mon, 28 Jun 2021 13:21:46 +0000 (15:21 +0200)]
Re-enable pin removal option and related tests (#759)

* Completed Roots.Editable commands for removal

* Completed Alr.Commands.Pin

* Reinstated all `alr pin` functionality

* Reinstated remaining disabled pin tests

* Reinstated remaining disabled tests

* Testsuite: fix platform-independent path on Windows

4 years agoReinstante `alr with --pin` (#758)
Alejandro R Mosteo [Sat, 26 Jun 2021 13:27:29 +0000 (15:27 +0200)]
Reinstante `alr with --pin` (#758)

* Implement temporary root copies

* Preparations for manifest modification via Roots

This way, alr with/alr pin become mere proxies for the Alire.Roots functions,
which is as it should have been from the start.

* User_Pins: programmatic creation and TOML oneliner

* Roots manifest editor procedures

* Moved root edition to Alire.Roots.Editable

* Reinstated `alr with [crate] --use`

* Narrowing-down of dependencies without pin

* Tweaks for existing `with` tests

* Re-enabled tests depending on `alr with --use`

* Tweaks found during self-review

* Attempt to fix error in older GNATs

4 years agoDetect circularities in link pins (#755)
Alejandro R Mosteo [Fri, 25 Jun 2021 10:16:08 +0000 (12:16 +0200)]
Detect circularities in link pins (#755)

* Detect circularities in link pins

* Test for self-pinning and circularities

* Fix platform-dependent path on Windows

4 years agoPins to remote branches (#754)
Alejandro R Mosteo [Fri, 25 Jun 2021 09:28:24 +0000 (11:28 +0200)]
Pins to remote branches (#754)

* Accept "branch" in remote pins

* Refactor pin loader for clarity

* Load/Store branch in lockfile

* Do use branches for pin checkouts/updates

* Use pin branch for showing solution differences

* New test for conflicting link pins

* New test for detecting pin path changes

* Document new branch pins

* New test specific for branch pins

* Fixes found during self-review

* Fixes caught by testsuite on Windows

* More fixes during self-review

* Fixes requested during review

4 years agoFixes/tests for recursive link pins (#751)
Alejandro R Mosteo [Wed, 23 Jun 2021 10:15:18 +0000 (12:15 +0200)]
Fixes/tests for recursive link pins (#751)

* Fixes for recursive link pins

* Use link relative paths in output

Internally absolute paths are used, which allows to remove some complex logic.

* Bypass dangling reference warning in some gnat versions

* Fixes for absolute paths on Windows

* Cosmetic fix for `alr pin`

* Ensure user pins in memory use absolute paths

This simplifies internals when referring to recursive pins. Paths in the
lockfile and displayed to the user are still shown as relative to the root.

* New improved remote pin management

* Remove some redundant info output

* Remove Externals.Softlinks in favor of User_Pins

* Found cause & workaround of CE2021 path corruption bug

* Testcase minor fix

* Fix spellcheck CI

I broke it inadvertently when disabling spelling for the lockfile

* New tests for recursive pins and more

* Clarifications and tweaks during self-review

* Backport VCSs.Git changes

* Update pins in alire.toml for self-build

* Fixes found by the testsuite on Windows

* Cosmetic fixes found during self-review

4 years agoPins in the manifest (#743)
Alejandro R Mosteo [Tue, 22 Jun 2021 15:55:12 +0000 (17:55 +0200)]
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

4 years agoUpdate msys installer to latest stable release (#756)
Alejandro R Mosteo [Tue, 22 Jun 2021 14:12:31 +0000 (16:12 +0200)]
Update msys installer to latest stable release (#756)

* Update msys installer to latest stable release

* Alr.Platforms.Windows: new msys2 installer doesn't need extra script

Co-authored-by: Fabien Chouteau <chouteau@adacore.com>
4 years agoShow bad tag in error message (#749)
Alejandro R Mosteo [Wed, 16 Jun 2021 14:41:58 +0000 (16:41 +0200)]
Show bad tag in error message (#749)

4 years agoFix new warnings in CE2021 (#746)
Alejandro R Mosteo [Mon, 14 Jun 2021 10:15:01 +0000 (12:15 +0200)]
Fix new warnings in CE2021 (#746)

* Initial fixes for CE2021

* Resolve conflicts with CE2020

* Update CI scripts to use CE2021

* Revert CE version for macOS CI tests

* Remove conflicting Append_Vector

* Remove unused entities in Windows

* Fix bug uncovered by CE2021

* Fix timestamps compare when mixing G.OS_Lib/A.Dirs

* Update pins for self-build

* Disable self-build, that uses CE2021

It cannot succeed until the patches in this very PR are merged, as it is
attempting to build the old code with the new compiler in the setup-alire
action.

* More fixes for relative paths in softlinks

* Remove unused entities in Windows build

4 years agoalr-commands-init.adb: add config/ in .gitignore (#744)
Fabien Chouteau [Sat, 29 May 2021 09:14:14 +0000 (11:14 +0200)]
alr-commands-init.adb: add config/ in .gitignore (#744)

The crate configuration is always generated by alr and should not be checked-in.

4 years agoCrate Configuration: add options to control the generators (#740)
Fabien Chouteau [Sat, 22 May 2021 09:26:58 +0000 (11:26 +0200)]
Crate Configuration: add options to control the generators (#740)

* Crate Configuration: add options to control the generators

* Move the auto-gpr-with feature to the crate configuration

* Fix review comments

4 years agoCheck_Absolute_Path on Windows should also accept lowercase drive letters (#741)
Fabien Chouteau [Thu, 20 May 2021 08:12:00 +0000 (10:12 +0200)]
Check_Absolute_Path on Windows should also accept lowercase drive letters (#741)

#739

4 years agoTweaks to README and Gitpod badge (#742)
Alejandro R Mosteo [Thu, 20 May 2021 08:11:02 +0000 (10:11 +0200)]
Tweaks to README and Gitpod badge (#742)

4 years agoSynchronize alire metadata and git submodules (#720)
Alejandro R Mosteo [Sat, 15 May 2021 22:28:48 +0000 (00:28 +0200)]
Synchronize alire metadata and git submodules (#720)

* Sync submodules and alire metadata

* Reenable self-build in all platforms

* Feedback about build

* Disable macOS

Somehow apt-get ends being called. To be diagnosed.

* Fix environment settings in manifest

This should fix the problem with the macOS build

* Identified and fixed issue with macOS build

The problem is that the native package in the lockfile was being blindly used.
This is a further hint that lockfiles require work to work better
cross-platform.

* Fix issue with indirect dependencies in test

The self-build test has uncovered an issue already reported, and this commit
also fixes minor differences in output for linked dependencies, depending on
whether they contain alire metadata or not (the same information can be
presented regardless)

Also, disabled version printing on setup-alire, and moved here

4 years agoAdd gitpod-enabling files (#735)
Alejandro R Mosteo [Fri, 14 May 2021 11:22:11 +0000 (13:22 +0200)]
Add gitpod-enabling files (#735)

* Files to provide GNAT on Gitpod

* Add alr to path

* Add VSCode task to run the testsuite

* Set explicit project file in VSCode so ALS works

* Add task to just compile current file

4 years agoInitial tasks.json file for VSCode (#734)
Alejandro R Mosteo [Thu, 13 May 2021 15:45:54 +0000 (17:45 +0200)]
Initial tasks.json file for VSCode (#734)

4 years agoWorkround for issue #729 (#731)
Simon Wright [Mon, 10 May 2021 13:36:14 +0000 (14:36 +0100)]
Workround for issue #729 (#731)

Updated rules in 3.10.2 and 6.4.1(6) caused the use of
Constant_Reference, which takes the Container as an aliased parameter,
to trip over its use on a container passed as an un-aliased parameter.

  * src/alire/alire-conditional_trees.ads (Root): replace
      Constant_Reference by Element.
  * src/alire/alire-dependencies-states.adb ("="): likewise.
  * src/alire/alire-conditional_trees.adb (To_YAML (1)): likewise.
    (Image_One_Line): likewise.
    (Iterate): replace Constant_Reference.Element.all by just Element.

4 years agoAllow named references to identify the commit for a remote pin (#718)
Alejandro R Mosteo [Fri, 26 Mar 2021 11:34:10 +0000 (12:34 +0100)]
Allow named references to identify the commit for a remote pin (#718)

* Allow using named commits for remote pinning

* Update pin/with help for general references

* Update build in version

4 years agoHighlight switches in help text (#717)
Alejandro R Mosteo [Fri, 26 Mar 2021 11:22:59 +0000 (12:22 +0100)]
Highlight switches in help text (#717)

4 years agoComplete/rename the set of feedback procedures with icon prefix (#716)
Alejandro R Mosteo [Fri, 26 Mar 2021 11:20:54 +0000 (12:20 +0100)]
Complete/rename the set of feedback procedures with icon prefix (#716)

* Complete and rename the feedback one-liners

* Use Put_Info to report HEAD commit when pinning remote

* Tag version with commit

4 years agoUse of git repositories as pin remotes (#715)
Alejandro R Mosteo [Thu, 25 Mar 2021 17:29:36 +0000 (18:29 +0100)]
Use of git repositories as pin remotes (#715)

* Skeleton function and calls from Commands.*

* Use a remote commit for a local pin

* Ensure remote pins are in place for build

* Show info for remote pins

* Fix url section separator @ -> #

* Generalize transitive links for remote links

* Display remote source in `alr pin`

* Refactor a few paths for reuse

* New test for pinned remote

* Document new feature

* Fix help for affected commands

* Tweaks during self-review

* Fix test for Windows

* Ensure cache is deletable on Windows

4 years agoDead/duplicated code cleanup (allowed milestones, manual hashing) (#714)
Alejandro R Mosteo [Wed, 24 Mar 2021 11:01:52 +0000 (12:01 +0100)]
Dead/duplicated code cleanup (allowed milestones, manual hashing) (#714)

* Remove dead code obsolescent since `alr publish`

* Remove Alire.Milestones.Allowed_Milestones

This was redundant, being in essence the same thing as a dependency.

4 years agoTransitively add pinned dirs (#713)
Alejandro R Mosteo [Wed, 24 Mar 2021 10:22:58 +0000 (11:22 +0100)]
Transitively add pinned dirs (#713)

* Store relative pins when given as such

* Ensure pinned dirs use portable paths when relative

* Adjustments in testsuite for new relative links

* Recursively add links when linking crates

* Compound relative paths when adding links

* Restore inadvertently removed comment

* Relax too restrictive checks

In the case of linked releases, it doesn't matter if these contain expressions
as we don't write them to disk. As for the spurious warning during loading of
links, we may be transitively loading and the assumption on the current
directory is faulty in that case. The check must be performed elsewhere.

* Require approval for links to non-existent dirs

* Show broken links in dependency image

* Testsuite: new test and minimal tweaks

* Code review fixes

* Softlinks: report absolute project paths

4 years agoStore relative pins as such (#711)
Alejandro R Mosteo [Tue, 23 Mar 2021 14:53:33 +0000 (15:53 +0100)]
Store relative pins as such (#711)

* Store relative pins when given as such

* Ensure pinned dirs use portable paths when relative

* Adjustments in testsuite for new relative links

4 years agoUse remote of local branch for publishing (#712)
Alejandro R Mosteo [Mon, 22 Mar 2021 14:38:45 +0000 (15:38 +0100)]
Use remote of local branch for publishing (#712)

4 years agoFix compilation with older versions of GNAT (#710)
onox [Fri, 12 Mar 2021 08:09:56 +0000 (09:09 +0100)]
Fix compilation with older versions of GNAT (#710)

4 years agoError scopes (#706)
Alejandro R Mosteo [Wed, 10 Mar 2021 17:32:45 +0000 (18:32 +0100)]
Error scopes (#706)

* Initial implementation of error scopes

As long as errors are stored with Errors.Set, they will preserve any enclosing
error scopes, even when not using a TOML_Adapters.Key_Queue

* Fix unreferenced parameters

4 years agoRefactor the expression loader (#702)
Alejandro R Mosteo [Tue, 9 Mar 2021 18:36:29 +0000 (19:36 +0100)]
Refactor the expression loader (#702)

* Pseudotypes specs

* Preparations to replace the generics mesh

* Buildable with the new design, still unimplemented

Only stub bodies

* New expression loader complete, pending ptypes

* Renamed packages Pseudotypes.* to Expressions.*

* Alire.Expressions.* implementation complete

* All functionality complete, tests missing

* System externals now reuse dynamic loaders

* Fixes found by the testsuite, and output tweaks

There is a functional difference that affects the output for some tests:
before, all enum cases received a value, even if it came from an "others"
clause. This meant that all cases were explicitly listed. Now, the "others" is
stored as is, and the output reproduces the contents of the TOML structure. A
few tests had to be adjusted for this.

* Fixes found testing the current stable index

* Remove obsolete documentation

* Implement and test 'x|y' expressions

* Improve output of `alr show` for system packages

* Fixes found during self-review: comments, dead code

* Fix for system externals report

* Alternative implementation for older GNATs

4 years agoFix broken link, mention autocompletion (#705)
Alejandro R Mosteo [Tue, 9 Mar 2021 18:36:06 +0000 (19:36 +0100)]
Fix broken link, mention autocompletion (#705)

4 years agoSubprocesses: Better error if unable to create tmp file (#703)
Alejandro R Mosteo [Mon, 8 Mar 2021 16:27:17 +0000 (17:27 +0100)]
Subprocesses: Better error if unable to create tmp file (#703)

4 years agoRemove Alire.Requisites and Alire.Boolean_Trees (#701)
Alejandro R Mosteo [Fri, 5 Mar 2021 15:52:04 +0000 (16:52 +0100)]
Remove Alire.Requisites and Alire.Boolean_Trees (#701)

* Availability as conditional tree

* Refactor up to Alire.Releases

* It builds for all of Alire.*

* It completely builds

* Testsuite passing, minor cosmetic fixes

There is a minor improvement for trees in which a vector with a single value is
promoted to the single value itself. As vectors are delimited by '(' ')', there
are a few test outputs that required eliminating these former extra
parentheses.

* Dead code removal related to old Ada index

* Case exprs excised from Requisites

This allows more dead code removal and some further internal simplifications.

* Removed Requisites and all related dead code

No longer needed, Requisites were useful in the old index for general
expressions, but not anymore in our case-restricted index. Some quite obscure
portions of Alire code can be thus removed.

* Bring gnatelim up to date

It bugboxes anyway, so it's not currently usable

* Stetic tweaks found during selfreview

4 years agoCache lockfiles, remove Root global, and related refactorings (#690)
Alejandro R Mosteo [Fri, 5 Mar 2021 14:46:56 +0000 (15:46 +0100)]
Cache lockfiles, remove Root global, and related refactorings (#690)

* Changes up to Alire.Roots

* Finished migrating from Workspace

* Root is stored in Alr.Commands.Command for reuse

This way the global Root is no longer reloaded many times, and modifications
are properly encapsulated via the Alire.Roots.Root type. This removes one of
the outstanding code smells in Alire.

* Speed-ups related to lockfile checks

There were a number of overkill checks that furthermore were expensive, loading
the lockfile many times. This became quite noticeable for large lockfiles (once
there is a decent number of dependencies).

* Minor tweaks to comments

* Tweaks after merging from master

Two big PRs were merged from upstream that created some friction with these
changes, requiring minor tweaks.

* Temporarily disable `alr build` CI check

To allow merging with changes in dependencies, temporarily disable the
aforementioned check.

4 years agoAdd `alr publish --manifest <path/to/file.toml>` variant (#635)
Alejandro R Mosteo [Wed, 3 Mar 2021 15:54:48 +0000 (16:54 +0100)]
Add `alr publish --manifest <path/to/file.toml>` variant (#635)

* alire.ads: bump version to 1.1.0-dev

* user-changes.md: add header for 1.1

* Publish: --manifest working for git remotes

* Publish: --manifest working for --tar releases

* Testsuite: publish --manifest variants

* Updated documentation

* CI-found fixes

* Rebase tweaks and bumped version

* user-changes.md: move log entry to 1.1 section

* publishing.md: Reword explanation of --manifest

4 years agoConfiguration feature extras (#700)
Alejandro R Mosteo [Wed, 3 Mar 2021 15:41:34 +0000 (16:41 +0100)]
Configuration feature extras (#700)

* [configuration] as top-level table in manifests

[config_vars] and [config_settings] are now [configuration.variables] and
[configuration.settings]

* Replace stderr warnings with regular ones

* Fix YAML output

* Rename `configuration.settings` to `@.values`

This is under the rationale that `settings` makes more sense for configuring
how Alire deals with the configuration.

* Update documentation for new config tables

* Fix obsolete comment

4 years agoStart support for crate configuration (#673)
Fabien Chouteau [Wed, 3 Mar 2021 15:18:34 +0000 (07:18 -0800)]
Start support for crate configuration (#673)

This is the possibility for crates to define configuration variables
that will then generate Ada, C, or GPR files based on the values set by
depending crates.

For embedded projects where compile optimization and static memory usage
are important, it is possible to define sizes of cache buffers or
maximum amount of some resources.

It allows to enable or disable features at compile time, such as debug
logging.

4 years agoBump version to 1.1.0-dev (#697)
Alejandro R Mosteo [Tue, 2 Mar 2021 11:59:13 +0000 (12:59 +0100)]
Bump version to 1.1.0-dev (#697)

* alire.ads: bump version to 1.1.0-dev

* user-changes.md: add header for 1.1

4 years agouser-changes.md: fix format that breaks GH pages rendering (#696)
Fabien Chouteau [Wed, 24 Feb 2021 15:44:30 +0000 (07:44 -0800)]
user-changes.md: fix format that breaks GH pages rendering (#696)

4 years agoBump version to 1.0 (#693)
Alejandro R Mosteo [Wed, 24 Feb 2021 14:40:02 +0000 (15:40 +0100)]
Bump version to 1.0 (#693)

4 years agoFix bash completion after help formatting changes (#694)
Alejandro R Mosteo [Wed, 24 Feb 2021 14:39:21 +0000 (15:39 +0100)]
Fix bash completion after help formatting changes (#694)

4 years agoBumped version to 1.0 RC 3
Alejandro R. Mosteo [Tue, 16 Feb 2021 12:23:58 +0000 (13:23 +0100)]
Bumped version to 1.0 RC 3

4 years agoHelp output formatting (#688)
onox [Tue, 16 Feb 2021 12:21:31 +0000 (13:21 +0100)]
Help output formatting (#688)

* Color commands in alr [help] and display in groups

* Prevent Getopt from intercepting -h and --help

* Change formatting of command and global options help

* Fix test equivalent_help

* Only print title if there are more than zero options

4 years agoFix problem when temp file doesn't exist (#686)
Alejandro R Mosteo [Mon, 8 Feb 2021 11:52:38 +0000 (12:52 +0100)]
Fix problem when temp file doesn't exist (#686)

4 years agouser-changes.md: document SPDX license expressions (#683)
Fabien Chouteau [Sat, 6 Feb 2021 15:55:48 +0000 (16:55 +0100)]
user-changes.md: document SPDX license expressions (#683)

* user-changes.md: document SPDX license expressions

* Typo

* Another typo

Co-authored-by: Alejandro R. Mosteo <amosteo@unizar.es>
4 years agouser-changes.md: Add markers for releases (#684)
Fabien Chouteau [Fri, 5 Feb 2021 10:53:30 +0000 (11:53 +0100)]
user-changes.md: Add markers for releases (#684)

This will help users identify what is new since the last release.