Alire issue with directories causing exception

Has anyone seen this?

$ alr index --reset-community
Cloning into '/home/laguest/.config//alire/indexes/community/repo'...
remote: Enumerating objects: 15702, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 15702 (delta 51), reused 44 (delta 23), pack-reused 15612 (from 2)
Receiving objects: 100% (15702/15702), 3.34 MiB | 27.54 MiB/s, done.
Resolving deltas: 100% (8668/8668), done.
error: Dynamic_Predicate failed at alire-directories.adb:407
error: alr encountered an unexpected error, re-run with -d for details.
error: error location: 0x11288af System.Assertions.Raise_Assert_Failure at s-assert.adb:44

I get the same error with alr toolchain --select

$ alr version
APPLICATION
alr version:               2.1.0
libalire version:          2.1.0
source commit:             2681b313d08224014fa3f5e4f76e9c75347213d2
source changes:            clean
compilation date:          2025-03-04 10:20:58
compiled with version:     14.2.0

CONFIGURATION
home folder:               /home/laguest
settings folder:           /home/laguest/.config//alire
cache folder:              /home/laguest/.local/share//alire
vault folder:              /home/laguest/.local/share//alire/releases
build folder:              /home/laguest/.local/share//alire/builds
temp folder:               /run/user/1000
force flag:                FALSE
non-interactive flag:      FALSE
community index branch:    stable-1.4.0
compatible index versions: ^1.1 & <=1.4.0
indexes folder:            /home/laguest/.config//alire/indexes
indexes metadata:          OK
toolchain folder:          /home/laguest/.local/share//alire/toolchains
toolchain assistant:       enabled
tool #1 gnat:              not configured
tool #2 gprbuild:          not configured
system package manager:    not found: unknown package manager
distro detection disabled: FALSE

WORKSPACE
root status:               OUTSIDE
root release:              N/A
root load error:           N/A
root folder:               N/A
current folder:            /home/laguest

SYSTEM
distribution:              DISTRIBUTION_UNKNOWN
host-arch:                 X86_64
os:                        LINUX
target:                    NATIVE
toolchain:                 USER
word-size:                 BITS_64

There is no index, it can’t download it for some reason.

Could you rerun your first issue with -d? I may be able to look into it.

Did you change something? I’m not able to understand why you have ā€œ//ā€ in /home/laguest/.config//alire/indexes/community/repo

Better yet. Open an issue on the alire github Issues Ā· alire-project/alire Ā· GitHub

ta.

$ alr -d index --reset-community
Cloning into '/home/laguest/.config//alire/indexes/community/repo'...
remote: Enumerating objects: 15702, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 15702 (delta 51), reused 44 (delta 23), pack-reused 15612 (from 2)
Receiving objects: 100% (15702/15702), 3.34 MiB | 28.23 MiB/s, done.
Resolving deltas: 100% (8668/8668), done.
stderr: ADA.ASSERTIONS.ASSERTION_ERROR
stderr: Dynamic_Predicate failed at alire-directories.adb:407
stderr: raised ADA.ASSERTIONS.ASSERTION_ERROR : Dynamic_Predicate failed at alire-directories.adb:407
[/home/laguest/opt/bin/alr]
0x11288af System.Assertions.Raise_Assert_Failure at s-assert.adb:44
0x7d8b02 Alire.Directories.Find_Files_Under at alire-directories.adb:407
0x99f62b Alire.Index_On_Disk.Verify at alire-index_on_disk.adb:320
0x99a5c0 Alire.Index_On_Disk.Add_With_Metadata at alire-index_on_disk.adb:65
0x98bd2b Alire.Index_On_Disk.Loading.Add at alire-index_on_disk-loading.adb:180
0x98eb8f Alire.Index_On_Disk.Loading.Add_Or_Reset_Community.Actually_Add at alire-index_on_disk-loading.adb:205
0x98e5f0 Alire.Index_On_Disk.Loading.Add_Or_Reset_Community at alire-index_on_disk-loading.adb:240
0x4b3257 Alr.Commands.Index.Reset_Community at alr-commands-index.adb:225
0x4b19c1 Alr.Commands.Index.Execute at alr-commands-index.adb:127
0x4b1a7d Alr.Commands.Index.Execute at alr-commands-index.adb:84
0x53bbcc Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:749
0x5472be Alr.Commands.Execute at alr-commands.adb:632
0x43d48a Alr.Main at alr-main.adb:13
0x4403a3 Main at b__alr-main.adb:2445
[/usr/lib64/libc.so.6]
0x7fe4bbb7f46c
0x7fe4bbb7f589
[/home/laguest/opt/bin/alr]
0x43d323 _start at ???
0xfffffffffffffffe

