* 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.
* 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
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.
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.
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.
Automatically narrow down dependencies given as "any" (#675)
* Implement narrowing down of new "any" dependencies
Instead of adding just a foo* dependency, check how it was solved and use that
version to add a more precise (and usually wanted) dependency; e.g., foo^1.2,
foo~0.1
* Fix case of dependency removal
* New test and fixed other tests to new behavior
Many tests explicitly check the added dependencies, so this is extra assurance
about this change.
Fabien Chouteau [Tue, 2 Feb 2021 17:42:05 +0000 (18:42 +0100)]
alr-platforms-windows.adb: msys2 install command line changed (#677)
https://github.com/msys2/msys2-installer/pull/20 changed the name of the argument for installation prefix of the msys2 installer.
All previous versions are impacted and won't be able to install msys2 at the correct location.
This flag filters out packages installed indirectly (as dependencies), causing
our detection of such a package to fail. -Q by design already only works on
installed packages, so that's all we need.
The addition of more enum values to support other distributions is a
breaking change. This raises the question of whether we should simply drop
unknown enum values, as this could well work. But then, using an improper value
would silently fail. Perhaps the warning could be disabled for normal use and
re-enabled for publish?
Separate workflow to test unsupported package manager platform (#623)
* Workflow to test with unsupported package manager
* Add config option to disable distro detection
With test
* Fixes for circular elaboration
* Fix test for slight change in behavior
Before the last changes to break circularities, we tried to load the manifest
as part of the config loading process. Now we are satisfied with finding a
properly named file at the expected place. This causes one test to not detect
invalid TOML, since the manifest contents aren't really needed for the test.
Solver: Speed-up for impossible dependencies (#620)
* Solver: Speed-up for impossible dependencies
Whenever a solution is incomplete we keep looking for solutions. But if the
reason for incompleteness is an impossible request (non-existent crate or
version), this resulted on finding all combinations for the rest of crates that
do have satisfiable dependencies.
With this patch, impossible situations are considered part of the "complete"
solution (as there cannot be a more complete one), which allows the solver to
use complete the search much more quickly, as no pointless attempts for more
solutions are made.
* Fixes for problems caught by the test suite
The optimization was too aggressive, as it took place before detecting
externals. Also, it should only apply to direct unavoidable dependencies, as
indirect impossibilities can be avoided by other solutions.
Added alire.toml so alr can build/edit itself (#575)
* Added alire.toml so alr can build/edit itself
Also bumped the patch number, as code changes from now own should appear in a
future release, and 0.7-dev means pre-0.7 according to semantic versioning.
Fabien Chouteau [Wed, 4 Nov 2020 20:32:52 +0000 (21:32 +0100)]
Alire.Environment: load env context from the platform (#608)
* Alire.Environment: sort env list for predictable output
* Alire.Environment: load env context from the platform
For the moment this is only used on Windows for msys2. Before this patch the msys2 env was not included in `alr print` which means that the context was not complete.
* Alr.Platforms.Windows: do not install msys2 if pacman already in PATH
This makes alr usable when the user is already in an msys2 context.
And it alse makes possible to have an alire package in msys2.
Avoid unneeded requests to approve changes after editing the manifest (#591)
* Avoid unneeded requests to update when no changes
Changes in solutions were being spuriously detected, in situations in which
there were no changes. Also, when manual changes didn't affect dependencies,
the situation was not corrected either by manual update or automatic check.
Fabien Chouteau [Wed, 28 Oct 2020 19:27:46 +0000 (20:27 +0100)]
Alr.Commands.Init: warnings instead of fails for existing files (#599)
To make this command more usable when converting an existing Ada project
to Alire, existing source or gpr files are now reported as a warning
instead of an error.
Publish: Detect missing manifest in remote sources (#595)
This could escape our checks when the alire.toml file was in .gitignore, for
example, so we didn't detect the discrepancy between local and remote sources.
Use GitHub API for basic checks/info during publishing (#554)
* Use GitHub API for basic checks/info during publish
* Code review fix
* Fix: new config values unavailable during same run
New config entries were stored on disk but not added to the memory map. As the
Config.Set subprogram isn't aware of the level of configuration being set,
there is no direct way to both store to disk and to memory; instead the
solution is that the configuration is reloaded every time. This is a bit of
overkill and a candidate for later optimization.
Alire.Utils.User_Input: add function to query user's name, email and GitHub login (#461)
* Alire.Utils.User_Input: add function to query user's name, email and github login
* Break circular elaboration issue
Since Config uses Utils.User_Input indirectly via Deplyers.System, a
possibility is to move new User_Input functions that need Config into a new
package.
Co-authored-by: Alejandro R. Mosteo <amosteo@unizar.es>