Skip to content

Commit

Permalink
Self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jul 23, 2024
1 parent 49b93ee commit 23c8525
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 22 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,18 @@ jobs:
with:
submodules: true

- name: OS information for ${{ matrix.tag }}
uses: mosteo-actions/docker-run@v2
with:
image: ghcr.io/alire-project/docker/gnat:${{matrix.tag}}
command: |
lsb_release -a || \
cat /etc/os-release || \
cat /etc/system-release || \
echo "No lsb_release information"
- name: Run test script (${{ matrix.tag }})
uses: mosteo-actions/docker-run@v1
uses: mosteo-actions/docker-run@v2
with:
image: ghcr.io/alire-project/docker/gnat:${{matrix.tag}}
command: scripts/ci-github.sh
Expand Down
5 changes: 3 additions & 2 deletions alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ windows = { ALIRE_OS = "windows" }

# Some dependencies require precise versions during the development cycle:
[[pins]]

[pins.aaa]
url = "https://github.com/mosteo/aaa"
commit = "0c3b440ac183c450345d4a67d407785678779aae"
Expand All @@ -60,15 +61,15 @@ commit = "da4e59c382ceb0de6733d571ecbab7ea4919b33d"

[pins.c_strings]
url = "https://github.com/mosteo/cstrings"
commit = "e5b1931d47b9fee273177773fb5e3f8979bc6076"
commit = "e4d58ad90bf32bc44304197e5906a519f5a9a7bf"

[pins.clic]
url = "https://github.com/alire-project/clic"
commit = "56bbdc008e16996b6f76e443fd0165a240de1b13"

[pins.den]
url = "https://github.com/mosteo/den"
commit = "1f0fe7df0e479e1bf86edd607ffea6bfddb9352e"
commit = "a277b897c346e1ba326233b654354ff91ab93de0"

[pins.dirty_booleans]
url = "https://github.com/mosteo/dirty_booleans"
Expand Down
2 changes: 1 addition & 1 deletion deps/cstrings
Submodule cstrings updated 1 files
+5 −0 c_strings.gpr
2 changes: 1 addition & 1 deletion deps/den
19 changes: 16 additions & 3 deletions scripts/ci-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ echo GNAT VERSION:
gnatls -v
echo ............................

echo ALR VERSION:
alr version
echo "ALR VERSION (at $(which alr)):"
ls -alF bin
chmod +x bin/alr*
alr -d version || \
alr -vv -d version || \
bin/alr -d version || \
bin/alr.exe -d version || true
echo ............................

# Set up index if not default:
Expand All @@ -61,9 +66,17 @@ if [ "${INDEX:-}" != "" ]; then
alr index --name default --add "$INDEX"
fi

echo "ALR SETTINGS (global):"
alr settings --global

echo ALR SEARCH:
# List releases for the record
alr -q -d search --list --external
alr -q -d search --list --external || \
{
echo "Failed to list releases, retrying verbosely..."
alr -vv -d search --list --external
exit 1;
}
echo ............................

echo TESTSUITE:
Expand Down
12 changes: 7 additions & 5 deletions src/alire/alire-directories.adb
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ package body Alire.Directories is
return Any_Path
is
begin
return AAA.Directories.Relative_Path (Parent, Child);
return AAA.Directories.Relative_Path
(Den.Absnormal (Den.Scrub (Parent)),
Den.Absnormal (Den.Scrub (Child)));
end Find_Relative_Path;

----------------------
Expand Down Expand Up @@ -806,8 +808,8 @@ package body Alire.Directories is
Remove_From_Source : Boolean)
is

Base : constant Absolute_Path := Adirs.Full_Name (Src);
Target : constant Absolute_Path := Adirs.Full_Name (Dst);
Base : constant Absolute_Path := Den.Absolute (Src);
Target : constant Absolute_Path := Den.Absolute (Dst);

-----------
-- Merge --
Expand All @@ -818,14 +820,14 @@ package body Alire.Directories is
Stop : in out Boolean)
is
use all type Den.Kinds;
Src : constant Absolute_Path := Den.Absolute (Item);
Rel_Path : constant Relative_Path :=
Find_Relative_Path (Base, Den.Absolute (Item));
Find_Relative_Path (Base, Src);
-- If this proves to be too slow, we should do our own recursion,
-- building the relative path along the way, as this is recomputing
-- it for every file needlessly.

Dst : constant Absolute_Path := Target / Rel_Path;
Src : constant Absolute_Path := Den.Absolute (Item);
begin
Stop := False;

Expand Down
6 changes: 2 additions & 4 deletions src/alire/alire-os_lib.ads
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,15 @@ private

function To_Portable (Path : Any_Path)
return Portable_Path_Like
is (case GNATCOLL.OS.Constants.OS is
when MacOS | Unix => Path,
when Windows => Replace (Path, "\", "/"));
is (Replace (Path, "\", "/"));

--------------------
-- To_Native_Like --
--------------------

function To_Native (Path : Portable_Path_Like) return Native_Path_Like
is (case GNATCOLL.OS.Constants.OS is
when MacOS | Unix => Path,
when MacOS | Unix => Replace (String (Path), "\", "/"),
when Windows => Replace (String (Path), "/", "\"));

end Alire.OS_Lib;
12 changes: 8 additions & 4 deletions src/alire/alire-roots.adb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ with Alire.Toolchains.Solutions;
with Alire.User_Pins.Maps;
with Alire.Utils.TTY;
with Alire.Utils.User_Input;
with Alire.VFS;

with Den;

Expand Down Expand Up @@ -1256,10 +1257,13 @@ package body Alire.Roots is
begin
if Opt.Is_Valid then
Found.Insert
(TTY.URL (Directories.Find_Relative_Path
(Starting_Path, Den.Full_Name (Item))) & "/"
& Opt.Value.Release.Constant_Reference.Milestone.TTY_Image
& ": " & TTY.Emph
(TTY.URL (String (VFS.To_Portable
(Directories.Find_Relative_Path
(Starting_Path, Den.Full_Name (Item))))
& "/"
& Opt.Value.Release.Constant_Reference.Milestone.TTY_Image)
& ": "
& TTY.Emph
(if Opt.Value.Release.Constant_Reference.Description /= ""
then Opt.Value.Release.Constant_Reference.Description
else "(no description)"));
Expand Down
4 changes: 3 additions & 1 deletion testsuite/tests/install/softlinks/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Test that binary files containing softlinks can be installed properly. The test
crate contains all kinds of pernicious links (broken, recursive, etc.):
crate contains all kinds of pernicious links (broken, recursive, etc.).
This test is Unix-only, as Windows' tar cannot recreate the broken links:
crate/
├── bin -> subdir/bin
Expand Down
2 changes: 2 additions & 0 deletions testsuite/tests/install/softlinks/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
driver: python-script
control:
- [SKIP, "skip_unix", "Test is Unix-only"]
indexes:
my_index:
in_fixtures: false

0 comments on commit 23c8525

Please sign in to comment.