error: Dynamic_Predicate failed at alire-directories.adb:407
error: alr encountered an unexpected error, re-run with -d for details.
error: error location: 0x11288af System.Assertions.Raise_Assert_Failure at s-assert.adb:44

I don’t know how you did it but having two ā€œ//ā€ in the file path throws off alire. Specifically Dens assumption that a filepath cannot be empty and only has one ā€œ/ā€ per directory depth.

(I’ll have to see if I have enough time to recreate this with alire master)

Maybe try to remove the index with alr index --del=community and then alr index --reset-community

Yeah, I noticed the ā€˜//’

This only does this on the latest alr, on 1.3.0 it’s fine.

There is no index to delete.

The latest alire release is 2.1.1 The website hasn’t been updated but on the github release page you can download your version.

It may already be fixed since then have been a few den updates.

I also recently had a problem with alr (v2.1.0) that it could not update the index anymore. I don’t remember the details of the error messages, however.
The solution was to manually remove the community index (rm -rf ~/.config/alire/indexes/community) and to download it again (alr index --reset-community)

Yeah, I tried that by moving both the ~/.config/alire and the ~/.local/share/alire dirs and trying again, same issue.,

Downloaded 2.1.1.

I tried to remove the old directories, seems it didn’t create one inside ~/.local

$ rm -rf ~/.config/alire ~/.local/share/alire.old/
$ alr -d index --reset-community
Cloning into '/home/laguest/.config//alire/indexes/community/repo'...
remote: Enumerating objects: 15702, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 15702 (delta 51), reused 44 (delta 23), pack-reused 15612 (from 2)
Receiving objects: 100% (15702/15702), 3.34 MiB | 24.22 MiB/s, done.
Resolving deltas: 100% (8668/8668), done.
stderr: ADA.ASSERTIONS.ASSERTION_ERROR
stderr: Dynamic_Predicate failed at alire-directories.adb:409
stderr: raised ADA.ASSERTIONS.ASSERTION_ERROR : Dynamic_Predicate failed at alire-directories.adb:409
Load address: 0x557c1bc91000
[/home/laguest/opt/bin/alr]
0x557c1cb00931 System.Assertions.Raise_Assert_Failure at s-assert.adb:44
0x557c1c1638bb Alire.Directories.Find_Files_Under at alire-directories.adb:409
0x557c1c32fb49 Alire.Index_On_Disk.Verify at alire-index_on_disk.adb:320
0x557c1c32a5c3 Alire.Index_On_Disk.Add_With_Metadata at alire-index_on_disk.adb:65
0x557c1c31cb57 Alire.Index_On_Disk.Loading.Add at alire-index_on_disk-loading.adb:180
0x557c1c31d8ab Alire.Index_On_Disk.Loading.Add_Or_Reset_Community.Actually_Add at alire-index_on_disk-loading.adb:205
0x557c1c31e420 Alire.Index_On_Disk.Loading.Add_Or_Reset_Community at alire-index_on_disk-loading.adb:240
0x557c1be39bb4 Alr.Commands.Index.Reset_Community at alr-commands-index.adb:225
0x557c1be38492 Alr.Commands.Index.Execute at alr-commands-index.adb:127
0x557c1be38554 Alr.Commands.Index.Execute at alr-commands-index.adb:84
0x557c1bec083a Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:749
0x557c1becbbda Alr.Commands.Execute at alr-commands.adb:680
0x557c1bdbc32d Alr.Main at alr-main.adb:13
0x557c1bdbf273 Main at b__alr-main.adb:2448
[/usr/lib64/libc.so.6]
0x7f7e1ba5346c
0x7f7e1ba53589
[/home/laguest/opt/bin/alr]
0x557c1bdbc1b3 _start at ???
0xfffffffffffffffe

