]> _ Git - alire.git/log
alire.git
2 years agoAdd GPR externals and env. vars. to build hash computation (#1428)
Alejandro R Mosteo [Mon, 4 Sep 2023 08:22:03 +0000 (10:22 +0200)]
Add GPR externals and env. vars. to build hash computation (#1428)

* Update pins and dependencies

* Include GPR externals in hash computation

* Avoid recursivity when loading environment

* Test of hashing externals

2 years agoFix use of canary file during `alr install` (#1429)
Alejandro R Mosteo [Thu, 24 Aug 2023 12:34:26 +0000 (14:34 +0200)]
Fix use of canary file during `alr install` (#1429)

2 years agoNew Force_Delete (#1426)
Alejandro R Mosteo [Thu, 24 Aug 2023 12:34:08 +0000 (14:34 +0200)]
New Force_Delete (#1426)

2 years agoReplace `rsync` with `GNATCOLL.VFS.Copy` (#1427)
Alejandro R Mosteo [Thu, 24 Aug 2023 12:33:30 +0000 (14:33 +0200)]
Replace `rsync` with `GNATCOLL.VFS.Copy` (#1427)

2 years agoMacOS; export PATH variables for includes and libraries. (#1420)
Simon Wright [Mon, 21 Aug 2023 15:14:46 +0000 (16:14 +0100)]
MacOS; export PATH variables for includes and libraries. (#1420)

* MacOS; export PATH variables for includes and libraries.

Homebrew and MacPorts install include files and libraries in places
where GCC won't look by default.

GCC will use these environment variables if set:

   C_INCLUDE_PATH     for C includes
   CPLUS_INCLUDE_PATH for C++ includes
   LIBRARY_PATH       for libraries

Both of the distribution managers place (symbolic links to) include
files in ${top_level}/include and libraries in ${top_level}/lib.

   For Homebrew on Intel silicon, top_level is normally /usr/local.
   For Homebrew on Apple silicon, top_level is normally /opt/homebrew.
   For MacPorts,                  top_level is normally /opt/local

  * src/alire/alire-platforms-current.ads (Load_Environment): add note
      on macOS use.
  * src/alire/os_macos/alire-platforms-current__macos.adb
    (context): added Alire.Environment (was limited), Ada.Directories.
    (Brew_Access): new.
    (Homebrew_Present): if Brew_Access is not null.
    (Detected_Distribution): made into an expression function.
    (Containing_Containing_Dir): new, used in Distribution_Root.
    (Distribution_Root): reworked.
    (Load_Environment): if either distribution is present, arrange to
      export the environment variables to suit.

* Update testsuite to match new macOS distribution detection.

  * testsuite/drivers/helpers.py (distribution): if on macOS, check whether
      the distribution management tool is on the PATH. We used to check for
      the environment variable HOMEBREW_PREFIX, but users don't have to
      arrange for this to be set in order to run Homebrew.

      First, if 'brew' is found, the distribution is Homebrew.
      If not and 'port' is found, the distribution is MacPorts.
      Otherwise, the distribution is unknown.

* In the macOS CI workflow, run the test script once only.

  * .github/workflows/ci-macos.yml (Run test script): remove the second
      call, which set up HOMEBREW_PREFIX (now no longer used by alr),
      and remove the note '(without Homebrew)' in the first.

2 years agoUse build profile in build hash (#1425)
Alejandro R Mosteo [Mon, 21 Aug 2023 14:12:45 +0000 (16:12 +0200)]
Use build profile in build hash (#1425)

* Compute hash using build profile

* Fix problem with multiple hashes in one run

Rooted in that default build profiles were used first and later the actual
profiles caused different folders to be used, in turn causing errors with the
conflicting CRATE_ALIRE_PREFIX variables.

* Write hash inputs to build dirs

* Testsuite additions and fixes

* Self-review

* Update pins and dependencies

2 years agoRefactor Alire.Shared into Alire.Toolchains (#1423)
Alejandro R Mosteo [Tue, 8 Aug 2023 09:29:43 +0000 (11:29 +0200)]
Refactor Alire.Shared into Alire.Toolchains (#1423)

2 years agoTrivial safeguard in `Force_Delete` (#1422)
Alejandro R Mosteo [Tue, 8 Aug 2023 09:29:12 +0000 (11:29 +0200)]
Trivial safeguard in `Force_Delete` (#1422)

2 years agoNew shared builds mechanism (mockup) (#1419)
Alejandro R Mosteo [Sat, 5 Aug 2023 19:10:44 +0000 (21:10 +0200)]
New shared builds mechanism (mockup) (#1419)

* New shared builds mechanism (mockup)

* Self-review

* Fixes for Windows

2 years agoDon't treat warnings as erros when no style checks (#1412)
Alejandro R Mosteo [Tue, 1 Aug 2023 10:24:36 +0000 (12:24 +0200)]
Don't treat warnings as erros when no style checks (#1412)

2 years agoBetter random generation of temp file names (#1414)
Alejandro R Mosteo [Tue, 1 Aug 2023 10:24:10 +0000 (12:24 +0200)]
Better random generation of temp file names (#1414)

The issue was with the default random seed being the same during a whole
second, so batch runs in the testsuite did clash from time to time.

2 years agoFix nightly build (#1413)
Alejandro R Mosteo [Thu, 27 Jul 2023 13:57:58 +0000 (15:57 +0200)]
Fix nightly build (#1413)

2 years agoNew `alr publish --request-review` (#1409)
Alejandro R Mosteo [Thu, 27 Jul 2023 10:59:53 +0000 (12:59 +0200)]
New `alr publish --request-review` (#1409)

* Descriminate more PR states

Only missing is when there are changes requested

* Colored states

* Fixed review evaluation

* New `alr publish --request-review`

* Document new feature in user visible changes

* Self-review

2 years agoNew `alr publish --cancel` (#1406)
Alejandro R Mosteo [Tue, 25 Jul 2023 10:21:13 +0000 (12:21 +0200)]
New `alr publish --cancel` (#1406)

* New `alr publish --cancel <num> --reason <text>`

* Added JSON escaping

* Update alire.toml pins

* user-changes.md: new `--status`, `--cancel` switches

2 years agodev: use env for executable shebangs (#1408)
tali auster [Mon, 24 Jul 2023 09:38:41 +0000 (03:38 -0600)]
dev: use env for executable shebangs (#1408)

This is just a minor fix to let the scripts run in more exotic
environments, i.e., NixOS.

2 years ago`alr publish --status` (#1400)
Alejandro R Mosteo [Tue, 18 Jul 2023 15:01:25 +0000 (17:01 +0200)]
`alr publish --status` (#1400)

* Update doc on publishing to match new behavior

* Retrieve status of opened PRs by the user

Make it so the maximum number of results is returned by github

* Self-review

2 years agoChange all mentions of 'catalog' to 'index' (#1405)
Alejandro R Mosteo [Tue, 18 Jul 2023 14:58:08 +0000 (16:58 +0200)]
Change all mentions of 'catalog' to 'index' (#1405)

2 years agoSupport MacPorts as external provider. (#1404)
Simon Wright [Tue, 18 Jul 2023 11:37:59 +0000 (12:37 +0100)]
Support MacPorts as external provider. (#1404)

* src/alire/alire-origins-deployers-system-macports.adb: new.
  * src/alire/alire-origins-deployers-system-macports.ads: new.
  * src/alire/alire-origins-deployers-system.adb
    (context): add Alire.Origins.Deployers.System.Macports.
    (Platform_Deployer): Platforms.Macports => System.Macports.Deployer.
  * src/alire/alire-platforms.ads
    (Distributions): add Macports.
    (Package_Managers): likewise.
    (Distro_Manager): Macports => Macports.
  * src/alire/alire-utils-tools.adb (System_Package_For_Tool): add Macports,
      same as the other distributions.
  * src/alire/os_macos/alire-platforms-current__macos.adb:
    (context): add GNAT.OS_Lib.
    (Port_Access): new, access to Macports' 'port' executable.
    (Macports_Present): new, true if 'port' was found.
    (Detected_Distribution): first, check for Homebrew_Present, then, for
      Macports_Present. Return the corresponding Distribution if found.

2 years agoBits from the `alr share` feat to be kept (#1399)
Alejandro R Mosteo [Tue, 18 Jul 2023 11:16:57 +0000 (13:16 +0200)]
Bits from the `alr share` feat to be kept (#1399)

* Bits from the `alr share` feat to be kept

* Code review changes

* Update CLIC pin

* Use upstream CLIC repository

2 years agoImprovements to publishing with automatic PR creation (#1398)
Alejandro R Mosteo [Mon, 3 Jul 2023 18:39:13 +0000 (20:39 +0200)]
Improvements to publishing with automatic PR creation (#1398)

* Added --submit switch to `alr publish`

* Forking of community index

* Changes up to pushing the manifest

* PR creation

* Reshaped as steps of the assistant

* Use release-specific branch

* Report PR webpage after creation

* Detect existing conflicting PR

* Minor tweaks (draft mode, texts, busy spinners)

* Documentation

* Allow overriding of community index info

This will allow our testing and help maintainers of other indexes

* Fix temp dir being not absolute

* Fixes for self-build with `alr build`

* Fixes for Windows temp file specifics

* Document all steps more thoroughly

Also use a better name for the new child package.

* Make submission the default after user confirmation

Document this change in behavior and the new `--skip-submit` switch that
restores the former behavior.

* Default to submit, and add switch not to submit

2 years agoIndicators in solution diff about non-source dependencies (#1395)
Alejandro R Mosteo [Thu, 22 Jun 2023 12:41:33 +0000 (14:41 +0200)]
Indicators in solution diff about non-source dependencies (#1395)

* Warn about non-source dependencies

* Disable fail-fast in workflow

* Create virtual environment

2 years agoUse a python3 venv on Linux distros (#1396)
Alejandro R Mosteo [Thu, 22 Jun 2023 08:31:55 +0000 (10:31 +0200)]
Use a python3 venv on Linux distros (#1396)

2 years agoFix Windows testsuite for self-built alr (#1387)
Alejandro R Mosteo [Fri, 2 Jun 2023 11:14:42 +0000 (13:14 +0200)]
Fix Windows testsuite for self-built alr (#1387)

2 years agoUnify naming of session/working folder as workspace (#1390)
Alejandro R Mosteo [Fri, 2 Jun 2023 11:03:13 +0000 (13:03 +0200)]
Unify naming of session/working folder as workspace (#1390)

2 years agoSelect default toolchain automatically instead of showing assistant on 1st run (...
Alejandro R Mosteo [Fri, 2 Jun 2023 11:01:17 +0000 (13:01 +0200)]
Select default toolchain automatically instead of showing assistant on 1st run (#1391)

* Use defaults for toolchain instead of assistant on 1st run

* Test automatic toolchain selection

* Self-review

* Extra check in test

2 years agoFix unpacking of tarfiles with softlinks to subdirectories (#1382)
Alejandro R Mosteo [Wed, 31 May 2023 15:52:44 +0000 (17:52 +0200)]
Fix unpacking of tarfiles with softlinks to subdirectories (#1382)

* Fix Traverse_Tree for softlinked dirs

Remains: GC.VFS.Remove_Dir fails because of the same reason, probably.

* Manually delete softlinks prior to deleting a dir

Otherwise, depending on the links' targets, both Ada.Directories and
GNATCOLL.VFS had trouble with fully deleting a tree containing such links.

* Test for tarballs containing softlinks

* Self-review

* Skip new test on Windows

2 years agoDon't raise on bad external detection from output (#1389)
Alejandro R Mosteo [Wed, 31 May 2023 15:51:54 +0000 (17:51 +0200)]
Don't raise on bad external detection from output (#1389)

* New test case for detection from output

* Add exception catch-all and report in debug output

2 years ago"Compiler version" --> "Compiled with version" (#1388)
Alejandro R Mosteo [Wed, 31 May 2023 11:48:51 +0000 (13:48 +0200)]
"Compiler version" --> "Compiled with version" (#1388)

2 years agoFixes for compilation with gcc 13.1 (#1381)
Alejandro R Mosteo [Wed, 31 May 2023 10:01:44 +0000 (12:01 +0200)]
Fixes for compilation with gcc 13.1 (#1381)

2 years agoalire-platforms-current__windows.adb: add C++ include path for msys2 (#1375)
Fabien Chouteau [Tue, 2 May 2023 12:51:02 +0000 (14:51 +0200)]
alire-platforms-current__windows.adb: add C++ include path for msys2 (#1375)

2 years agoAlr init fixes (#1372)
Fabien Chouteau [Tue, 25 Apr 2023 11:19:02 +0000 (13:19 +0200)]
Alr init fixes (#1372)

* Alr.Commands.Init: improve error message on tag input validation

* Alr.Commands.Init: fix string escape for generated manifest

* Alr.Commands.Init: add LLVM-exception options and change default

2 years agoFix Wide_Wide_String interpreted as String (#1370)
Alejandro R Mosteo [Fri, 21 Apr 2023 10:34:14 +0000 (12:34 +0200)]
Fix Wide_Wide_String interpreted as String (#1370)

2 years agoRemove `alr test --docker` (#1366)
Alejandro R Mosteo [Wed, 5 Apr 2023 15:21:54 +0000 (17:21 +0200)]
Remove `alr test --docker` (#1366)

* Local testing of crates with docker images

WIP: write tests for local+docker default+custom tests

This opens the doors to batch testing on many distros locally

* Test for the use of docker with local `alr test`

* Self-review

* WIP: something funny with the testsuite output

* Remove `alr test --docker`

* Add user changes

* Revert .vscode changes to unclutter PR

* Fix PR number in user changes

2 years agoConfig option to globally share dependencies (#1367)
Alejandro R Mosteo [Wed, 5 Apr 2023 15:21:18 +0000 (17:21 +0200)]
Config option to globally share dependencies (#1367)

* Add config option to override dependencies location

Note that pins are not affected, as those are likely to be conflicting across
projects.

* Ensure shared deps have a manifest, show in `alr version`

* Test for new shared dependencies

* Force regeneration of config when global dep sharing

* Check that configs are regenerated every time

2 years agoTweaks to VSCode support configuration
Alejandro R. Mosteo [Tue, 4 Apr 2023 16:24:11 +0000 (18:24 +0200)]
Tweaks to VSCode support configuration

2 years agoBump clic dependency (#1363)
Alejandro R Mosteo [Mon, 3 Apr 2023 11:50:54 +0000 (13:50 +0200)]
Bump clic dependency (#1363)

* Bump clic dependency to include clic#27

* Add test to double-check proper UTF-8 output

* Make test not dependent on tty detection

2 years agoFix nightly build (#1365)
Alejandro R Mosteo [Sun, 2 Apr 2023 11:01:57 +0000 (13:01 +0200)]
Fix nightly build (#1365)

* Add branch to test config

* Try to pinpoint offending 'uses'

2 years agoSwitch to ghcr.io from dockerhub (#1360)
Alejandro R Mosteo [Fri, 31 Mar 2023 09:07:14 +0000 (11:07 +0200)]
Switch to ghcr.io from dockerhub (#1360)

* Switch to ghcr.io from dockerhub

* Use action instead of manually invoking Docker

2 years agoTyped variants of Alire.Config.Edit.Set (#1353)
Alejandro R Mosteo [Thu, 30 Mar 2023 11:19:42 +0000 (13:19 +0200)]
Typed variants of Alire.Config.Edit.Set (#1353)

* Typed variants of Alire.Config.Edit.Set

Mostly because it's too easy to mix Boolean with String

* Migrate raw uses to typed uses

* Leave only needed instances

* Update clic dependency

2 years agoDocker driver for tests in default configuration (#1358)
Alejandro R Mosteo [Mon, 27 Mar 2023 20:21:59 +0000 (22:21 +0200)]
Docker driver for tests in default configuration (#1358)

2 years agoTest the local release with `alr test` (#1356)
Alejandro R Mosteo [Mon, 27 Mar 2023 20:21:15 +0000 (22:21 +0200)]
Test the local release with `alr test` (#1356)

* Ability to test local crate

* Test for local crate testing

* self-review

* Add user changes entry

* Add check of release profile to tests

2 years agoUnicode documentation (#1332)
Alejandro R Mosteo [Fri, 24 Mar 2023 11:51:08 +0000 (12:51 +0100)]
Unicode documentation (#1332)

* Document Alire policy on Unicode

* Add control over -gnatW8 switch

* Tweak documentation and tests

* Document in AEP the -gnatW8 effects

* Reformat long lines

* Add comp.lang.ada references

* Renamed source encoding switches

* Use Compiler_Default for no switches

* Update catalog doc to match new source encoding types

* Fix wrong mix of Wide_String with UTF-16

* Bump dependencies

2 years agoActually use the cache location for shared releases (#1349)
Alejandro R Mosteo [Tue, 21 Mar 2023 11:26:03 +0000 (12:26 +0100)]
Actually use the cache location for shared releases (#1349)

* Use the cache location for shared releases

* Self-review

* User changes summary

* Cache migration to avoid redownloads

* Removed cache migration

2 years agoAvoid a crash when system pkg is detected twice (#1350)
Alejandro R Mosteo [Thu, 16 Mar 2023 08:45:02 +0000 (09:45 +0100)]
Avoid a crash when system pkg is detected twice (#1350)

Different system package names may resolve to the same version, e.g. when using
transitional names. Although the external definition is probably wrong and
could be fixed, better not to crash as this is a non-issue for us.

2 years agoUpdate getting-started.md (#1343)
corinthian13 [Tue, 14 Mar 2023 10:36:59 +0000 (10:36 +0000)]
Update getting-started.md (#1343)

* Update getting-started.md

Lines 12 - 15.

More clarity on how to add PATH entry for Alire ecosystem client installed on a user's local Linux machine.
PATH value was missing the required double quotes.

* Update getting-started.md

To offer users a choice of adding the Alire client environment to their PATH environment either just for their current terminal session or for future sessions also.

* Update getting-started.md

Put PATH entries into .profile rather than .bashrc since some users may not be using the bash shell, i.e. may be using csh, zsh, fsh, etc.

2 years agoUpdate: "This file is generated" (#1338)
Jesper Quorning [Tue, 7 Mar 2023 10:15:15 +0000 (11:15 +0100)]
Update: "This file is generated" (#1338)

* Update: "This file is generated"

* Update alire-lockfiles.adb

2 years agoDon't enable color if TERM=dumb (#1342)
Alejandro R Mosteo [Thu, 2 Mar 2023 11:32:21 +0000 (12:32 +0100)]
Don't enable color if TERM=dumb (#1342)

2 years agoMore explicit identifier error message (#1341)
Alejandro R Mosteo [Thu, 2 Mar 2023 10:04:27 +0000 (11:04 +0100)]
More explicit identifier error message (#1341)

2 years agoNew `--nested` switch for `alr show` (#1333)
Alejandro R Mosteo [Fri, 24 Feb 2023 11:54:34 +0000 (12:54 +0100)]
New `--nested` switch for `alr show` (#1333)

* Print nested crates under current folder

With `alr show --nested`, or after `alr get`/`alr with`.

* Test for `alr show --nested`

* Do not show when run non-interactive

* Self-review

2 years agoInstall indexed crates (#1335)
Alejandro R Mosteo [Fri, 24 Feb 2023 10:21:20 +0000 (11:21 +0100)]
Install indexed crates (#1335)

* Improve Roots.Create_From_Release

* Install crates directly from index

2 years agoReplace uses of GNAT CE with latest FSF from Alire (#1330)
Alejandro R Mosteo [Wed, 22 Feb 2023 10:47:39 +0000 (11:47 +0100)]
Replace uses of GNAT CE with latest FSF from Alire (#1330)

* Replace uses of GNAT CE with latest FSF from Alire

* Set up alr path in run.py

* Remove caching already done by alr-install

2 years agoMention dev/build.sh and fix typos in readme (#1331)
Piotr Orzechowski [Tue, 21 Feb 2023 09:55:20 +0000 (10:55 +0100)]
Mention dev/build.sh and fix typos in readme (#1331)

* Fix readme typos

* Mention dev/build.sh in readme

2 years agoAdd Alire.Platforms.Folders.Home for FreeBSD (#1328)
Jeremy Grosser [Mon, 20 Feb 2023 11:27:30 +0000 (03:27 -0800)]
Add Alire.Platforms.Folders.Home for FreeBSD (#1328)

Co-authored-by: Alejandro R. Mosteo <amosteo@unizar.es>
2 years agoWrite Warn/Error traces to stderr by default (#1327)
Alejandro R Mosteo [Mon, 20 Feb 2023 10:37:53 +0000 (11:37 +0100)]
Write Warn/Error traces to stderr by default (#1327)

* Write Warn/Error traces to stderr by default

* Update simple_logging pin

2 years agoRun testsuite on selfbuilds too (#1324)
Alejandro R Mosteo [Wed, 15 Feb 2023 10:10:51 +0000 (11:10 +0100)]
Run testsuite on selfbuilds too (#1324)

Run the testsuite after `alr build` ourselves. This ensures no only that
`alire.toml` allows building, but that the dependency versions are proper.

Also start using `setup-alire@v2` which should result in speed-up.

2 years agoInstall a local crate (#1322)
Alejandro R Mosteo [Tue, 14 Feb 2023 16:09:39 +0000 (17:09 +0100)]
Install a local crate (#1322)

* Install a local crate to a prefix

* Make --this the default, list info with --info

2 years agoFix the example for editor.cmd (#1313)
Manuel [Tue, 7 Feb 2023 13:12:53 +0000 (14:12 +0100)]
Fix the example for editor.cmd (#1313)

Using double quotes, the  ${GPR_FILE} is interpreted as a variable by Bourne-like shells and evaluated to an empty string or whatever value has when executed. Single quotes is a way to avoid that evaluation.

This example will not make Emacs select and load the GPR_FILE as the project file for ada-mode, that would be more cumbersome (and requires ada-mode 8.0.3), but I didn't want to complicate the example:
```
alr config --set --global editor.cmd 'emacs --eval=(ada-build-prompt-select-prj-file"${GPR_FILE}") ${GPR_FILE}'
```

2 years ago`alr install`: Installation of binary crates (#1302)
Alejandro R Mosteo [Thu, 2 Feb 2023 15:56:00 +0000 (16:56 +0100)]
`alr install`: Installation of binary crates (#1302)

* Installation of binary releases

* Basic prevention of conflicting installs

* Self-review and cleanup

* Add test and related fixes

* gprbuild tests wrt library placement and artifacts

2 years agoalire_common.gpr: remove default host os to avoid mistakes on macOS (#1298)
Fabien Chouteau [Tue, 31 Jan 2023 10:39:56 +0000 (11:39 +0100)]
alire_common.gpr: remove default host os to avoid mistakes on macOS (#1298)

* alire_common.gpr: remove default host os to avoid mistakes on macOS

With the default being Linux, macOS users will not notice any issue until they try to use the executable.
Even then the issue will be obscure.

* Remove any implicit detection of the host OS

This should avoid misbuilds that mix Linux/macOS.

A bash function is now provided for detection of the OS in our scripts.

---------

Co-authored-by: Alejandro R. Mosteo <amosteo@unizar.es>
2 years agoCheck remote hosts during `alr index --check` (#1309)
Alejandro R Mosteo [Fri, 27 Jan 2023 16:58:00 +0000 (17:58 +0100)]
Check remote hosts during `alr index --check` (#1309)

2 years agoSpecify the initial branch for test repos. (#1244)
Simon Wright [Fri, 27 Jan 2023 14:26:35 +0000 (14:26 +0000)]
Specify the initial branch for test repos. (#1244)

Reason: the git in macOS Xcode 14 defaults the initial branch to 'main',
but the tests assume 'master'.

  * testsuite/drivers/helpers.py (init_git_repo): check out the branch
      'master'.

2 years agoFix error when showing an unavailable binary origin (#1304)
Alejandro R Mosteo [Thu, 26 Jan 2023 09:35:33 +0000 (10:35 +0100)]
Fix error when showing an unavailable binary origin (#1304)

This only triggers when a binary origin is lacking entries for the current
platform.

2 years agoClearer error for misplaced manifest in index tree (#1213)
Alejandro R Mosteo [Wed, 25 Jan 2023 09:31:06 +0000 (10:31 +0100)]
Clearer error for misplaced manifest in index tree (#1213)

Co-authored-by: GHA <actions@github.com>
2 years agoFix "Loading crate=0.0.0" log message (#1106)
Alejandro R Mosteo [Thu, 19 Jan 2023 13:05:19 +0000 (14:05 +0100)]
Fix "Loading crate=0.0.0" log message (#1106)

2 years agoAdd `--alr` testsuite option (#1295)
Piotr Orzechowski [Thu, 19 Jan 2023 09:55:28 +0000 (10:55 +0100)]
Add `--alr` testsuite option (#1295)

The testsuite runs tests against `alr` from project's `bin` dir by default.
This option makes it possible to select arbitrary `alr` to test.

2 years agoDisallow dots in identifiers (#1267)
Piotr Orzechowski [Wed, 18 Jan 2023 16:14:34 +0000 (17:14 +0100)]
Disallow dots in identifiers (#1267)

* Disallow leading dot in identifiers

This is to avoid `alr printenv` printing invalid
environment variable names, i.e. with leading dot.

* Fix typo in run_alr error message

* Simplify crate name validation test code

* Use two letters for min crate name length verification

* Test init with valid crate name

* Add more test cases for bad index name

* Use constant instead of dot literal

* Disallow dots in identifiers

Dots in identifiers are allowed by mistake.
This commit forbids them completely, instead
of just disallowing dots as the first character
in crate name.

2 years agoUse XDG_CACHE_DIR for cache (#1265)
Tim Lagnese [Wed, 18 Jan 2023 16:05:53 +0000 (11:05 -0500)]
Use XDG_CACHE_DIR for cache (#1265)

2 years agoEnable manual running of Nightly workflow
Alejandro R. Mosteo [Mon, 16 Jan 2023 10:27:01 +0000 (11:27 +0100)]
Enable manual running of Nightly workflow

2 years agoFix typo in Nightly workflow
Alejandro R. Mosteo [Mon, 16 Jan 2023 10:23:06 +0000 (11:23 +0100)]
Fix typo in Nightly workflow

2 years agoWorkflow to have a binary nightly build (#1293)
Alejandro R Mosteo [Mon, 16 Jan 2023 10:20:14 +0000 (11:20 +0100)]
Workflow to have a binary nightly build (#1293)

This is with an eye on being able to use latest devel features without
requiring setting up a compiler or compiling alr

2 years agoFix typo. (#1292)
Vadim Godunko [Mon, 16 Jan 2023 09:23:23 +0000 (12:23 +0300)]
Fix typo. (#1292)

2 years agoUpdate msys2 installer (#1284)
Fabien Chouteau [Thu, 12 Jan 2023 20:02:17 +0000 (21:02 +0100)]
Update msys2 installer (#1284)

* Update msys2 installer

* Follow updated MSYS2 first install instructions

* Show proper error message if msys2 update fails

* Fix the command to query for pending updates

* Don't scare-warn needlessly during msys2 update

Co-authored-by: Alejandro R. Mosteo <amosteo@unizar.es>
3 years agoUse `alr` from project bin dir in testsuite (#1262)
Piotr Orzechowski [Tue, 13 Dec 2022 18:53:36 +0000 (19:53 +0100)]
Use `alr` from project bin dir in testsuite (#1262)

* Mention Python 3 testsuite run script's comment

* Prepend alr project dir to PATH before running tests

* Fail user input validation test explicitly

Use Polish letter 'ł' to make user input validation test
explicitly mention encoding problems when failing.

3 years agoAlr.Commands.Search: unify "search" and "search --crates" behavior (#1254)
Fabien Chouteau [Thu, 1 Dec 2022 15:51:16 +0000 (16:51 +0100)]
Alr.Commands.Search: unify "search" and "search --crates" behavior (#1254)

They now both look in names and descriptions, case insensitive.

3 years agoUpdate getting-started.md (#1253)
Fabien Chouteau [Thu, 1 Dec 2022 10:56:55 +0000 (11:56 +0100)]
Update getting-started.md (#1253)

We don't want to imply that those info will be required at some point.
In particular we don't want the use of Alire to require a GitHub account.

3 years agoUpdate testsuite readme (#1252)
Piotr Orzechowski [Thu, 1 Dec 2022 10:02:33 +0000 (11:02 +0100)]
Update testsuite readme (#1252)

* Require Python 3 in testsuite readme

* Add e3-testsuite link to testsuite readme

* Add GNAT and GPRBuild requirement to testsuite readme

3 years agoUse hyphens for action usage output (#1249)
Piotr Orzechowski [Thu, 24 Nov 2022 06:38:49 +0000 (07:38 +0100)]
Use hyphens for action usage output (#1249)

Currently action usage output looks like:
`alr action [options] [post_fetch|pre_build|post_build|test]`,
but it should look like:
`alr action [options] [post-fetch|pre-build|post-build|test]`,
because TOML expects keys to be hyphenated.

This commit fixes the problem by replacing underscores with hyphens.

3 years agoFix crate config conflicts errors (#1208)
Fabien Chouteau [Fri, 18 Nov 2022 08:55:04 +0000 (09:55 +0100)]
Fix crate config conflicts errors (#1208)

* Alire.Properties.Configurations: print boolean values in lowercase

To match casing of TOML files where they come from.

* Alire.Crate_Configuration: fix, improve, and test value conflicts

 - TOML value comparison was incorrect (use Equals function now)
 - The "set by" info was incorrect
 - Error message now show the conflicting values

3 years agoImprove user experience with better manifest errors messages (#1229)
Fabien Chouteau [Thu, 17 Nov 2022 11:38:45 +0000 (12:38 +0100)]
Improve user experience with better manifest errors messages (#1229)

* Improve user experience with better manifest errors messages

This is patch introduces suggestions in various error messages
from the manifest parser. A potential suggestion is made using
edit distance computing from a list of possible values. If the
quality is not deemed good enough, the full list of values is
printed.

* Temp fix GNAT version to check error on macOS

* Revert "Temp fix GNAT version to check error on macOS"

This reverts commit 5da86ba29a013940cb8469ae7f07b8114e488714.

* Try with fixed macOS 10.15 version

3 years agoalr-commands-init.adb: make alr init interactive (#1228)
Fabien Chouteau [Thu, 27 Oct 2022 08:39:26 +0000 (10:39 +0200)]
alr-commands-init.adb: make alr init interactive (#1228)

Alr init will now queries the user for information such as license,
description, tags, etc.

Non-interactive usage is still possible using existing switches and `-n`.

3 years agoalr publish: warn about -dev version (#1221)
Fabien Chouteau [Tue, 25 Oct 2022 08:13:23 +0000 (10:13 +0200)]
alr publish: warn about -dev version (#1221)

* testsuite: simplify some alr publish tests

* alr publish: warn about -dev version

3 years agoEncode wwstrings as utf8 (#1220)
Alejandro R Mosteo [Mon, 24 Oct 2022 15:19:42 +0000 (17:19 +0200)]
Encode wwstrings as utf8 (#1220)

* Encode wwstrings as utf8

* Fixes for raw byte reading in ada-toml

* Further fixes related to UTF-8 encodings

* Sync pins with submodules

* Revert unneeded changes in Simple_Logging

Since GNAT.IO is safe to use with utf8

Co-authored-by: GHA <actions@github.com>
3 years agoAdd source code recommendations to the policies (#1202)
Maxim Reznik [Wed, 5 Oct 2022 09:35:55 +0000 (12:35 +0300)]
Add source code recommendations to the policies (#1202)

about UTF-8 encoding and a URL to Ada Style Guide.
Refs #919.

3 years agoBuild switches: unconditionally add -gnatW8 (#972)
Fabien Chouteau [Thu, 29 Sep 2022 16:09:48 +0000 (18:09 +0200)]
Build switches: unconditionally add -gnatW8 (#972)

* Build switches: unconditionally add -gnatW8

* Update user-changes.md

3 years agoFix alr help edit: GNAT Studio (#1199)
Jesper Quorning [Mon, 26 Sep 2022 11:28:43 +0000 (13:28 +0200)]
Fix alr help edit: GNAT Studio (#1199)

3 years agoImplement Homebrew as the system deployer for macOS. (#1185)
Simon Wright [Fri, 23 Sep 2022 12:14:13 +0000 (13:14 +0100)]
Implement Homebrew as the system deployer for macOS. (#1185)

* Implement Homebrew as the system deployer for macOS.

  * src/alire/alire-origins-deployers-system-homebrew.adb: new.
  * src/alire/alire-origins-deployers-system-homebrew.ads: new.
  * src/alire/alire-origins-deployers-system.adb (Platform_Deployer):
      When the platform distro manager is Homebrew, return Homebrew.Deployer.
  * src/alire/alire-platforms.ads (Distributions): include macOS.
    (Package_Managers): add Homebrew.
    (Distro_Manager): for macOS, use Homebrew.
  * src/alire/alire-utils-tools.adb (System_Package_For_Tool): treat MacOS
      like other distributions.
  * src/alire/os_macos/alire-platforms-current__macos.adb
    (Detected_Distribution): return Platforms.MacOS.
  * testsuite/drivers/helpers.py (on_macos()): new.
    (distribution()): return 'MACOS' if on_macos() is True.

; Squashed commit of the following:

; commit 0110299ceb66f58cd4793fd78a69fc5b100b4ccf
; Author: Simon Wright <simon@pushface.org>
; Date:   Fri Sep 9 17:45:04 2022 +0100

;     Restore test to correct sense.

; commit d396b6b54a73bbbfd59071539bf6268bccce3cf0
; Author: Simon Wright <simon@pushface.org>
; Date:   Fri Sep 9 17:34:54 2022 +0100

;     Replace assertions in Homebrew deployer with exceptions

; commit d7603110b9543bdaac9516fa844599e87fac70aa
; Author: Simon Wright <simon@pushface.org>
; Date:   Mon Sep 5 14:14:03 2022 +0100

;     Recognise macOS as a distribution.

;       * testsuite/drivers/helpers.py (on_macos()): new.
;         (distribution()): check on_macos(). Return 'MACOS' if true.

; commit 8703acfeb8fdf336d862cefc16706eac5d3f0758
; Author: Simon Wright <simon@pushface.org>
; Date:   Sun Sep 4 17:33:13 2022 +0100

;     Use 'brew info' to get available, installed versions.

; commit 8b22b904e19d64fecb89233e6527c2faf655d982
; Author: Simon Wright <simon@pushface.org>
; Date:   Wed Aug 31 15:54:51 2022 +0100

;     Continuing.

; commit a9821ed9a605e30b5699a49df6fffd11224ab931
; Author: Simon Wright <simon@pushface.org>
; Date:   Mon Aug 22 17:09:48 2022 +0100

;     First changes for macOS Homebrew.

* Implement Homebrew for MacOS: response to comments on PR#1185

  * .github/workflows/ci-macos.yml (Run test script): renamed to
      "Run test script (without Homebrew)".
    (Run test script (with Homebrew)): added 'eval $(brew shellenv)' before
      running the test script, so that HOMEBREW_PREFIX gets defined.
  * src/alire/alire-origins-deployers-system-homebrew.adb
    (Homebrew_Prefix, Homebrew_Present): removed.
    (Get_Info): named the declare block. Removed commented-out exception
      handler.
    (Already_Installed): use Get_Info's returned Installed_Version's length
      to determine the result.
    (Detect): Get_Version_From_String uses Semantic_Versioning.Parse.
        Don't check for Homebrew_Present, it has to be or we wouldn't be
        called.
  * src/alire/alire-platforms.ads (Distributions): rename MacOS to Homebrew.
    (Distro_Manager): likewise.
  * src/alire/alire-utils-tools.adb (System_Package_For_Tool): MacOS (in
      'case Distribution)' changed to Homebrew.
  * src/alire/os_macos/alire-platforms-current__macos.adb
    (Homebrew_Prefix): new, gets the environment variable "HOMEBREW_PREFIX".
    (Homebrew_Present): new, true if the environment variable is present.
    (Detected_Distribution): checks Homebrew_Present, returns Homebrew
      or Distro_Unknown accordingly.
    (Distribution_Root): returns Homebrew_Prefix if present, otherwise "/".
  * testsuite/drivers/helpers.py (distribution()): if on macOS, return
      HOMEBREW if HOMEBREW_PREFIX is found, DISTRO_UNKNOWN otherwise.

* Remove improper pragma in response to comment on #1185

  * src/alire/alire-origins-deployers-system-homebrew.adb: removed
      the innefective pragma Warnings (Off).

* Merging with openSUSE changes in #1173.

  * src/alire/alire-origins-deployers-system.adb: added Homebrew option.
  * src/alire/alire-platforms.ads: likewise.
  * src/alire/alire-utils-tools.adb: likewise.

Co-authored-by: John Serock <1468970+serock@users.noreply.github.com>
Co-authored-by: GHA <actions@github.com>
3 years agoAllow missing configuration values until build (#1167)
Alejandro R Mosteo [Thu, 22 Sep 2022 10:29:52 +0000 (12:29 +0200)]
Allow missing configuration values until build (#1167)

* Allow missing configuration values until build

* Do not generate files on incomplete config

* Crate_Configuration: refactor .Map to .Var_Map

Co-authored-by: GHA <actions@github.com>
3 years agoSupport openSUSE and SUSE distributions (#1173)
John Serock [Wed, 21 Sep 2022 16:23:31 +0000 (12:23 -0400)]
Support openSUSE and SUSE distributions (#1173)

* Support zypper package manager

* Support openSUSE and SUSE distributions

3 years agoHelp: reorganize commands and simplify descriptions (#1180)
onox [Mon, 19 Sep 2022 14:07:12 +0000 (16:07 +0200)]
Help: reorganize commands and simplify descriptions (#1180)

* Move some commands to Crate or Internal group

Fixes: #1138
* Use imperative mood and simplify descriptions of several commands

* Rename group "Internal" to "Testing" and adjust label of command "show"

3 years agoUse release build when `alr get --build`ing. (#1169)
Alejandro R Mosteo [Wed, 14 Sep 2022 08:15:26 +0000 (10:15 +0200)]
Use release build when `alr get --build`ing. (#1169)

This will also make `alr test` to use release builds, which is what we want as
submitted crates are tested in release mode.

Co-authored-by: GHA <actions@github.com>
3 years agoFail test if complain_on_error=False but no error (#1171)
Alejandro R Mosteo [Wed, 14 Sep 2022 07:54:44 +0000 (09:54 +0200)]
Fail test if complain_on_error=False but no error (#1171)

This removes the need to assert that the expected failure indeed happened, and
hardens tests against situations where is unclear if an error should happen.

3 years ago`alr show --dependents` to show which crates have another as a dependency (#1170)
Alejandro R Mosteo [Wed, 14 Sep 2022 07:53:53 +0000 (09:53 +0200)]
`alr show --dependents` to show which crates have another as a dependency (#1170)

* `alr show --dependents` to show direct dependencies

Show all crates that directly depend on a given release

* Allow showing indirect dependents too

* Improved --dependents switch

* Improved ordering

* New test for `alr with --dependents`

* Add user visible changes entry

Co-authored-by: GHA <actions@github.com>
3 years agoRemove too strict check for root manifest reload (#1168)
Alejandro R Mosteo [Wed, 14 Sep 2022 07:49:45 +0000 (09:49 +0200)]
Remove too strict check for root manifest reload (#1168)

* Remove too strict check for root manifest reload

Since we are using absolute paths all around, that check is no longer
necessary.

Add a test for this situation, which should work besides the warning.

* Self-review fixes

Co-authored-by: GHA <actions@github.com>
3 years agoDocument steps to carry out during a release (#1162)
Alejandro R Mosteo [Tue, 13 Sep 2022 12:10:04 +0000 (14:10 +0200)]
Document steps to carry out during a release (#1162)

* Document steps to carry out during a release

Memory flaky

* Add index.toml step

Co-authored-by: GHA <actions@github.com>
3 years agoAllow package removal by `apt` with --force (#1165)
Alejandro R Mosteo [Tue, 13 Sep 2022 12:08:34 +0000 (14:08 +0200)]
Allow package removal by `apt` with --force (#1165)

* Allow package removal by apt with --force

* Propagate --force during `alr test`

* New test for default `alr test` get&build

* Self-review fixes

* Relax syntax in prototype for older python

3 years agoFix copy/paste error (#1179)
Maxim Reznik [Mon, 12 Sep 2022 10:51:22 +0000 (13:51 +0300)]
Fix copy/paste error (#1179)

3 years agoBump index version to 1.2.1
GHA [Fri, 26 Aug 2022 15:06:55 +0000 (17:06 +0200)]
Bump index version to 1.2.1

3 years agoRight trim tables (#1166)
Jesper Quorning [Tue, 30 Aug 2022 08:12:44 +0000 (10:12 +0200)]
Right trim tables (#1166)

* Right trim tables

* Adapt testcases

3 years agoAdd support for FreeBSD (#1148)
Stephane Carrez [Fri, 26 Aug 2022 12:51:49 +0000 (14:51 +0200)]
Add support for FreeBSD (#1148)

* Add support for FreeBSD (#22)

* update GNAT project to recognize -XOS=freebsd and configure accordingly
* add FreeBSD as a valid operating system
* add AMD64 as an alias for X86_64 because uname -m returns amd64 on FreeBSD
* add platform specific implementation for FreeBSD

To build on FreeBSD, we should use

gprbuild -j0 -P alr_env -XOS=freebsd

* Fixes requested during code review

Co-authored-by: GHA <actions@github.com>
3 years ago`alr test`: Allow binary releases to not contain project files (#1159)
Alejandro R Mosteo [Fri, 26 Aug 2022 08:34:05 +0000 (10:34 +0200)]
`alr test`: Allow binary releases to not contain project files (#1159)

* Allow binary releases to not contain project files

* Fix logic and output to test log instead of stdout