]> _ Git - alire.git/log
alire.git
5 years agoLoad new per-release index manifests (#479)
Alejandro R Mosteo [Fri, 7 Aug 2020 12:32:42 +0000 (14:32 +0200)]
Load new per-release index manifests (#479)

* Migrate testsuite indexes to new split manifests

* Alire.Index: update community version

* Refactor Alr.OS_Lib.Traverse_Folder into Alire

As Alire.Directories.Traverse_Tree

* Alire.TOML_Index: traverse new folder structure

Also adapt the checks to the new structure, and double-check that the file name
matches the manifest contents (name, version).

* Refactor Crate internals for new flat manifests

Since now each release is truly independent, crates need not to store the
common information as previously. This is done now only for external
definitions in a narrower scope.

Several loading functions can also be streamlined since now it's simpler to get
a proper complete release without requiring its enclosing crate.

The bulk of the refactoring emanates from merging Alire.Crates.With_Releases
into simply Alire.Crates, and repurposing the Alire.Crates.Sections enum.

* Use new [[depends-on]] dependencies

Nothing outwards has changed yet; the manifest is still entirely machine
generated. This commit only changes the table [depends-on] into an array of
[[depends-on]] tables.

* Testsuite fixes for new format

Fixes in code detected by the testsuite, and small changes in output due to
code refactorings.

* New tests for index structure

* Review cleanup

Assorted minor refactors

* Code review: restore lost comments in testsuite

5 years agoScript to migrate indexes to per-release files (#478)
Alejandro R Mosteo [Fri, 7 Aug 2020 12:17:44 +0000 (14:17 +0200)]
Script to migrate indexes to per-release files (#478)

* Ignore JetBrains IDE config folders and virtualenvs

* s/libhello/li (index subfolder improper name)

* Fix invalid semantic version in some test crates

s/_/-/, turns out only hyphens are allowed in the pre-release portion.

* Script to split crate files into releases

It applies the foreseeable needed transformations: one release per file, one
file for external definitions; dependencies moved to an array; added name and
version keys.

Fix relative paths during migration

5 years agoUse GNAT Community 2020 in CI scripts (#498)
Fabien Chouteau [Mon, 31 Aug 2020 08:58:55 +0000 (10:58 +0200)]
Use GNAT Community 2020 in CI scripts (#498)

5 years agoWindows installer for alr (#481)
Fabien Chouteau [Thu, 30 Jul 2020 11:17:00 +0000 (04:17 -0700)]
Windows installer for alr (#481)

* Windows installer scripts for alr

* Update scripts/installer/auto-install.js

* Update ci-windows.yml

5 years agoAdd and use Alire.Lockfiles.Contents type (#477)
Alejandro R Mosteo [Wed, 22 Jul 2020 08:45:23 +0000 (09:45 +0100)]
Add and use Alire.Lockfiles.Contents type (#477)

This type allows future generalization of what is stored in the lock file,
where currently it could only store a Solution which was at top level.

5 years agoAlire.Origins: check length of git and hg commit id (#476)
Fabien Chouteau [Fri, 17 Jul 2020 17:13:42 +0000 (19:13 +0200)]
Alire.Origins: check length of git and hg commit id (#476)

And raise a meaningful exception instead of Constraint_Error.

5 years agoUpdate automatically after manual manifest edition or missing dependency detection...
Alejandro R Mosteo [Thu, 16 Jul 2020 08:47:19 +0000 (09:47 +0100)]
Update automatically after manual manifest edition or missing dependency detection (#472)

* Remove redundant parameter in Alire.Workspace

Environment can now be retrieved from Alire.Roots.Root.

* New Alire.Roots.Sync_Solution_And_Deps

This procedure verifies that the lockfile is not older than the manifest, and
that all dependencies in the solution exist on disk. Otherwise, dependencies
are redeployed.

* Refactor/cleanup paths from Alire.Paths

The dependency path is always used in the context of an Alire.Roots.Root, so it
is more meaningful being defined there.

Also removed the cache path that wasn't used anywhere.

* Checks against reexporting the same environment

* Refactor Alr.Commands.Requires_Full_Index into Alire

This way, the index loading can be triggered by logic in Alire that absolutely
requires the index to be loaded.

* Do not auto update before `alr update`

* Refactor Confirm_Solution_Changes into Alire

From Alr.Commands.User_Input into Alire.Utils.User_Input.

* Tests for the new sync features

- Test that a manually modified manifest results in an autosync
- Test that missing dependencies in the cache are redeployed

* Fix elaboration circularity

5 years agoAlire.VCSS.Git: always clone recursively (#471)
Fabien Chouteau [Mon, 13 Jul 2020 16:04:33 +0000 (18:04 +0200)]
Alire.VCSS.Git: always clone recursively (#471)

Git submodules are often mandatory parts of a repository.

5 years agoAlr.Commands.Init: add library type handling in generated project (#470)
Fabien Chouteau [Mon, 13 Jul 2020 15:58:35 +0000 (17:58 +0200)]
Alr.Commands.Init: add library type handling in generated project (#470)

type Library_Type_Type is ("relocatable", "static", "static-pic");
   Library_Type : Library_Type_Type :=
     external ("XXX_LIBRARY_TYPE",
               external ("LIBRARY_TYPE", "static"));
   for Library_Kind use Library_Type;

5 years agoNew `alr with --versions` for version-related info of dependencies (#464)
Alejandro R Mosteo [Wed, 8 Jul 2020 13:35:11 +0000 (15:35 +0200)]
New `alr with --versions` for version-related info of dependencies (#464)

* New `alr with --versions` for version-related info

This new version focuses on showing: which constraints were found for each
dependency, which version was used to fulfill them, and what's the latest
existing version for a crate (hence pointing to possible wanted updates).

* Review fixes

5 years agodoc/catalog-format-spec.md: update environment section (#467)
Fabien Chouteau [Wed, 8 Jul 2020 10:04:34 +0000 (12:04 +0200)]
doc/catalog-format-spec.md: update environment section (#467)

To match the actual features and variable names.

5 years agoMove ASCII graph to `--graph` switch, and add a `--tree` alternative & fallback ...
Alejandro R Mosteo [Mon, 6 Jul 2020 17:38:06 +0000 (19:38 +0200)]
Move ASCII graph to `--graph` switch, and add a `--tree` alternative & fallback (#465)

* New `alr with --tree`, `alr show --tree` switch

Prints dependency graph in tree form, as an alternative to the ascii-art plots
that 1) not always will be available, depending in libgraph-easy-perl and 2)
quickly become big and broken.

* Move ASCII graph to dedicated --graph switch

Previously, it was always attempted to be shown with `--solve`, which could be
an unnecessary pollution for an otherwise useful command.

* Update user-changes document

5 years agoA couple of improvements on the handling of project files and paths (#463)
Fabien Chouteau [Mon, 6 Jul 2020 13:41:13 +0000 (15:41 +0200)]
A couple of improvements on the handling of project files and paths (#463)

* Alire.Releases: fix basename in Project_Files()

* Alire.Releases.Project_Paths: Add empty path for gpr in the root dir of a crate

* Alire.{Root|Release}: remove trailing path separator in Roots.Project_Paths

Doing it here means that case "base_dir/<empty_path>" is also handled.
i.e. return "base_dir" instead of "base_dir/"

* Alire.Roots: Do not always add root dir of crates in Project_Paths

The root dir will be included when necessary, i.e. when there is a project file.

* testsuite/drivers/asserts.py: revert repr() on output compare

It was useful to detect \r\n vs \n but make the test failure very
difficult to analyze otherwise.

* GPR_PROJECT_PATH tests: fix Windows vs UNIX paths

* tests/auto-gpr-with/gpr_in_subdir: improve test explanation

* Alire.Roots: expect UNIX dir separators from crates

5 years agoSet up environment before post-fetch actions (#456)
Alejandro R Mosteo [Mon, 6 Jul 2020 08:58:50 +0000 (10:58 +0200)]
Set up environment before post-fetch actions (#456)

* Alire.Environment: take release paths from a Root

The path lookup has three levels:
1. For the root release, the own root folder
2. For a regular release, the dependencies folder "/" release unique folder
3. For a pinned softlink, the absolute path of the softlink

The root contains the solution which in turn contains the softlinks, so the
query for the path can be directly made to the root.

* Set up build env before deploying dependencies

* Tests for softlink nested path and env export

* Review fixes

* Alire.Environment.Load: Remove unused parameter

This flies by CE but is detected by FSF (?)

* Alire.Roots: move expression functions to body

There's some bug manifesting when a lot of code is in the spec in which the
linker complaints about missing references.

* Spelling fixes

* Updated new tests index versions

* Rename dir_separator/path_separator to match GNAT...

... in the Python testsuite

* Remove trailing '/' separator in extra prj paths

This is to match the output of full path normalization by Ada.Directories.

5 years agoAlire.Environment: new handling of env variables (#452)
Fabien Chouteau [Mon, 6 Jul 2020 08:38:01 +0000 (10:38 +0200)]
Alire.Environment: new handling of env variables (#452)

* Alire.Environment: implement new handling of env variables

Including using the variables defined in the crate.

* Alire.Environment: implement string format for env vars in releases

For instance replacing "${DISTIB_ROOT}" by "/".

* Alire.Platform: implement msys2 root detection

* Alire.Environment: remove already defined function

Already in alire.ads

5 years agoRework Solutions.Diffs internals to use States (#457)
Alejandro R Mosteo [Thu, 2 Jul 2020 16:45:46 +0000 (18:45 +0200)]
Rework Solutions.Diffs internals to use States (#457)

* Rework Solutions.Diffs internals to use States

Now that the Solution type stores all relevant information via
Dependencies.States, making the diffs directly from the solution is both
simpler, more maintainable and more accurate.

* Fix unified user pin naming (target --> pin)

* Review fixes

5 years agoimplementation of an automatic gpr file with (#458)
Fabien Chouteau [Thu, 2 Jul 2020 14:10:08 +0000 (16:10 +0200)]
implementation of an automatic gpr file with (#458)

* First prototype implementation of an automatic gpr file with

* Add user query and config option for Auto-gpr-with

* Introduce Boolean properties

* Alire.Properties.Labeled: check TOML_Kind for labels

* auto-gpr-with: add crate entry to disable auto-gpr-with feature

* testsuite: allow custom indexes to reference fixtures/crates/

This removes duplication of several sources and archives.

* Bump index version to 0.3 for auto-gpr-with feature

* auto-gpr-with: do not add default project file for extern crates

* Bump alire-index in CI scripts

* tests/workflows/auto-gpr-with: rename test crate to avoid conflicts with scripts

* Review fixes

* tests/get/external-tool-dependency: make the test more robust

On Windows when using msys2, the make seen by alr can be different than
the one seen from the testsuite scripts. The means that the current way
to identify make's version will fail in some cases.

This patch introduces a different way to workaround the different
version numbers of make.

5 years agoci-github.sh: add -E testsuite option to see error messages (#459)
Fabien Chouteau [Thu, 2 Jul 2020 11:29:49 +0000 (13:29 +0200)]
ci-github.sh: add -E testsuite option to see error messages (#459)

* ci-github.sh: add -E testsuite option to see error messages

* testsuite/asserts.py: display escape sequence in expected vs actuall output

5 years agoTestsuite: canonicalize line endings in "alr" outputs (#460)
Pierre-Marie de Rodat [Wed, 1 Jul 2020 12:56:51 +0000 (14:56 +0200)]
Testsuite: canonicalize line endings in "alr" outputs (#460)

A recent e3-core update changed the behavior of e3.os.process.Run's
behavior regarding line endings, which are now left unchanged. This
creates discrepancies in process outputs depending on the platform.

5 years agoShow linked paths and per-release dependencies (#453)
Alejandro R Mosteo [Wed, 24 Jun 2020 21:08:17 +0000 (23:08 +0200)]
Show linked paths and per-release dependencies (#453)

In the graph section of the solution printout, the concrete dependency for each
release that brings in another release is now shown. This may help in
understanding why a release is chosen, particularly when there are different
restrictions on a same crate introduced by different releases.

For the new linked folders with alire metadata, the source folder is shown in
the releases section. Otherwise, such source folders are listed in the
externals section without a concrete release (as we cannot determine a version
for them).

A new test shows this feature and also shows that the solver is able to
downgrade a dependency whenever this is needed to obtain a complete solution.

5 years agoRefactor variations of fulfilment to fulfillment (#454)
Alejandro R Mosteo [Tue, 23 Jun 2020 18:32:50 +0000 (20:32 +0200)]
Refactor variations of fulfilment to fulfillment (#454)

The spellchecker complained about some declarations but missed another bunch.
Better have the same spelling everywhere.

5 years agoDetect and use Alire metadata found in pinned directory (#450)
Alejandro R Mosteo [Fri, 19 Jun 2020 19:09:09 +0000 (21:09 +0200)]
Detect and use Alire metadata found in pinned directory (#450)

* Detect crate at linked dir and use its deps/paths

If a path given to with/pin --use contains a loadable alire workspace (i.e.,
for a crate manually initialized, or retrieved with `get`), the release found
there will be used to retrieve additional dependencies, and its project paths
will also be used.

* `with` directory with autodetection of crate

When adding a dependency as a pinned dir, and the target dir is a regular Alire
crate, we can autodetect the crate we are adding as dependency. In that case
the command becomes `alr with --use <path>`. This can also be useful in the
future for remote URLs that will also provide the crate being retrieved.

* Refactor --url to --use

5 years agoFix: Load index prior to pinning to folder (#449)
Alejandro R Mosteo [Fri, 19 Jun 2020 18:23:57 +0000 (20:23 +0200)]
Fix: Load index prior to pinning to folder (#449)

While this has no implications for the crate being pinned, any regularly solved
crates will be missing afterwards unless the index is loaded pre-pinning.

5 years agoAllow incomplete solutions in relevant commands (#451)
Alejandro R Mosteo [Fri, 19 Jun 2020 17:53:44 +0000 (19:53 +0200)]
Allow incomplete solutions in relevant commands (#451)

* Allow get with missing deps (with confirmation)

Up to now, trying to retrieve a release with non-solvable dependencies resulted
in an opaque "can't get a solution", leaving the only resort of doing an `alr
get --only`. With this patch, the best partial solution found is used and
displayed. The user can accept a partial deployment, understanding that the
build will fail unless missing dependencies are manually provided.

It would be relatively easy to allow the user to reject the proposal and
continue seeing other incomplete solutions (as, e.g., `aptitude` does) until
one of them is selected.

* Allow pinning to unavailable versions

The user may want for some reason to specify versions that are not in the
index, for work-in-progress releases or when switching between several indexes.
Instead of blocking him entirely, the incomplete solution is displayed and he
can accept it regardless. Forcing is required when not interactive.

* Allow update to complete with incomplete solution

When the solution is already incomplete we emit a warning to remind the user
about this, but we need not to err, since there are no changes to the solution,
or we might find a less incomplete one.

Also added a test for the behavior when trying to update a pinned version

* Allow withing dependencies with incomplete solution

This is the last of the commands that previously erred out with "Cannot solve
dependencies". Now, it can be forced into accepting any dependency as long as
the user is OK with having an incomplete solution.

* Remove deprecated Alire.Solutions.Valid

Instead, .Is_Complete or .Composition should be used for better granularity.
Is_Complete is more stringent than before (hints make the solution incomplete),
but the new flexibility to work with incomplete solutions makes the difference
secondary; the user is less restricted than before.

* Minor fixes to tests for Is_Complete change

By making solutions with any external (including hints) incomplete, it is
necessary to force a few commands in the tests that before succeeded normally.

Some tests that checked for exact text were now failing due to the extra
information/interaction caused by incomplete solutions.

The stderr warning on incomplete solutions in setenv also requires fixing its
output.

* Document user-visible changes

5 years agoFix a bug in the dependency checkout logic (#440)
Alejandro R Mosteo [Fri, 19 Jun 2020 17:12:46 +0000 (19:12 +0200)]
Fix a bug in the dependency checkout logic (#440)

This bug would manifest when a regular release other than the root one in the
solution depends on a linked dependency. With the proposed change we should be
covered for any future dependency kind that is not fulfilled by a regular release.

5 years agoAbility to use a local folder to fulfill a dependency (#439)
Alejandro R Mosteo [Fri, 19 Jun 2020 17:01:46 +0000 (19:01 +0200)]
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

5 years agoRefactor checkout/update logic into Alire (#437)
Alejandro R Mosteo [Thu, 18 Jun 2020 17:13:57 +0000 (19:13 +0200)]
Refactor checkout/update logic into Alire (#437)

The subprograms in Alr.Checkout, which disappears, are refactored into
Alire.Workspace. This will enable better logic for retrieval/updates, without
the need to internally reroute to Alr.Commands.Update, which causes some
unrelated side-effects (like re-resolving even when unnecessary).

Minor change: now all crates leave a trace in the form of their dependency
folder within the cache, even if this folder is empty for dependencies whose
deployment does not require such a folder. This is more homogeneous and might
be useful in the future to store status about dependency deployment
completeness right there.

A couple tests are fixed to account for minor output changes and a change in
behavior between Python 2 and 3 (not sure why it not arose initially).

5 years agoAlire.Config: change name of configuration files (#448)
Fabien Chouteau [Mon, 15 Jun 2020 18:18:54 +0000 (20:18 +0200)]
Alire.Config: change name of configuration files (#448)

#446

5 years agoAlire.Config: add support of built-in options (#446)
Fabien Chouteau [Mon, 15 Jun 2020 10:27:43 +0000 (12:27 +0200)]
Alire.Config: add support of built-in options (#446)

* Alire.Config: add support of built-in options

Built-in options have a type that is checked when setting or loading a configuration file.
They also have a short help text to explain their meaning and usage.

* Create configuration.md

* Typos and minor fixes

* doc/configuration.md: typo

5 years agoDefault to no ANSI, ASCII-only output (#444)
Alejandro R Mosteo [Fri, 12 Jun 2020 13:27:15 +0000 (15:27 +0200)]
Default to no ANSI, ASCII-only output (#444)

* Default to no color/no tty until detected

* Default to ASCII-only output unless color enabled

5 years agoRemove some unnecessary code after Solution changes (#431)
Alejandro R Mosteo [Fri, 12 Jun 2020 13:24:26 +0000 (15:24 +0200)]
Remove some unnecessary code after Solution changes (#431)

The solution stores platform-dependent releases, hence the Environment
parameter is not needed at the moment of writing the corresponding lockfile.

A stray exception handler in Alr.Commands.Withing was unneeded and masking as a
regular error some Constraint_Errors that should escalate to the main handler
to be reported as unexpected internal errors.

Dead code in Alire.Utils that is not going to be useful again has been removed.

5 years agoTest templates to help with creating new tests (#434)
Alejandro R Mosteo [Fri, 12 Jun 2020 13:22:57 +0000 (15:22 +0200)]
Test templates to help with creating new tests (#434)

5 years agoSafeguards for changes in lockfile/crate format (#436)
Alejandro R Mosteo [Thu, 11 Jun 2020 11:34:57 +0000 (13:34 +0200)]
Safeguards for changes in lockfile/crate format (#436)

If the lockfile is not loadable we presume it is in an old format. In this case
we recreate it from scratch, which entails the loss of any stored pins.  If the
alire/crate.toml file is not loadable we advice the user to recreate the
workspace from scratch.

Note that both crate.toml and crate.lock use the index format to store
releases. Hence, any change in index format may impact these files. While the
lockfile is not that problematic, for the crate.toml file we have no easy
workaround since we cannot know to which crate the workspace belongs.

There are possible mitigations but as long as we don't have stable releases the
complexity/benefit ratio is unclear. If we eventually make the crate.toml file
only manually editable that could also impact how to deal with this issue, so
not doing anything about it yet.

5 years agoInternal enhancements to Solution and Dependency states (#429)
Alejandro R Mosteo [Thu, 11 Jun 2020 11:33:39 +0000 (13:33 +0200)]
Internal enhancements to Solution and Dependency states (#429)

* Remove obsolete Alire.Dependencies.Unavailable

This fake dependency was used in the old Ada index to store an unavailable
dependency. There is no longer any use for this constant.

* Image functions for newly tagged Alire.Milestones

Make the type tagged to gain dot notation, and add [TTY_]Image subprograms for
simpler printing elsewhere.

* New Alire.Dependencies.States type

This type is used to store the actual way in which a dependency was solved. All
possibilities are stored, which allows to properly cache a solution, and detect
changes in solutions across operations that modify the solution: pinning,
withing, updating...

* New Alire.Dependencies.States.Maps

A crate name -> dep state mapping which is at the core of the cached Solution,
with a couple of functional-style modifiers for use in expression functions.

* Remove pinning info from Releases

This information is now stored in the dependency State where it better belongs.
This way it doesn't matter if the solution contains a release for the pinned
dependency; the pinning information is always preserved.

* Reworked Solution internals to use States

(Doesn't build.) Changes to Alire.Solutions to use the new dependency states.
With these changes there is no loss of information when going from a valid to
an invalid solution (information about partial solutions is stored the same as
for complete solutions), which enables down the road better feedback to users
and simpler implementation of other improvements, like pinning of crates to
local folders.

* Solver improvements based on new dependency states

(Only alire-solver.adb builds.) With these changes, the solver needs not to
check the complete validity of a solution once all dependencies are processed
(which is an expensive test), because validity is guaranteed for any partial
solution (that is, no incompatible release can make into the solution). Also,
while the solver was previously complete in regard to valid solutions (with
releases or hints), now it is also complete for invalid solutions (those
missing releases and hints for some dependency). This means that the solver
will return the "best" incomplete solution when a complete one cannot be found.

* Tweaks to achieve build with new Solution

A few minor changes due to changes in the Solution public methods are needed
here and there, without functional implications.

* Tweaks for testsuite compliance

A few changes are needed to ensure the same output as before is produced, or to
adapt a few tests to minimal output changes caused by the homogenization of
dependency images.

* Make Alire.Crate_Name a proper private type

Our Dynamic_Predicate in the publicly defined Crate_Name as new String is
rejected by GNAT 9, and I couldn't find a workaround short of making all of
Alire.* non-preelaborable. Defining privately Crate_Name as new String in turn
caused numerous errors in child packages due to some mixing between the public
and private views. In the end, making it a record was the simplest change
without introducing the risk of missing checks (as if we had made it simply a
subtype of String).

So, given the change, I bit the bullet to make it tagged and provide a couple
of convenience functions.

* Review fixes

5 years agoAlr.Platforms.Windows: use Alire.config in msys2 install (#443)
Fabien Chouteau [Thu, 11 Jun 2020 11:25:33 +0000 (13:25 +0200)]
Alr.Platforms.Windows: use Alire.config in msys2 install (#443)

* Alr.Platforms.Windows: use Alire.config in msys2 install

* Update msys2 install script URL

Now that the master version is updated with install dir feature.

* Alire.Config.Edit: create directory for the config file in case it doesn't exists

* Alire.Config.Edit: improve TOML value evaluation

If first the value cannot be parsed, we directly create a TOML_String value instead of trying to parse it again between quotes.

* Alr.Platforms.Windows: remove unecessary call to YAML_Stringify

5 years agoMove the Alr.Main exception handler to a last chance handler (#442)
Fabien Chouteau [Wed, 10 Jun 2020 15:25:07 +0000 (17:25 +0200)]
Move the Alr.Main exception handler to a last chance handler (#442)

* Move the Alr.Main exception handler to a last chance handler

This way the exceptions raised during elaboration will also be caught.

#441

* Alr.Main: restore an exception handler to catch after elaboration

Relying only on the __gnat_last_chance_handler means that an extra backtrace
is printed by the GNAT run-time (with Notify_Unhandled_Exception).

5 years agoAdd a -f, --force global switch (#435)
Alejandro R Mosteo [Mon, 8 Jun 2020 15:32:15 +0000 (17:32 +0200)]
Add a -f, --force global switch (#435)

This global modifier is available in Alire.Force. Other candidate locations,
like Alire.Config, Alire.Errors, Alire.Utils.User_Input cannot be used because
they bring in non-preelaborable units and it snowballs from there.

The recommended usage is through Alire.Recoverable_Error, which will warn or
raise appropriately depending on the flag. The boolean Alire.Force is also
available for less straightforward situations (interaction defaults for
example).

5 years agoExit code fix for `get --build` with build failure (#428)
Alejandro R Mosteo [Fri, 5 Jun 2020 17:07:18 +0000 (19:07 +0200)]
Exit code fix for `get --build` with build failure (#428)

We were not erroring if the build failed, which is counterintuitive. We now
require successful retrieval and build to exit with code 0. A test to verify
this situation has been added.

5 years agoAdd support for persistent configuration options (#424)
Fabien Chouteau [Fri, 5 Jun 2020 16:57:32 +0000 (18:57 +0200)]
Add support for persistent configuration options (#424)

* Add support for persistent configuration options

The configuration options are either global or local (local overriding
the global definitions) and are stored in TOML format.

This patch also introduces a command to handle configuration options
from the command line.

* Fix circular elaboration of Alire.Config

By moving the Not_Interactive global in the User_Input package.

5 years agoTransition the testsuite for Python3 and the new e3.testsuite API (#432)
Pierre-Marie de Rodat [Fri, 5 Jun 2020 16:18:53 +0000 (18:18 +0200)]
Transition the testsuite for Python3 and the new e3.testsuite API (#432)

* Transition the testsuite for Python3 and the new e3.testsuite API

* Testsuite: clear GPR_PROJECT_PATH before running tests

* scripts/ci-github.sh: upgrade e3-testsuite

* Update CI scripts to use Python 3

* Override default timeout to sidestep rlimit

* Clean up no longer needed python2.7 dependencies

Co-authored-by: Alejandro R. Mosteo <amosteo@unizar.es>
5 years agoRemove unnecessary forced exit from `Alr.Main` (#425)
Alejandro R Mosteo [Tue, 2 Jun 2020 10:23:02 +0000 (12:23 +0200)]
Remove unnecessary forced exit from `Alr.Main` (#425)

Historically, something was causing an extra empty line in the output of every
command. At some point this has been fixed inadvertently, so we can remove the
forced exit call, which in turn will allow finalization to complete normally,
if it were ever needed.

5 years agoReport expected vs found index versions (#419)
Alejandro R Mosteo [Tue, 2 Jun 2020 10:22:26 +0000 (12:22 +0200)]
Report expected vs found index versions (#419)

5 years agoFixes for GNAT CE 2020 (#423)
Alejandro R Mosteo [Tue, 26 May 2020 15:36:09 +0000 (17:36 +0200)]
Fixes for GNAT CE 2020 (#423)

The images for CentOS (unsupported Linux) and debian+community have been
upgraded to use GNAT CE 2020. A few minor errors newly detected have been
fixed, related to anonymous access types and explicit aliased arguments.

5 years agoImprove dependency graphs to display unresolved externals (#422)
Alejandro R Mosteo [Sat, 23 May 2020 19:07:13 +0000 (21:07 +0200)]
Improve dependency graphs to display unresolved externals (#422)

* Improve dependency graphs to consider externals

* Enhance test to check dependency graph with external

5 years agoFix withing of external dependencies (#421)
Alejandro R Mosteo [Sat, 23 May 2020 18:54:36 +0000 (20:54 +0200)]
Fix withing of external dependencies (#421)

* Fix addition of external dependencies

* Test for withing an unavailable external

5 years agoFix missing checks for invalid solution (#420)
Alejandro R Mosteo [Sat, 23 May 2020 18:52:36 +0000 (20:52 +0200)]
Fix missing checks for invalid solution (#420)

* Fix missing checks for invalid solution

These were causing uncontained errors after an `alr get --only`

* Test for proper behavior after `alr get --only`

5 years agoImprove help layout (#418)
Alejandro R Mosteo [Tue, 19 May 2020 11:03:12 +0000 (13:03 +0200)]
Improve help layout (#418)

This change moves the explanation of switches a few columns to the left.

5 years ago`alr update` improvements (#415)
Alejandro R Mosteo [Tue, 19 May 2020 10:05:36 +0000 (12:05 +0200)]
`alr update` improvements (#415)

* Reimplement `alr update --online`

* On demand update of selected dependencies

* Test: on demand update of selected crate

* Review fixes

Explicitly check that requested crate is not pinned, since it would never result in an update.

5 years agoCustomizable crate tests (#365)
Alejandro R Mosteo [Tue, 19 May 2020 09:55:25 +0000 (11:55 +0200)]
Customizable crate tests (#365)

* Update catalog spec with the new action type

* Refactor Action packages

Move Alr.Actions to Alire.Properties.Actions.Executer
Move Alire.Actions to Alire.Properties.Actions
Split Actions into Actions and Actions.Runners

* Use custom test actions in `alr test`

* Test: custom test actions

* Rebase fixes

5 years agoRemove misleading/redundant error messages (#416)
Alejandro R Mosteo [Mon, 18 May 2020 18:16:23 +0000 (20:16 +0200)]
Remove misleading/redundant error messages (#416)

5 years agoFix a compilation error for some GNAT versions (#417)
Alejandro R Mosteo [Mon, 18 May 2020 14:25:36 +0000 (16:25 +0200)]
Fix a compilation error for some GNAT versions (#417)

5 years agoColorize output (#402)
Alejandro R Mosteo [Fri, 15 May 2020 17:57:33 +0000 (19:57 +0200)]
Colorize output (#402)

* Colorize log messages

* Colorize entities: crates, milestones, dependencies

5 years agoShow complete solution with `alr with --solve` (#408)
Alejandro R Mosteo [Fri, 15 May 2020 17:11:13 +0000 (19:11 +0200)]
Show complete solution with `alr with --solve` (#408)

* Show complete solution via `alr with --solve`

* Test: use `with --solve` in test, output fixes

Output fixes are due to minor extra information being added to
`Solution.Print`: pinned releases are flagged as such.

5 years agoFix `pin` command to preserve dependencies across pin/unpin (#406)
Alejandro R Mosteo [Fri, 15 May 2020 16:40:37 +0000 (18:40 +0200)]
Fix `pin` command to preserve dependencies across pin/unpin (#406)

* Privatize the Alire.Solutions.Solution type

* Add internal `pinned` attribute to releases

* Pin listing

* Implement proper pin/unpin for regular releases

The solver is enhanced to reuse pins from a former solution

* Fixes for testsuite, new tests (pin all, unpin)

Fix bug about using relative paths for index configuration in the python setup.

* Rename `Replacing` --> `With_Pin`

* Fix: unpinned releases where being kept in solution

* Test that pin holds across `alr update`

* Test that a downgrading pin actually works

* Test: pinned release stays on dependency removal

* Enhance pinning status line with version changes

* Refactor pinning logic from Alr into Alire

5 years agoProofreading with aspell (#410)
Jesper Quorning [Fri, 15 May 2020 16:04:13 +0000 (18:04 +0200)]
Proofreading with aspell (#410)

* Typo: Usage_Custom_Parameters

* Typo: environment 2

* Typo: appropriate

* Typo: Additionally

* Typo: executable

* Typo: explicitly

* Typo: expression

* Typo: foolproof

* Typo: representation

* Typo: suggestion

* Typo: only

* Typo: without

* Typo: successfully

* Typo: overridden (4x)

* Typo: happened

* Typo: deployment

* Typo: recursively

* Typo: development

* Typo: environment

* Typos: permanent/orderly

* Typo: Unfortunately

* Typo: succeeds (2x)

Co-authored-by: Alejandro R Mosteo <amosteo@unizar.es>
5 years agoCreate spellcheck.yml to use reviewdog (#412)
Fabien Chouteau [Fri, 15 May 2020 15:51:09 +0000 (17:51 +0200)]
Create spellcheck.yml to use reviewdog (#412)

5 years agodocs: minor fixes and adding links (#409)
yannickmoy [Thu, 14 May 2020 17:16:40 +0000 (19:16 +0200)]
docs: minor fixes and adding links (#409)

5 years agoProofreading fixes (#407)
Jesper Quorning [Thu, 14 May 2020 09:16:59 +0000 (11:16 +0200)]
Proofreading fixes (#407)

* Typo: unavailability

* Typo: Space after full stop in comment

* Typo: strings

* Typo: different

* Typo: circumvent

* Typo: length

* Typo: R.Available

* Typo: the

* Rename: doc/catalog-format-spec.md

5 years agoDon't err out in autocompletion script (#405)
Alejandro R Mosteo [Wed, 13 May 2020 11:38:46 +0000 (13:38 +0200)]
Don't err out in autocompletion script (#405)

This may break other people's scripts. Just bail out.

5 years agoWorkaround for jekyll export of case expressions (#404)
Alejandro R Mosteo [Wed, 13 May 2020 11:37:49 +0000 (13:37 +0200)]
Workaround for jekyll export of case expressions (#404)

5 years agoFix header level in publishing.md (#403)
Fabien Chouteau [Tue, 12 May 2020 18:36:53 +0000 (20:36 +0200)]
Fix header level in publishing.md (#403)

5 years agoRefactor documentation (#401)
Fabien Chouteau [Tue, 12 May 2020 14:24:05 +0000 (16:24 +0200)]
Refactor documentation (#401)

* Refactor documentation

 - The getting started instructions from the README are moved to a
 dedicated doc/ page

 - The installation instruction now have toolchain install info

 - publishing.md is populated from the content of
 alire-index/CONTRIBUTING.md

 - policies.md is populated from the content of alire-index/POLICY.md

 - Some README platform info are updated

* Fix out of date info

* doc/getting-started.md: add a section on setenv

* doc/getting-started.md: add a section about msys2

Co-authored-by: Alejandro R Mosteo <amosteo@unizar.es>
5 years agoRefactor AAA.Table_IO -> Alire.Utils.Tables (#398)
Alejandro R Mosteo [Tue, 12 May 2020 14:18:34 +0000 (16:18 +0200)]
Refactor AAA.Table_IO -> Alire.Utils.Tables (#398)

5 years agoShow changes to dependencies/solutions in relevant commands (#397)
Alejandro R Mosteo [Tue, 12 May 2020 11:55:03 +0000 (13:55 +0200)]
Show changes to dependencies/solutions in relevant commands (#397)

* Show dependency changes in applicable commands

By relying on the lockfile we can easily summarize changes to the user. There
are no functional changes, except for some no-op updates that can now be omitted
altogether instead of simply blindly redeploying the same exact dependencies.

* Code review fixes

5 years agoTypes to identify changes in dependencies/solutions (#396)
Alejandro R Mosteo [Tue, 12 May 2020 11:29:47 +0000 (13:29 +0200)]
Types to identify changes in dependencies/solutions (#396)

* Modules to identify changes in solutions/deps
* Code review fixes

5 years agoFix: use local dependencies in `alr show --solve` (#400)
Alejandro R Mosteo [Tue, 12 May 2020 10:50:12 +0000 (12:50 +0200)]
Fix: use local dependencies in `alr show --solve` (#400)

When the command was run for the local workspace (without explicit crate name),
the dependencies were being taken from the index instead of the local release.
This also manifested as not solvable dependencies for local releases without a
counterpart in the index.

5 years agoRely on lockfile for `alr setenv` (#394)
Alejandro R Mosteo [Mon, 11 May 2020 17:37:20 +0000 (19:37 +0200)]
Rely on lockfile for `alr setenv` (#394)

* Use lockfile for `alr setenv`
* Add a test for setenv with external dependencies

5 years agoRely on lockfile for `alr show` of local crate (#393)
Alejandro R Mosteo [Mon, 11 May 2020 17:18:50 +0000 (19:18 +0200)]
Rely on lockfile for `alr show` of local crate (#393)

* Use lockfile in `alr show --solve` of local crate
* Code review fix

5 years agoGenerate the lockfile on the fly when missing (#399)
Alejandro R Mosteo [Mon, 11 May 2020 16:52:02 +0000 (18:52 +0200)]
Generate the lockfile on the fly when missing (#399)

5 years agoCache dependency solution in a lockfile (#355)
Alejandro R Mosteo [Mon, 11 May 2020 14:54:10 +0000 (16:54 +0200)]
Cache dependency solution in a lockfile (#355)

* Refactor Alr.Query as Alire.Solver
* Implement lockfiles and create them on checkout

5 years agoSuggest valid dependencies after `alr with --del` (#395)
Alejandro R Mosteo [Mon, 11 May 2020 14:39:27 +0000 (16:39 +0200)]
Suggest valid dependencies after `alr with --del` (#395)

5 years agoDelete catalog-format-spec.rst (#390)
Fabien Chouteau [Thu, 7 May 2020 10:55:20 +0000 (12:55 +0200)]
Delete catalog-format-spec.rst (#390)

It was brought back in #389.

5 years agoLoad `environment` properties (#389)
Alejandro R Mosteo [Wed, 6 May 2020 14:03:51 +0000 (16:03 +0200)]
Load `environment` properties (#389)

* Document `environment` property

* Load/Store `environment` property

* Retrieve all env vars set by a release

* Test: load/show environment properties

* Quote var names as ${name}

* Update new .md documentation

5 years agoConvert catalog format spec to markdown (#388)
Fabien Chouteau [Wed, 6 May 2020 12:54:11 +0000 (14:54 +0200)]
Convert catalog format spec to markdown (#388)

* Convert catalog format spec to markdown

So it can be used in the website.

5 years agoLog external detection as busy status (#385)
Alejandro R Mosteo [Wed, 6 May 2020 12:43:07 +0000 (14:43 +0200)]
Log external detection as busy status (#385)

* Log external detection as busy status

This message is generally not wanted in the final output, since it's used only
to signal alr is not dead/stuck, but busy. Also, it must be entirely removed
from some commands like `alr setenv` or the output is no longer parseable.

* Detect output redirection to adjust logging

* Switch --no-tty to disable control chars in output

* Fix tests for the changed output

5 years agoFix tabulation in generated project files (#387)
Alejandro R Mosteo [Mon, 4 May 2020 11:41:50 +0000 (13:41 +0200)]
Fix tabulation in generated project files (#387)

5 years agoFix: load index when --solve is requested in show (#382)
Alejandro R Mosteo [Mon, 4 May 2020 11:17:53 +0000 (13:17 +0200)]
Fix: load index when --solve is requested in show (#382)

5 years agoEnsure the checkout folder is deleted on failure (#363)
Alejandro R Mosteo [Tue, 28 Apr 2020 16:15:11 +0000 (18:15 +0200)]
Ensure the checkout folder is deleted on failure (#363)

5 years agoMinor fixes (#356)
Alejandro R Mosteo [Mon, 27 Apr 2020 09:54:52 +0000 (11:54 +0200)]
Minor fixes (#356)

* Remove duplicate method Alire.Releases.Depends
* Add warning about recursive cloning to Readme file

5 years agoWarn about the --recursive switch in README
Alejandro R. Mosteo [Sun, 26 Apr 2020 15:11:51 +0000 (17:11 +0200)]
Warn about the --recursive switch in README

5 years agoCleanup: remove Alire.Releases.Depends
Alejandro R. Mosteo [Wed, 8 Apr 2020 12:48:35 +0000 (14:48 +0200)]
Cleanup: remove Alire.Releases.Depends

This abbreviature duplicated Alire.Releases.Dependencies, leading to an ugly
mix of calls with two names.

5 years agoScript to enable completion in bash (#357)
Alejandro R Mosteo [Mon, 27 Apr 2020 09:09:13 +0000 (11:09 +0200)]
Script to enable completion in bash (#357)

5 years agoRefactor for expected error exit codes (#353)
Alejandro R Mosteo [Thu, 23 Apr 2020 09:18:53 +0000 (11:18 +0200)]
Refactor for expected error exit codes (#353)

5 years agoClearer error msg for system external definition (#351)
Alejandro R Mosteo [Tue, 21 Apr 2020 19:25:35 +0000 (21:25 +0200)]
Clearer error msg for system external definition (#351)

5 years agoDon't clear exception error before re-raise (#352)
Alejandro R Mosteo [Tue, 21 Apr 2020 10:43:14 +0000 (12:43 +0200)]
Don't clear exception error before re-raise (#352)

Also emit tar error, since things are going downhill from there

5 years agoFix bug where only the first added dependency is recorded (#348)
Alejandro R Mosteo [Thu, 16 Apr 2020 17:58:58 +0000 (19:58 +0200)]
Fix bug where only the first added dependency is recorded (#348)

5 years agoTestsuite: bugfix check, more than one dependency
Alejandro R. Mosteo [Thu, 16 Apr 2020 10:47:11 +0000 (12:47 +0200)]
Testsuite: bugfix check, more than one dependency

5 years agoFix check of duplicated dependencies
Alejandro R. Mosteo [Thu, 16 Apr 2020 10:42:34 +0000 (12:42 +0200)]
Fix check of duplicated dependencies

5 years agoActually merge msys2 feature into master (#346)
Alejandro R Mosteo [Wed, 15 Apr 2020 08:47:58 +0000 (10:47 +0200)]
Actually merge msys2 feature into master (#346)

5 years agoWindows CI: Force the installation for tar in msys2
Fabien Chouteau [Fri, 10 Apr 2020 14:11:37 +0000 (16:11 +0200)]
Windows CI: Force the installation for tar in msys2

The tar executable provided by Git install in GitHub Action Windows VM
doesn't seem to work. This patch forces the installation of tar in msys2
which is going to be used first by alr.

5 years agoAlire.VCSs.Git: git doesn't accept -v
Fabien Chouteau [Sat, 4 Apr 2020 17:24:17 +0000 (19:24 +0200)]
Alire.VCSs.Git: git doesn't accept -v

5 years agoCheck for required tools and install from distro
Fabien Chouteau [Sat, 4 Apr 2020 17:15:32 +0000 (19:15 +0200)]
Check for required tools and install from distro

If there is a known distro, and the tool is available, and the user agrees.

5 years agoWindows msys2 support (#336)
Alejandro R Mosteo [Wed, 15 Apr 2020 08:33:17 +0000 (10:33 +0200)]
Windows msys2 support (#336)

5 years agoShow origin kind of dependencies in alr show (#343)
Alejandro R Mosteo [Tue, 7 Apr 2020 10:21:37 +0000 (12:21 +0200)]
Show origin kind of dependencies in alr show (#343)

This is optionally available through the new --detail switch.

5 years agoAlire.Origins.Deployers.System: update user prompt on installation
Fabien Chouteau [Fri, 3 Apr 2020 14:20:29 +0000 (16:20 +0200)]
Alire.Origins.Deployers.System: update user prompt on installation

The user can now:
- Reject installation but continue, can be used to just get sources of
  projects
- Accept all system installations (answer: Always)

5 years agoAlire.Utils.User_Input: flush input before asking question
Fabien Chouteau [Fri, 3 Apr 2020 13:15:35 +0000 (06:15 -0700)]
Alire.Utils.User_Input: flush input before asking question

5 years agoAlr.Platforms.Windows: use system deployers
Fabien Chouteau [Fri, 3 Apr 2020 10:41:27 +0000 (03:41 -0700)]
Alr.Platforms.Windows: use system deployers

5 years agoAlr.Platforms.Windows: print message for tools installation
Fabien Chouteau [Thu, 2 Apr 2020 18:47:06 +0000 (11:47 -0700)]
Alr.Platforms.Windows: print message for tools installation

5 years agoAlire.Externals: print message when looking for external
Fabien Chouteau [Thu, 2 Apr 2020 18:46:34 +0000 (11:46 -0700)]
Alire.Externals: print message when looking for external

Looking for system package can take some time, it's better to tell the
user that there is something going on.

5 years agoAlr.Platforms.Windows: do not report user's choice as an error
Fabien Chouteau [Thu, 2 Apr 2020 17:32:23 +0000 (10:32 -0700)]
Alr.Platforms.Windows: do not report user's choice as an error