error: Dynamic_Predicate failed at alire-directories.adb:409
error: alr encountered an unexpected error, re-run with -d for details.
error: error location: [/home/laguest/opt/bin/alr]
$ ls ~/.config/alire
indexes  settings.toml
$ ls ~/.config/alire/indexes/

So, it got a bit further in creating the indexes directory.

Here’s the gdb log:

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/laguest/opt/bin/alr "-d index --reset-community"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".

Catchpoint 1, ADA.IO_EXCEPTIONS.END_ERROR (s-stratt.adb:235) at <__gnat_debug_raise_exception> (
    e=0x5555568f0420 <ada.io_exceptions.end_error>, message=...) at s-excdeb.adb:38
38      in s-excdeb.adb
(gdb) bt
#0  <__gnat_debug_raise_exception> (e=0x5555568f0420 <ada.io_exceptions.end_error>, message=...)
    at s-excdeb.adb:38
#1  0x000055555637b8d8 in ada.exceptions.complete_occurrence (x=x@entry=0x555556924230)
    at a-except.adb:1125
#2  0x000055555637b8e7 in ada.exceptions.complete_and_propagate_occurrence (x=x@entry=0x555556924230)
    at a-except.adb:1136
#3  0x000055555637b93c in <__gnat_raise_exception> (e=0x5555568f0420 <ada.io_exceptions.end_error>, 
    message=...) at a-except.adb:1173
#4  0x00005555563e60d9 in system.stream_attributes.i_c (stream=<optimized out>) at s-stratt.adb:235
#5  0x0000555556320313 in toml.file_io.get (stream=0x5555569225d0, eof=false, byte=10 '["0a"]')
    at /home/runner/work/alire/alire/deps/ada-toml/src/toml-file_io.adb:37
#6  0x000055555630b1e7 in toml.file_io.parse_file.read_codepoint ()
    at /home/runner/work/alire/alire/deps/ada-toml/src/toml-generic_parse.adb:449
#7  0x000055555630ba07 in toml.file_io.parse_file.read_token (key_expected=true)
    at /home/runner/work/alire/alire/deps/ada-toml/src/toml-generic_parse.adb:609
#8  0x000055555631501f in toml.file_io.parse_file.parse_line ()
    at /home/runner/work/alire/alire/deps/ada-toml/src/toml-generic_parse.adb:2228
#9  0x000055555630a0cd in toml.file_io.parse_file (stream=0x5555569225d0)
    at /home/runner/work/alire/alire/deps/ada-toml/src/toml-generic_parse.adb:2723
#10 0x00005555563204c8 in toml.file_io.load_file (filename=...)
    at /home/runner/work/alire/alire/deps/ada-toml/src/toml-file_io.adb:71
#11 0x000055555621a565 in clic.config.load.load_toml_file ()
#12 0x000055555621a8b6 in clic.config.load.from_toml ()
#13 0x0000555555ef7421 in alire.settings.edit.load_settings ()
    at /home/runner/work/alire/alire/src/alire/alire-settings-edit.adb:194
#14 0x0000555555ef49f9 in alire.settings.edit.early_load.load_settings ()
    at /home/runner/work/alire/alire/src/alire/alire-settings-edit-early_load.adb:9
#15 0x0000555555ef4a05 in <alire__settings__edit__early_load___elabb> ()
    at /home/runner/work/alire/alire/src/alire/alire-settings-edit-early_load.adb:13
--Type <RET> for more, q to quit, c to continue without paging--up
#16 0x00005555556816be in adainit () at b__alr-main.adb:2125
#17 0x0000555555682270 in main (argc=2, argv=0x7fffffffd108, envp=0x7fffffffd120) at b__alr-main.adb:2447
#18 0x00007ffff7a5346e in ?? () from /usr/lib64/libc.so.6
#19 0x00007ffff7a5358b in __libc_start_main () from /usr/lib64/libc.so.6
#20 0x000055555567f1b5 in _start ()

It’s stopping due to a line feed.

could you give me the output of cat ~/.config/alire/settings.toml ?

It seams like alire had an issue reading the config file

It started with the default version that it creates:

