]> _ Git - alire.git/log
alire.git
5 years agoEnable fedora-latest docker image for testing (#619)
Alejandro R Mosteo [Tue, 1 Dec 2020 17:19:10 +0000 (18:19 +0100)]
Enable fedora-latest docker image for testing (#619)

5 years agoBetter feedback on malformed hash in index (#636)
Alejandro R Mosteo [Tue, 1 Dec 2020 16:00:49 +0000 (17:00 +0100)]
Better feedback on malformed hash in index (#636)

* Better feedback on malformed hash in index

Fix .gitignore so only the root /alire is ignored

* Fix for breaking change in used action

5 years agoSeparate workflow to test unsupported package manager platform (#623)
Alejandro R Mosteo [Mon, 30 Nov 2020 12:21:15 +0000 (13:21 +0100)]
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.

5 years agoSolver: Speed-up for impossible dependencies (#620)
Alejandro R Mosteo [Fri, 20 Nov 2020 14:20:49 +0000 (15:20 +0100)]
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.

5 years agoDo not raise if /etc/os-release doesn't exist (#621)
Alejandro R Mosteo [Thu, 19 Nov 2020 08:45:00 +0000 (09:45 +0100)]
Do not raise if /etc/os-release doesn't exist (#621)

Simply return distro unknown

5 years agoci-windows.yml: replace add-path command (#622)
Fabien Chouteau [Wed, 18 Nov 2020 17:41:24 +0000 (18:41 +0100)]
ci-windows.yml: replace add-path command (#622)

* ci-windows.yml: replace add-path command

see https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

* ci-windows,yml: use bash shell

5 years agoFeedback line when non-empty alire.lock created (#617)
Alejandro R Mosteo [Mon, 16 Nov 2020 15:04:40 +0000 (16:04 +0100)]
Feedback line when non-empty alire.lock created (#617)

Otherwise the changes are listed without context and it's a bit confusing.

5 years agoFix: on `publish --tar`, allow git without remote (#614)
Alejandro R Mosteo [Mon, 9 Nov 2020 08:39:20 +0000 (09:39 +0100)]
Fix: on `publish --tar`, allow git without remote (#614)

If we are only using git to generate the archive, we do not need the remote as
it won't be referenced by the origin.

5 years agoAdd handling of Arch and Arch-based distributions (#600)
Christophe Gouiran [Sat, 7 Nov 2020 14:01:06 +0000 (15:01 +0100)]
Add handling of Arch and Arch-based distributions (#600)

* Add handling of arch and arch based distributions

* Update src/alire/os_linux/alire-platform.adb

Co-authored-by: Alejandro R Mosteo <amosteo@unizar.es>
* Improve former Arch based Linux distributions detection (#600)

* Check first id then id_like key (#600)

* Update alire-platform.adb

Add a debug trace when falling back to id_like key

* Fix line too long style error (#600)

* Handle the case when id_like is a space separated items list (#600)

* More robust regular expression (#600)

* Simplify processing of id and id_key values (#600)

* Easy_Graph is not available in Official Arch repositories (#600)

Co-authored-by: Alejandro R Mosteo <amosteo@unizar.es>
5 years agoAdded alire.toml so alr can build/edit itself (#575)
Alejandro R Mosteo [Fri, 6 Nov 2020 14:28:19 +0000 (15:28 +0100)]
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.

* Code review fixes

* New workflow to check that `alr build` succeeds

5 years agoAdd arch-rolling docker image to CI (#613)
Alejandro R Mosteo [Fri, 6 Nov 2020 14:27:33 +0000 (15:27 +0100)]
Add arch-rolling docker image to CI (#613)

5 years agoAlr.Commands.Edit: add support for custom editor (#611)
Fabien Chouteau [Thu, 5 Nov 2020 17:55:43 +0000 (18:55 +0100)]
Alr.Commands.Edit: add support for custom editor (#611)

* Alr.Commands.Edit: add support for custom editor

The editor can be changed with:
$ alr config --set --global editor.cmd "emacs ${GPR_FILE}

* Update user-changes.md

* Typo

* Typo

5 years agoBump version on master branch to 0.8.0-dev (#564)
Fabien Chouteau [Thu, 5 Nov 2020 12:24:18 +0000 (13:24 +0100)]
Bump version on master branch to 0.8.0-dev (#564)

5 years agoRefactor update logic from Alr into Alire (#609)
Alejandro R Mosteo [Thu, 5 Nov 2020 11:25:27 +0000 (12:25 +0100)]
Refactor update logic from Alr into Alire (#609)

Also add and use a flag to prevent autoupdates.

5 years agoAlire.Environment: load env context from the platform (#608)
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.

5 years agoAlire.Utils.Yaml: fix string escape (#604)
Fabien Chouteau [Wed, 4 Nov 2020 15:43:44 +0000 (16:43 +0100)]
Alire.Utils.Yaml: fix string escape (#604)

We use double-quote strings so single-quotes should not be escaped.

5 years agoReport underlying error during publishing for an unloadable manifest (#602)
Alejandro R Mosteo [Wed, 4 Nov 2020 10:17:44 +0000 (11:17 +0100)]
Report underlying error during publishing for an unloadable manifest (#602)

* Publish: report error causing unloadable manifest

* Testsuite: add test checking proper error output

5 years agoAvoid unneeded requests to approve changes after editing the manifest (#591)
Alejandro R Mosteo [Thu, 29 Oct 2020 10:26:59 +0000 (11:26 +0100)]
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.

* New test to check the bugfix

5 years agoAlr.Commands.Init: warnings instead of fails for existing files (#599)
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.

5 years agopolicies.md: add best practices (#597)
Fabien Chouteau [Wed, 28 Oct 2020 17:43:03 +0000 (18:43 +0100)]
policies.md: add best practices (#597)

* policies.md: add best practices

* Update policies.md

5 years agoMigration of an existing Ada/SPARK project to Alire (#598)
Fabien Chouteau [Wed, 28 Oct 2020 17:32:23 +0000 (18:32 +0100)]
Migration of an existing Ada/SPARK project to Alire (#598)

* Update getting-started.md

* Update getting-started.md

* Typo

5 years agoGit: Use remote branch when checking remote status (#596)
Alejandro R Mosteo [Tue, 27 Oct 2020 13:58:58 +0000 (14:58 +0100)]
Git: Use remote branch when checking remote status (#596)

Otherwise it seems git defaults to the main branch, which manifested as
spurious "ahead" status, or ambiguous references in local remotes.

5 years agoPublish: Detect missing manifest in remote sources (#595)
Alejandro R Mosteo [Tue, 27 Oct 2020 11:45:31 +0000 (12:45 +0100)]
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.

5 years agoChange Windows installer icon (#589)
Fabien Chouteau [Sat, 24 Oct 2020 09:44:48 +0000 (11:44 +0200)]
Change Windows installer icon (#589)

This new version has a white layer for dark background desktop.

5 years agoDo not show an error when no command is given (#588)
Alejandro R Mosteo [Thu, 22 Oct 2020 14:41:31 +0000 (16:41 +0200)]
Do not show an error when no command is given (#588)

5 years agoFix typo when asking for sudo authorization (#586)
Fabien Chouteau [Thu, 22 Oct 2020 08:32:10 +0000 (10:32 +0200)]
Fix typo when asking for sudo authorization (#586)

Fixes #582

5 years agoMore informative error for missing gprbuild (#583)
Alejandro R Mosteo [Thu, 22 Oct 2020 07:55:13 +0000 (09:55 +0200)]
More informative error for missing gprbuild (#583)

5 years agoFix the `depends-on` example in the catalog spec (#581)
Alejandro R Mosteo [Tue, 20 Oct 2020 16:01:21 +0000 (18:01 +0200)]
Fix the `depends-on` example in the catalog spec (#581)

It was using the old table notation.

5 years agoEnvironment: allow to set var twice to the same value (#580)
Alejandro R Mosteo [Tue, 20 Oct 2020 11:11:30 +0000 (13:11 +0200)]
Environment: allow to set var twice to the same value (#580)

This was already intended to work like this, but was buggy.

5 years agodoc/getting-started.md: replace "setenv" with "printenv" (#576)
Pierre-Marie de Rodat [Fri, 16 Oct 2020 18:13:02 +0000 (20:13 +0200)]
doc/getting-started.md: replace "setenv" with "printenv" (#576)

Update after #534

5 years agoAdded paragraph about adding an ALR badge (#574)
Vinzent "Jellix" Saranen [Thu, 15 Oct 2020 14:56:17 +0000 (16:56 +0200)]
Added paragraph about adding an ALR badge (#574)

* Added paragraph about adding an ALR badge

* Incorporated review comments

* Clarified that the website is updated once daily
* Use 'crate' instead of 'project' where appropriate to avoid confusion
* Minor wording changes.

5 years agoSaner defaults for the dependency solver (#573)
Alejandro R Mosteo [Thu, 15 Oct 2020 11:03:18 +0000 (13:03 +0200)]
Saner defaults for the dependency solver (#573)

We were needlessly exploring the whole solution space, even when the best
complete solution had been already found.

5 years agocatalog-format-spec.md: fix gpr-set-externals description (#572)
Fabien Chouteau [Wed, 14 Oct 2020 09:11:36 +0000 (11:11 +0200)]
catalog-format-spec.md: fix gpr-set-externals description (#572)

It should not be used to specify default values.

5 years agoci-windows.yml: fix zip release (#567)
Fabien Chouteau [Tue, 13 Oct 2020 11:58:15 +0000 (13:58 +0200)]
ci-windows.yml: fix zip release (#567)

5 years agoUpdate ci-linux.yml (#563)
Fabien Chouteau [Fri, 9 Oct 2020 15:58:10 +0000 (17:58 +0200)]
Update ci-linux.yml (#563)

* Update ci-linux.yml

Switch Linux CI to GitHub Ubuntu-18.04

* Update ci-linux.yml

* Update ci-linux.yml

Going back to GNAT community as GNAT-7 on Ubuntu-18.04 is not working.

5 years agoMove docker CI tests to its own workflow (#565)
Alejandro R Mosteo [Fri, 9 Oct 2020 15:47:51 +0000 (17:47 +0200)]
Move docker CI tests to its own workflow (#565)

Also remove obsolete env. var. BRANCH no longer needed as we no longer test the
old installer in this workflow.

5 years agoSwitch from devel- to stable- index branch (#566)
Alejandro R Mosteo [Fri, 9 Oct 2020 15:47:13 +0000 (17:47 +0200)]
Switch from devel- to stable- index branch (#566)

5 years agoreviewed for English grammar, spelling, etc. (#561)
Pat Rogers [Fri, 9 Oct 2020 07:44:22 +0000 (02:44 -0500)]
reviewed for English grammar, spelling, etc. (#561)

5 years agoSpelling fixes and README update (#559)
Alejandro R Mosteo [Thu, 8 Oct 2020 13:25:31 +0000 (15:25 +0200)]
Spelling fixes and README update (#559)

* Getting started: spelling fixes

* README: add beta info and build instructions

5 years agoUpdate getting-started with install from binary distribution (#558)
Fabien Chouteau [Tue, 6 Oct 2020 18:58:37 +0000 (20:58 +0200)]
Update getting-started with install from binary distribution (#558)

5 years agoUse GitHub API for basic checks/info during publishing (#554)
Alejandro R Mosteo [Tue, 6 Oct 2020 13:58:22 +0000 (15:58 +0200)]
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.

5 years agoFix `alr test` help info on default docker (#557)
Alejandro R Mosteo [Mon, 5 Oct 2020 18:37:35 +0000 (20:37 +0200)]
Fix `alr test` help info on default docker (#557)

5 years agoAlr.Platforms.Windows: download msys2 from GitHub releases (#556)
Fabien Chouteau [Mon, 5 Oct 2020 11:46:58 +0000 (13:46 +0200)]
Alr.Platforms.Windows: download msys2 from GitHub releases (#556)

* Alr.Platforms.Windows: download msys2 from GitHub releases

With the hope that GitHub servers are more reliable.

* Fix style

5 years agoCreate and upload assets to alr releases (#551)
Alejandro R Mosteo [Thu, 1 Oct 2020 17:26:48 +0000 (19:26 +0200)]
Create and upload assets to alr releases (#551)

* Upload artifacts as assets to releases

* Remove obsolete workflow attempt

5 years agoCreate binary artifact on Linux/macOS (#549)
Alejandro R Mosteo [Thu, 1 Oct 2020 10:08:34 +0000 (12:08 +0200)]
Create binary artifact on Linux/macOS (#549)

5 years agoGather user info during `alr init` for manifest creation (#548)
Alejandro R Mosteo [Tue, 29 Sep 2020 09:17:06 +0000 (11:17 +0200)]
Gather user info during `alr init` for manifest creation (#548)

* Init: fill defaults with user-provided info

* Code review fixes

5 years agoAdd default executable property in `alr init --bin` (#547)
Alejandro R Mosteo [Mon, 28 Sep 2020 11:29:50 +0000 (13:29 +0200)]
Add default executable property in `alr init --bin` (#547)

5 years agoAlire.Utils.User_Input: add function to query user's name, email and GitHub login...
Fabien Chouteau [Mon, 28 Sep 2020 11:29:28 +0000 (13:29 +0200)]
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>
5 years agoRemove linux installer script (#546)
Alejandro R Mosteo [Fri, 25 Sep 2020 15:04:00 +0000 (17:04 +0200)]
Remove linux installer script (#546)

5 years agoAlr.Commands: new Edit command (#545)
Fabien Chouteau [Fri, 25 Sep 2020 15:03:36 +0000 (17:03 +0200)]
Alr.Commands: new Edit command (#545)

* Alr.Commands: new Edit command

For the moment it opens GNATstudio within the Alire context.

* Alr.Commands.Init: add Create_Missing_Dirs

So the build won't fail if -p is not used with gprbuild.

* Fix test description

* testsuite/tests/workflows/edit: fix test when GNATstudio not in PATH

5 years agoAlr.Commands.Init: add or append to .gitignore (#544)
Fabien Chouteau [Fri, 25 Sep 2020 14:11:24 +0000 (16:11 +0200)]
Alr.Commands.Init: add or append to .gitignore (#544)

5 years agoCreate tarball from Alire workspace (#529)
Alejandro R Mosteo [Fri, 25 Sep 2020 14:10:02 +0000 (16:10 +0200)]
Create tarball from Alire workspace (#529)

* Create tarball from alire workspace

* Tests for tarball creation

* Code review fixes

* Workaround for macOS BSD tar

* Document `alr publish --tar` changes.

* Fix tar regular expr and improve related test

It seems GNAT's Normalize_Arguments does its own escaping, so we do not need to
do it ourselves. Also, the test checks that indeed the `alire` folder is
excluded when tar'ing manually.

5 years agoAlire.Release: print crate name in loading error messages (#541)
Fabien Chouteau [Fri, 25 Sep 2020 07:28:11 +0000 (09:28 +0200)]
Alire.Release: print crate name in loading error messages (#541)

5 years agoBump ada-toml to v0.2 (#539)
Fabien Chouteau [Thu, 24 Sep 2020 10:04:18 +0000 (12:04 +0200)]
Bump ada-toml to v0.2 (#539)

This release includes various parser fixes.

5 years agoactions: rename post-compile into post-build and add pre-build (#537)
Fabien Chouteau [Wed, 23 Sep 2020 13:55:04 +0000 (15:55 +0200)]
actions: rename post-compile into post-build and add pre-build (#537)

5 years agoTool and library version number (#536)
Fabien Chouteau [Wed, 23 Sep 2020 09:59:05 +0000 (11:59 +0200)]
Tool and library version number (#536)

* Tool and library version number

* Bump version to 0.7.0

5 years agoFix bug in external detection from version (#535)
Alejandro R Mosteo [Mon, 21 Sep 2020 09:13:30 +0000 (11:13 +0200)]
Fix bug in external detection from version (#535)

We failed if the executable was not found, but this is expected and simply
means the external is not available.

5 years agoalr init usability tweaks (#533)
Fabien Chouteau [Fri, 18 Sep 2020 12:03:36 +0000 (14:03 +0200)]
alr init usability tweaks (#533)

* Alr.Commands.Init: usability tweaks

This change makes the alr init --in-place generate a project skeleton.

This is to support the workflow:
 - Create repo on GitHub
 - Clone repo
 - cd repo
 - alr init --bin --in-place my_project

 Which was impossible to do before.

* Alr.Commands.Init: remove superfluous code

* Alr.Commands.Init: --in-place doesn't imply --no-skel

5 years agoAlr.Commands: rename setenv into printenv (#534)
Fabien Chouteau [Fri, 18 Sep 2020 11:04:55 +0000 (13:04 +0200)]
Alr.Commands: rename setenv into printenv (#534)

The command is actually not setting the environment but printing it.

5 years agoTweaks for detection of git URLs (#530)
Alejandro R Mosteo [Tue, 15 Sep 2020 15:28:55 +0000 (17:28 +0200)]
Tweaks for detection of git URLs (#530)

* Transform private repo URL into public one

For fetching from github, it is safe to do this transformation, whereas users
working with the repo may find more convenient the use of private git@ URLs.

* Detect github URLs missing a trailing ".git"

* Testsuite: more cases for git remotes

* Allow controlling the git@ -> https:// transformation

* Generalize checks beyond github

* Unit test for Alire.VCSs.Git.Transform_To_Public

5 years agoalr init: add compiler option controls to template project (#523)
Fabien Chouteau [Mon, 14 Sep 2020 16:19:05 +0000 (18:19 +0200)]
alr init: add compiler option controls to template project (#523)

* alr init: add compiler option controls to template project

User can control compile checks, run-time checks, contracts, style
checks.

* Testsuite: fix Ada coding style in tests

* Alr.Commands.Init: use UNIX line ending on all generated source code

To pass default GNAT style checks.

* Update alr-commands-init.adb

Alr.Commands.Init: fix line ending by using file IO binary mode

* Alr.Commands.Init: rever line ending changes and just remove the check

Git is messing with line ending on Windows so trying to produce UNIX files is more difficult than planned.

Instead the DOS line terminator style check is disabled.

5 years agoPublish tweaks (#528)
Fabien Chouteau [Mon, 14 Sep 2020 16:10:47 +0000 (18:10 +0200)]
Publish tweaks (#528)

* Alire.Publish: use error message similar to the git messages

* Alire.Publish: Do not print repo path if using CWD

* Alire.VCSs.Git: change status detection

Untracked files are ignored like git does.

* Alr.Commands.Publish: remove --prepare switch

Since there is no other publish mode.

* testsuite/tests/publish/local-repo: update expected output

5 years agoMerge publishing assistant PRs into master (#527)
Alejandro R Mosteo [Mon, 14 Sep 2020 10:25:41 +0000 (12:25 +0200)]
Merge publishing assistant PRs into master (#527)

Merge publishing assistant PRs into master

5 years agoUpdated documentation for new `alr publish` (#524)
Alejandro R Mosteo [Mon, 14 Sep 2020 10:11:07 +0000 (12:11 +0200)]
Updated documentation for new `alr publish` (#524)

* Document the new `alr publish` workflow

* Review changes

5 years agoAdded `user-changes.md` log for new `publish` feat
Alejandro R. Mosteo [Mon, 14 Sep 2020 09:46:31 +0000 (11:46 +0200)]
Added `user-changes.md` log for new `publish` feat

And spellcheck fixes

5 years ago--skip-build switch to skip the publish build check (#526)
Alejandro R Mosteo [Sat, 12 Sep 2020 17:02:01 +0000 (19:02 +0200)]
--skip-build switch to skip the publish build check (#526)

5 years agoUse local repository as reference for publishing (#519)
Alejandro R Mosteo [Sat, 12 Sep 2020 12:21:40 +0000 (14:21 +0200)]
Use local repository as reference for publishing (#519)

* Publish using local repo and revision as reference

We still require the remote is ready (in essence, that the local repo is not
ahead of the remote), but now it is simply a matter of issuing `alr publish` or
`alr publish <commit|tag|branch>`, and the corresponding commit will be used.

* Refactor long function name to more sensible one

* Fix comments due to bad refactoring

* Test for publishing from inside a repo

* Fixes uncovered by testsuite

Adding defaults for <URL> <commit> complicates things somewhat as we use local
paths for testing that would otherwise be rejected, so a few corner cases have
to be explicitly considered now.

5 years agoTest build the publishing release (#517)
Alejandro R Mosteo [Sat, 12 Sep 2020 12:06:37 +0000 (14:06 +0200)]
Test build the publishing release (#517)

* Test build the release

* Test that failing build is reported

* Fix zipping helper in testsuite

The extra indirection level was not required, as os.walk already gives us the
proper paths we need. This wasn't detected until we tried to build an unzipped
release zipped by ourselves.

5 years agoShow release information for user review (#516)
Alejandro R Mosteo [Sat, 12 Sep 2020 11:59:12 +0000 (13:59 +0200)]
Show release information for user review (#516)

* Show release information for user review

We also point out any recommended optional properties that are not informed.
Checks on completeness are also performed.

* Test missing/optional properties during publish

Also refactor some bulky code in a test to reusable drivers.helpers.py

5 years agoAdd switch to print the list of trusted git sites (#525)
Alejandro R Mosteo [Sat, 12 Sep 2020 11:47:33 +0000 (13:47 +0200)]
Add switch to print the list of trusted git sites (#525)

* Add switch to print the list of trusted git sites

5 years agoInitial list of trusted code hosts (#514)
Alejandro R Mosteo [Sat, 12 Sep 2020 11:46:49 +0000 (13:46 +0200)]
Initial list of trusted code hosts (#514)

* Initial list of trusted code hosts

* Test that an unknown domain is rejected

* Fixes for testsuited-detected problems on Windows

5 years agoMinimal publishing assistant (#512)
Alejandro R Mosteo [Sat, 12 Sep 2020 11:29:46 +0000 (13:29 +0200)]
Minimal publishing assistant (#512)

* Suppress warnings on unused package at top level

* First complete minimal publishing workflow

Only for repositories, many checks still missing, like: whitelist, version
conflict, buildability...

* Also working with source archives

* Deprecate --hash, --commit

Instead, the commit is simply a second optional argument

* Give upload URL for the PR and place manifest in ...

...alire/releases

* Check if in workspace for proper file placement

and also discourage publishing a crate within an unrelated workspace.

* Disable --hash test

* Tests for publishing and fixes for detected errors

To test without resorting to actual remote sources, we use --force which allows
local (file:) URLs.

* Workaround for Windows temporary failed deletion

Something about a git repository makes Ada.Directories.Delete_Tree to fail (my
guess that this is git related).

5 years agoFix test that inadvertently fetched community (#520)
Alejandro R Mosteo [Fri, 11 Sep 2020 09:14:50 +0000 (11:14 +0200)]
Fix test that inadvertently fetched community (#520)

5 years agoEditorial change: correcting command-line option (--use) (#521)
Gustavo A. Hoffmann [Fri, 11 Sep 2020 09:14:05 +0000 (11:14 +0200)]
Editorial change: correcting command-line option (--use) (#521)

5 years agoFix compilation warnings with current versions of GNAT (#518)
Boris Yakobowski [Wed, 9 Sep 2020 11:01:46 +0000 (13:01 +0200)]
Fix compilation warnings with current versions of GNAT (#518)

5 years agoDim output of spawned subprocesses (#513)
Alejandro R Mosteo [Tue, 8 Sep 2020 16:05:55 +0000 (18:05 +0200)]
Dim output of spawned subprocesses (#513)

* Dim output of spawned subprocesses

* Code review

5 years agoAccept whole answers in interactice questions (#511)
Nicolai Ruckel [Mon, 7 Sep 2020 11:21:47 +0000 (13:21 +0200)]
Accept whole answers in interactice questions (#511)

Fixes #509

5 years agoFix title of user change (#507)
Fabien Chouteau [Thu, 3 Sep 2020 10:28:24 +0000 (12:28 +0200)]
Fix title of user change (#507)

5 years agoMerge AEP-2 related PRs (#505)
Alejandro R Mosteo [Wed, 2 Sep 2020 17:55:46 +0000 (19:55 +0200)]
Merge AEP-2 related PRs (#505)

Merge AEP-2-derived changes to manifests into master

5 years agoWarn of obsolete metadata and provide some guidance (#506)
Alejandro R Mosteo [Wed, 2 Sep 2020 16:56:56 +0000 (18:56 +0200)]
Warn of obsolete metadata and provide some guidance (#506)

* Warn the user if old manifest detected

Minimal information is shown to reset a workspace; for more details a wiki on
the project repo link is printed.

* Improve the formatting of outdated index

* Don't consider `config.toml` for detection

5 years agoAEP for developer/packager workflow supporting changes (#466)
Alejandro R Mosteo [Wed, 2 Sep 2020 08:16:34 +0000 (10:16 +0200)]
AEP for developer/packager workflow supporting changes (#466)

* Add Alire Enhancement Proposal skeleton

* First draft of proposal #2

* Update proposal to reflect discussions

Instead of having an extra file, we rely on a private part within the manifest.

* Final version reflecting the implemented changes

5 years agoBump index version to v0.4 (per-release manifests) (#503)
Alejandro R Mosteo [Tue, 1 Sep 2020 18:55:27 +0000 (20:55 +0200)]
Bump index version to v0.4 (per-release manifests) (#503)

5 years agoStore backed up files inside `alire` folder (#500)
Alejandro R Mosteo [Tue, 1 Sep 2020 18:29:45 +0000 (20:29 +0200)]
Store backed up files inside `alire` folder (#500)

Instead of creating the ".prev" backup files in place, we move them into the alire folder so they don't pollute the user workspace.

5 years agoAlire.Config: s/config/config.toml/ (#504)
Alejandro R Mosteo [Tue, 1 Sep 2020 17:34:48 +0000 (19:34 +0200)]
Alire.Config: s/config/config.toml/ (#504)

After fixing the manifest file name to `alire.toml`, there is no possible
confusion with other toml files in the same directory, so we can explicitly
give .toml extension to config files.

5 years agoMove out a possible upstream-provided manifest (#487)
Alejandro R Mosteo [Tue, 1 Sep 2020 16:54:08 +0000 (18:54 +0200)]
Move out a possible upstream-provided manifest (#487)

When doing `alr get` we want to use the index-provided manifest for
reproducibility. So, an eventual upstream manifest provided with the sources is
renamed with an extra ".upstream" coda.

5 years agoDocumentation updates to reflect new manifests (#501)
Alejandro R Mosteo [Tue, 1 Sep 2020 15:25:36 +0000 (17:25 +0200)]
Documentation updates to reflect new manifests (#501)

5 years ago Move manifest and lock files to top-level folder (#494)
Alejandro R Mosteo [Tue, 1 Sep 2020 09:43:00 +0000 (11:43 +0200)]
 Move manifest and lock files to top-level folder (#494)

* Move and rename manifest to top-level dir

The manifest was ./alire/crate_name.toml. Now it is ./alire.toml (always named
alire.toml)

* Move and rename lockfile to top-level

Now the lockfile is also side-by-side with the manifest at top-level. It also
is always named `alire.lock`

* Testsuite adaptation

5 years agoRemove fields from local manifest (#493)
Alejandro R Mosteo [Tue, 18 Aug 2020 15:48:54 +0000 (17:48 +0200)]
Remove fields from local manifest (#493)

* Merge Alire.Releases.TOML_IO into Alire.Releases

Now that Alire.Releases is no longer Preelaborable, there is no reason for the
separation.

* Do not emit/load `origin` for local manifests

This information is only relevant for index manifests, so better not to confuse
users with fields that shouldn't be there.

* Make optional some fields in local manifests

Fields related to packaging can be required at the time of `alr publish`,
whereas they're not important for users not intending to package (yet).

* Testsuite adjustments

* Setup function for tests with init'ed crates

* Testsuite: verify no `[origin]` in local manifests

5 years agoNew Alire.Roots.Optional type (#492)
Alejandro R Mosteo [Tue, 18 Aug 2020 09:00:41 +0000 (11:00 +0200)]
New Alire.Roots.Optional type (#492)

In most cases, the Root has to be valid so it can be used. This patch moves the
Is_Valid code smell to a separate child type (Alire.Roots.Optional.Root) that
can be used in the few cases where all the root states have to be treated
separately.

This obsoletes Alr.Bootstrap.Session_States too.

5 years agoSplit long errors in several lines (#491)
Alejandro R Mosteo [Fri, 14 Aug 2020 16:07:41 +0000 (18:07 +0200)]
Split long errors in several lines (#491)

* Pretty print long errors in several lines

This is done by using newline characters to insert a new error prefix. A couple
of new facilities to encourage splitting of long errors are defined:
Errors.Wrap and Errors.Set (Wrapping_Message, Wrapped_Exception)

* Rename Last_Chance_Handler to Alr.Last_Chance_...

To avoid possible conflicts with other libraries and follow the naming of
other packages.

* Fix testsuite output matches on new line breaks

* Code review fixes

5 years agoIgnore unknown fields in manifest with `--force` (#495)
Alejandro R Mosteo [Fri, 14 Aug 2020 15:54:37 +0000 (17:54 +0200)]
Ignore unknown fields in manifest with `--force` (#495)

* Use manifest source (local, index) for finer errors

* Generate `metadata-version` during release saving

* Script to prepend manifest metadata versions

Not really necessary since we don't expect index manifests to include such
metadata version. Still, it makes clear the change.

* Testsuite adjustments for extra error output

Since we now take advantage of the manifest provenance (index/local), some
error messages require tweaking.

* Review: remove `metadata-version` field

* Allow unknown metadata fields with --force

Usually new fields will correspond with new features. Ignoring these from an
old `alr` version might be good enough for some commands to still work.

* Test for ignoring unknown properties

5 years agoUse manifest provenance (local/index) for finer diagnostics (#485)
Alejandro R Mosteo [Fri, 14 Aug 2020 15:53:52 +0000 (17:53 +0200)]
Use manifest provenance (local/index) for finer diagnostics (#485)

* Use manifest source (local, index) for finer errors

* Generate `metadata-version` during release saving

* Script to prepend manifest metadata versions

Not really necessary since we don't expect index manifests to include such
metadata version. Still, it makes clear the change.

* Testsuite adjustments for extra error output

Since we now take advantage of the manifest provenance (index/local), some
error messages require tweaking.

* Review: remove `metadata-version` field

5 years agoIncrementally edit manifest on `alr with` (#484)
Alejandro R Mosteo [Fri, 7 Aug 2020 12:56:46 +0000 (14:56 +0200)]
Incrementally edit manifest on `alr with` (#484)

* Append new dependencies to the end of the manifest

* Conservative removal of dependencies in `alr with`

This action will also not touch lines that aren't involved in the deletion.
Only a simple dependency, and trivially empty [[depends-on]] array entries will
be removed. As an improvement over the previous situation, dynamic expressions
will not preclude using `alr with` for static dependencies, leaving the dynamic
ones untouched.

* Use lexicographical order for printing dependencies

This was happening before by chance in several tests. The `alr with` changes
have surfaced that the order on file is kept in tree; while this has no
secondary effects, for presentation to the user is better to be always
consistent. Solutions already use ordered sets, so for lists within conditional
trees we do the same (only for presentation).

* Testsuite minor output fix

* Tests for new removal of dependencies

5 years agoMove origin information to its own top-level table (#480)
Alejandro R Mosteo [Fri, 7 Aug 2020 12:44:46 +0000 (14:44 +0200)]
Move origin information to its own top-level table (#480)

* Script to patch manifest with separate origin table

A self-contained origin table is cleaner and allow each origin kind to have its
own fields without polluting the rest of the properties top-level table

* Alire:Index: bump expected index version

* Load/Save new [origin] table

* Testsuite: migrated indexes to new [origin] format

* Fixes detected by testsuite

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.