Skip to content

Commit

Permalink
Merge remote-tracking branch 'alire/master' into doc-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Feb 27, 2024
2 parents baa9f5e + dea1d18 commit efd9aec
Show file tree
Hide file tree
Showing 200 changed files with 2,852 additions and 769 deletions.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Checklist**

- [ ] I've included the output of `alr version`.
- [ ] I've included complete steps to reproduce my issue.

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Run '...'
3. See error

**Expected Behavior**
Describe what happened and how it deviates from what should have happened, if unclear from the previous steps.

**`alr` version**
Paste here the output of `alr version`.

**`alr` logs**
If pertinent, paste the output of `alr -vv -d <your command>` here.
81 changes: 81 additions & 0 deletions .github/workflows/ci-community.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI Community
# Check proper build using the community edition of the AdaCore toolchain

on:
pull_request:
paths-ignore:
- 'doc/**'
- '**.md'
- '**.rst'
- '**.txt'
workflow_dispatch:

jobs:

build:
name: ce${{matrix.version}} on ${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false # Attempt to generate as many of them as possible
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
version:
- 2020
- 2021
exclude:
- os: macos-latest
version: 2021 # it was never released for macOS

steps:
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: true

# Until some stable alr with `alr install` is available, we cannot rely on
# the alr-install action, as that introduces a circular dependency. If a
# nightly build were to fail, there's no way to do an `alr install` anymore
# TODO: replace with `alr-install` once alr 2.0 is out.

# We cannot use variable names in the action reference, so we need to make
# them explicit twice
- name: Install Community 2020 toolchain
uses: ada-actions/toolchain@ce2020
if: ${{ matrix.version == '2020' }}
with:
distrib: community

- name: Install Community 2021 toolchain
uses: ada-actions/toolchain@ce2021
if: ${{ matrix.version == '2021' }}
with:
distrib: community

- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Run test script
run: scripts/ci-github.sh
shell: bash

- name: Upload logs (if failed)
if: failure()
uses: actions/upload-artifact@master
with:
name: e3-log-linux.zip
path: testsuite/out

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: alr-bin-${{ matrix.os }}.zip
path: |
bin/alr*
LICENSE.txt
1 change: 1 addition & 0 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI Docker
# Check builds on supported Linux distributions

on:
pull_request:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ jobs:

build:

name: ${{ matrix.os }}
name: ${{ matrix.os }} gcc^${{ matrix.gcc_version }}

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
gcc_version:
- 10
- 11
- 12
- 13

steps:
- name: Check out
Expand All @@ -36,7 +42,7 @@ jobs:
- name: Install FSF toolchain
uses: alire-project/alr-install@v1
with:
crates: gnat_native gprbuild
crates: gnat_native^${{matrix.gcc_version}} gprbuild

- name: Build alr with default toolchain
shell: bash
Expand All @@ -54,8 +60,10 @@ jobs:
run: ./bin/alr -d -n printenv || ./bin/alr -n -v -d printenv

- shell: bash
run: mv ./bin ./bin-old
# Windows doesn't allow to replace a running exe so the next command fails otherwise
run: mv ./bin ./bin-old || { sleep 5s && mv ./bin ./bin-old; }
# Windows doesn't allow to replace a running exe so the next command
# fails otherwise. Also, this mv fails sometimes so we try twice JIC.


- name: SELF-BUILD
run: ./bin-old/alr -d -n build
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: ./bin/alr --non-interactive help get

- name: install tar from msys2 (Git tar in Actions VM does not seem to work)
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S tar
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S tar

- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
Expand All @@ -57,17 +57,17 @@ jobs:
run: gprinstall -p -P alr_env --prefix=${{ runner.temp }}/alr_install

- name: Install qt-installer-framework in msys2
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S mingw64/mingw-w64-x86_64-qt-installer-framework
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S mingw64/mingw-w64-x86_64-qt-installer-framework

- name: Add msys2 /mingw64/bin to the path (for qt-installer-framework)
run: echo 'C:\Users\runneradmin\.cache\alire\msys64\mingw64\bin' >> $GITHUB_PATH
run: echo 'C:\Users\runneradmin\AppData\Local\alire\msys64\mingw64\bin' >> $GITHUB_PATH
shell: bash

- name: Install zip in msys2
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S zip
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S zip

- name: Add msys2 /usr/bin to the path (for zip)
run: echo 'C:\Users\runneradmin\.cache\alire\msys64\usr\bin' >> $GITHUB_PATH
run: echo 'C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin' >> $GITHUB_PATH
shell: bash

- name: Run installer build script
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tarball-full.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Full sources
# Create a tarball that includes everything necessary for building,
# particularly 3rd party dependencies in submodules which are not included in
# GitHub automatic source tarballs.

on:
release:
Expand Down
9 changes: 9 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Log of breaking changes in index or alr.

### alr 2.0.0 + index 1.2.2

### alr 1.2.2 + index 1.2.1

- Unable to load externals containing regex special characters in the system
package name (fixed in #1545).
- Paths in `[environment]` are not converted to the native platform convention.
41 changes: 41 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Upgrading from 1.x to 2.x

There are no special preparations to be made in advance to upgrading. However,
please check out the following information.

### Obsolete large folders

Changes in default storage locations mean that the following folders, if
existing, can be safely deleted to retrieve disk space:

- `<userdir>/.cache/alire`
- `<userdir>/.config/alire/cache`

On Windows, `<userdir>` stands for `%UserProfile%`, whereas for other OSes it
stands for `$HOME`.

Also, `alr 2.x` defaults to shared builds, meaning that local workspace
caches can also be removed at

- `<crate>/alire/cache/dependencies`

### New features in 2.x

Please find all user-facing changes at our [User Changes log
file](https://github.com/alire-project/alire/blob/master/doc/user-changes.md).

## Downgrading to an earlier version

This is not a recommended nor supported operation, as changes in storage of configuration and
other resources may make a downgrade prone to failure.

If you want to have a fallback to be able to downgrade, you have two safe
options:

- Use the newer version with its own separate configuration storage. You can override
the default location by providing a new path in the `ALR_CONFIG` environment
variable.

- Keep a backup of your current configuration at the default location, which is
`.config/alire` within your user's home. You can restore this folder in sync with
its older `alr` version.
11 changes: 6 additions & 5 deletions alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ minirest = "~0.3"
optional = "~0.1"
semantic_versioning = "^3.0"
simple_logging = "^2.0"
si_units = "~0.2"
si_units = "~0.2.2"
stopwatch = "~0.1"
toml_slicer = "~0.1"
uri_ada = "^2.0"
Expand All @@ -47,13 +47,14 @@ windows = { ALIRE_OS = "windows" }

# Some dependencies require precise versions during the development cycle:
[[pins]]
aaa = { url = "https://github.com/mosteo/aaa", commit = "ecc38772bd4a6b469b54c62363766ea1c0e9f912" }
aaa = { url = "https://github.com/mosteo/aaa", commit = "dff61d2615cc6332fa6205267bae19b4d044b9da" }
ada_toml = { url = "https://github.com/mosteo/ada-toml", commit = "da4e59c382ceb0de6733d571ecbab7ea4919b33d" }
clic = { url = "https://github.com/alire-project/clic", commit = "de0330053584bad4dbb3dbd5e1ba939c4e8c6b55" }
dirty_booleans = { url = "https://github.com/mosteo/dirty_booleans", branch = "main" }
diskflags = { url = "https://github.com/mosteo/diskflags", branch = "main" }
clic = { url = "https://github.com/alire-project/clic", commit = "56bbdc008e16996b6f76e443fd0165a240de1b13" }
dirty_booleans = { url = "https://github.com/mosteo/dirty_booleans", branch = "alire" }
diskflags = { url = "https://github.com/mosteo/diskflags", branch = "alire" }
gnatcoll = { url = "https://github.com/alire-project/gnatcoll-core.git", commit = "4e663b87a028252e7e074f054f8f453661397166" }
minirest = { url = "https://github.com/mosteo/minirest.git", commit = "9a9c660f9c6f27f5ef75417e7fac7061dff14d78" }
semantic_versioning = { url = "https://github.com/alire-project/semantic_versioning", commit = "2f23fc5f6b4855b836b599adf292fed9c0ed4144" }
simple_logging = { url = "https://github.com/alire-project/simple_logging", commit = "3505dc645f3eef6799a486aae223d37e88cfc4d5" }
si_units = { url = "https://github.com/mosteo/si_units", branch = "alire" }
stopwatch = { url = "https://github.com/mosteo/stopwatch", commit = "f607a63b714f09bbf6126de9851cbc21cf8666c9" }
19 changes: 18 additions & 1 deletion alire_common.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ abstract project Alire_Common is
when "disabled" => Style_Check_Switches := ();
end case;

type Any_Experimental_Ada_Features is ("enabled", "disabled");
Experimental_Ada_Features : Any_Experimental_Ada_Features :=
external ("ALIRE_EXPERIMENTAL_ADA_FEATURES", "disabled");
-- These should only be enabled temporarily to help with debugging.
-- Production builds are always checked with these disabled.

Experimental_Ada_Switches := ();
case Experimental_Ada_Features is
when "enabled" => Experimental_Ada_Switches :=
("-gnat2022",
"-gnatx",
"-gnatwJ" -- Disable warnings about obsolescent "()"
);
when "disabled" => Experimental_Ada_Switches := ();
end case;

Ada_Common_Switches :=
( "-gnatW8" -- use UTF-8 Encoding for Source Files
, "-s" -- Recompile if compiler Switches Have Changed
Expand All @@ -58,7 +74,8 @@ abstract project Alire_Common is

-- Enable all warnings
"-gnatwa")
& Style_Check_Switches;
& Style_Check_Switches
& Experimental_Ada_Switches;

for Default_Switches ("C") use ("-g", "-O0", "-Wall");
-- Likewise for C units
Expand Down
2 changes: 1 addition & 1 deletion deps/aaa
2 changes: 1 addition & 1 deletion deps/clic
2 changes: 1 addition & 1 deletion deps/diskflags
Submodule diskflags updated 1 files
+1 −1 src/diskflags.ads
2 changes: 1 addition & 1 deletion deps/si_units
20 changes: 20 additions & 0 deletions doc/catalog-format-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ static, i.e. they cannot depend on the context.
PATH.append = "${DISTRIB_ROOT}/usr/bin"
```

Path fragments in this table must use portable format, that is, '/' for path
separation. Alire will take care of using the native separator when setting
these variables.

Predefined variables are provided by Alire and will be replaced in the
value:

Expand All @@ -325,6 +329,9 @@ static, i.e. they cannot depend on the context.
be the `msys2` installation directory (e.g.
`C:\Users\user_name\.cache\alire\msys2`).

The escaping `"\$"` can be used to prevent the expansion of a
dollar-bracketed expression.

Environment entries can use dynamic expressions:

```toml
Expand Down Expand Up @@ -455,6 +462,12 @@ static, i.e. they cannot depend on the context.
several crates from the same repository (sometimes referred to as a
*monorepo*).

- `binary`: optional (defauts to false) boolean used to design the origin
as binary. Binary origins are not compiled and can use dynamic
expressions to narrow down the platform to which they apply. An origin
using a dynamic expression is implicitly tagged as binary; see the
example below.

Examples of origin tables:

```toml
Expand All @@ -479,6 +492,13 @@ static, i.e. they cannot depend on the context.
subdir = "examples"
```

```toml
# A binary origin denoting a compiler
[origin."case(os)".linux."case(host-arch)".x86-64]
url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.1.0-1/gnat-x86_64-linux-12.1.0-1.tar.gz"
hashes = ["sha256:df1f36b306359d528799b1de8629a793523347a90c9d4b72efd23c62a7279555"]
```

- `available`: optional dynamic boolean expression. If it evaluates to
`false`, the package is not available for the current platform.

Expand Down
Loading

0 comments on commit efd9aec

Please sign in to comment.