$ rm -rf ~/.config/alire/
$ alr -d index --reset-community
Cloning into '/home/laguest/.config//alire/indexes/community/repo'...
remote: Enumerating objects: 15702, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 15702 (delta 51), reused 44 (delta 23), pack-reused 15612 (from 2)
Receiving objects: 100% (15702/15702), 3.34 MiB | 16.04 MiB/s, done.
Resolving deltas: 100% (8668/8668), done.
stderr: ADA.ASSERTIONS.ASSERTION_ERROR
stderr: Dynamic_Predicate failed at alire-directories.adb:409
stderr: raised ADA.ASSERTIONS.ASSERTION_ERROR : Dynamic_Predicate failed at alire-directories.adb:409
Load address: 0x5628afff6000
[/home/laguest/opt/bin/alr]
0x5628b0e65931 System.Assertions.Raise_Assert_Failure at s-assert.adb:44
0x5628b04c88bb Alire.Directories.Find_Files_Under at alire-directories.adb:409
0x5628b0694b49 Alire.Index_On_Disk.Verify at alire-index_on_disk.adb:320
0x5628b068f5c3 Alire.Index_On_Disk.Add_With_Metadata at alire-index_on_disk.adb:65
0x5628b0681b57 Alire.Index_On_Disk.Loading.Add at alire-index_on_disk-loading.adb:180
0x5628b06828ab Alire.Index_On_Disk.Loading.Add_Or_Reset_Community.Actually_Add at alire-index_on_disk-loading.adb:205
0x5628b0683420 Alire.Index_On_Disk.Loading.Add_Or_Reset_Community at alire-index_on_disk-loading.adb:240
0x5628b019ebb4 Alr.Commands.Index.Reset_Community at alr-commands-index.adb:225
0x5628b019d492 Alr.Commands.Index.Execute at alr-commands-index.adb:127
0x5628b019d554 Alr.Commands.Index.Execute at alr-commands-index.adb:84
0x5628b022583a Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:749
0x5628b0230bda Alr.Commands.Execute at alr-commands.adb:680
0x5628b012132d Alr.Main at alr-main.adb:13
0x5628b0124273 Main at b__alr-main.adb:2448
[/usr/lib64/libc.so.6]
0x7fc2d5b7f46c
0x7fc2d5b7f589
[/home/laguest/opt/bin/alr]
0x5628b01211b3 _start at ???
0xfffffffffffffffe

error: Dynamic_Predicate failed at alire-directories.adb:409
error: alr encountered an unexpected error, re-run with -d for details.
error: error location: [/home/laguest/opt/bin/alr]

$ cat  ~/.config/alire/settings.toml 
[index]
last_update = 284842841

$  hexdump -C  ~/.config/alire/settings.toml 
00000000  5b 69 6e 64 65 78 5d 0a  6c 61 73 74 5f 75 70 64  |[index].last_upd|
00000010  61 74 65 20 3d 20 32 38  34 38 34 32 38 34 31 0a  |ate = 284842841.|
00000020  0a                                                |.|
00000021

I’m getting out of ideas… Could it be that your .config is a symlink or some permission issue?

Nope, I literally deleted it above and re-ran the alr command as above, it created it from scratch as I showed.

$ ls -l  ~/.config/alire/settings.toml 
-rw-r--r-- 1 laguest laguest 33 Jul  2 19:00 /home/laguest/.config/alire/settings.toml
$ ls -ld  ~/.config/alire 
drwxr-xr-x 1 laguest laguest 40 Jul  2 19:00 /home/laguest/.config/alire
$ ldd `which alr`
        linux-vdso.so.1 (0x00007fe2861da000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/15/libstdc++.so.6 (0x00007fe284a00000)
        libm.so.6 => /usr/lib64/libm.so.6 (0x00007fe284cfd000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1 (0x00007fe284cd0000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007fe28482c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe2861dc000)

Building from source works:

$ bin/alr version
APPLICATION
alr version:               3.0.0-dev
libalire version:          3.0.0-dev
source commit:             unknown
source changes:            unknown
compilation date:          2026-07-02 19:14:38
compiled with version:     15.3.0

CONFIGURATION
home folder:               /home/laguest
settings folder:           /home/laguest/.config/alire
cache folder:              /home/laguest/.local/share/alire
vault folder:              /home/laguest/.local/share/alire/releases
build folder:              /home/laguest/.local/share/alire/builds
temp folder:               /run/user/1000
force flag:                FALSE
non-interactive flag:      FALSE
community index branch:    stable-1.4.0
compatible index versions: ^1.1 & <=1.4.0
indexes folder:            /home/laguest/.config/alire/indexes
indexes metadata:          OK
toolchain folder:          /home/laguest/.local/share/alire/toolchains
toolchain assistant:       enabled
tool #1 gnat:              not configured
tool #2 gprbuild:          not configured
system package manager:    /usr/bin/emerge
distro detection disabled: FALSE

WORKSPACE
root status:               VALID
root release:              alr=3.0.0-dev
root load error:           none
root folder:               /home/laguest/src/alire
current folder:            /home/laguest/src/alire

SYSTEM
distribution:              GENTOO
host-arch:                 X86_64
os:                        LINUX
target:                    NATIVE
toolchain:                 SYSTEM
word-size:                 BITS_64
$ ./bin/alr -d index --reset-community
Cloning into '/home/laguest/.config/alire/indexes/community/repo'...
remote: Enumerating objects: 15702, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 15702 (delta 51), reused 44 (delta 23), pack-reused 15612 (from 2)
Receiving objects: 100% (15702/15702), 3.34 MiB | 12.11 MiB/s, done.
Resolving deltas: 100% (8668/8668), done.

does alire2.1 work again after setting the index with alire3?

No,

$ ./bin/alr -d index --reset-community
Cloning into '/home/laguest/.config//alire/indexes/community/repo'...
remote: Enumerating objects: 15702, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 15702 (delta 51), reused 44 (delta 23), pack-reused 15612 (from 2)
Receiving objects: 100% (15702/15702), 3.34 MiB | 29.44 MiB/s, done.
Resolving deltas: 100% (8668/8668), done.
stderr: ADA.ASSERTIONS.ASSERTION_ERROR
stderr: Dynamic_Predicate failed at alire-directories.adb:409
stderr: raised ADA.ASSERTIONS.ASSERTION_ERROR : Dynamic_Predicate failed at alire-directories.adb:409
Load address: 0x55bfeb57d000
[./bin/alr]
0x55bfec3ec931 System.Assertions.Raise_Assert_Failure at s-assert.adb:44
0x55bfeba4f8bb Alire.Directories.Find_Files_Under at alire-directories.adb:409
0x55bfebc1bb49 Alire.Index_On_Disk.Verify at alire-index_on_disk.adb:320
0x55bfebc165c3 Alire.Index_On_Disk.Add_With_Metadata at alire-index_on_disk.adb:65
0x55bfebc08b57 Alire.Index_On_Disk.Loading.Add at alire-index_on_disk-loading.adb:180
0x55bfebc098ab Alire.Index_On_Disk.Loading.Add_Or_Reset_Community.Actually_Add at alire-index_on_disk-loading.adb:205
0x55bfebc0a27a Alire.Index_On_Disk.Loading.Add_Or_Reset_Community at alire-index_on_disk-loading.adb:228
0x55bfeb725bb4 Alr.Commands.Index.Reset_Community at alr-commands-index.adb:225
0x55bfeb724492 Alr.Commands.Index.Execute at alr-commands-index.adb:127
0x55bfeb724554 Alr.Commands.Index.Execute at alr-commands-index.adb:84
0x55bfeb7ac83a Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:749
0x55bfeb7b7bda Alr.Commands.Execute at alr-commands.adb:680
0x55bfeb6a832d Alr.Main at alr-main.adb:13
0x55bfeb6ab273 Main at b__alr-main.adb:2448
[/usr/lib64/libc.so.6]
0x7fb6b4d7f46c
0x7fb6b4d7f589
[./bin/alr]
0x55bfeb6a81b3 _start at ???
0xfffffffffffffffe

error: Dynamic_Predicate failed at alire-directories.adb:409
error: alr encountered an unexpected error, re-run with -d for details.
error: error location: [./bin/alr]

This is ~/bin/alr just unpacked from the 2.1.1 archive, the previous bin was in the alire source directory after building it.

I now really confused… It works on my machine :slightly_frowning_face:

What is the output of cat ~/.config/alire/indexes/community/index.toml ?

$ cat ~/.config/alire/indexes/community/index.toml
name = "community"
priority = 1
url = "git+https://github.com/alire-project/alire-index#stable-1.4.0"

I’ve got a feeling I’ve had this exact issue before but cannot remember what the solution was. But the version from git works, so will use that.