Linux distribution for alire

Hi all!

I’ve been using alire on Windows for some time now, without too many quirks coming up. I’ve alse tested it on a very old laptop that is running Kubuntu 24.04 to find it is surprisingly quick on it. I’d now like to try it out on WSL on my Windows 11 PC, I’ve been using WSL at work and it seems to work quite well.

Since I’m able to choose, what Linux distro would you recommend for working with alire?

Thank you!
Alexis.

I am successfully using various Linux virtual machines under Windows (Debian, Fedora, Ubuntu, CentOS). I installed Alire under Debian and it worked fine. Though I prefer native environment. I too used WSL at work and found it uncomfortable. VirtualBox is IMO better choice. It is easy to backup and transfer to another machine. Then, I usually run several Linux virtual machines at once.

1 Like

I think they run their CI against fedora, ubuntu, and debian. You could probably try and verify the list they test against at the their github repository. It might give you a clearer pictures on the best supported distributions

Hmm, I’ve found this in Alire.Platforms, but it’s not what they test against, right?

type Distributions is (Debian,
Ubuntu,
Msys2,
Arch,
Rhel, – RedHat Enterprise Linux
Centos,
Fedora,
Suse,
Homebrew,
Macports,
Distribution_Unknown);

If you look here, go to the purple merge notice near the end, and click on [View details] you’ll see the currently executed checks for submissions to the Alire index: macos-13, arch-rolling, macos-latest, centos-stream-fsf-latest, ubuntu-latest, debian-stable, windows-latest, fedora-latest, ubuntu-lts (these are Github names for OS releases, and ‘latest’ is whatever Github’s runners are configured to execute).

1 Like

The biggest difference will be on supported system packages. If you go for one of our unsupported or less used distros, you’ll have no (or fewer) system packages immediately available, if you need those.

The distros with more supported system packages will be, I expect, in decreasing order: ubuntu, debian, arch.

You could also check here https://alire-crate-ci.ada.dev/pages/status.html if some crates of special relevance to you are available in the distro you prefer.

1 Like

Thank you all!

I’ve finally had a little time for testing on WSL: I’ve installed the Ubuntu-24.04 distro that WSL says it can install, no problem, then installed alr with A.J.'s GetAda, no problem, then created a hello world project with alr init hello --bin, seemingly no problem. But doing an alr build I get this:

~/work/ada/hello$ alr build
Cloning into '/home/alexis/.config/alire/indexes/community/repo'...
remote: Enumerating objects: 11925, done.
remote: Counting objects: 100% (511/511), done.
remote: Compressing objects: 100% (332/332), done.
remote: Total 11925 (delta 353), reused 198 (delta 174), pack-reused 11414 (from 2)
Receiving objects: 100% (11925/11925), 2.32 MiB | 7.05 MiB/s, done.
Resolving deltas: 100% (6393/6393), done.
ⓘ Alire has selected automatically this toolchain:
   gprbuild=22.0.1
   gnat_native=14.2.1
You can select a different toolchain at any time with `alr toolchain --select`
Download will start now:
Press Enter to continue or Ctrl-C to abort

ⓘ Deploying gprbuild=22.0.1...
################################################################################################################# 100.0%
ⓘ gprbuild=22.0.1 installed successfully.
ⓘ Deploying gnat_native=14.2.1...
################################################################################################################# 100.0%
ⓘ gnat_native=14.2.1 installed successfully.
ⓘ Building hello=0.1.0-dev/hello.gpr...
Setup
   [mkdir]        object directory for project Hello
   [mkdir]        exec directory for project Hello
Compile
   [Ada]          hello.adb
Bind
   [gprbind]      hello.bexch
   [Ada]          hello.ali
Link
   [link]         hello.adb
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ldl: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lc: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
gprbuild: link of hello.adb failed
gprbuild: failed command was: /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/gcc hello.o b__hello.o -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/ -static-libgcc /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/libgnat.a -ldl -Wl,-rpath-link,/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0//adalib -Wl,-z,origin,-rpath,$ORIGIN/..//obj/development:$ORIGIN/../../../..//.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib -o /home/alexis/work/ada/hello/bin//hello
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/alexis/work/ada/hello/hello.gpr"] exited with code 4
error: Compilation failed.

It looks like it’s missing some basic stuff, right? :sweat_smile:

Looking to the end of the lines after [link] hello.adb, there are some very odd missing objects: -ldl, -lc. Those are switches, not objects!

You could try alr build -- -largs -Wl,-v to show what the linker was given, which might be enlightening to someone who knows Ubuntu-24.04.

Another suggestion in the direction of what Simon proposes, try to bypass alr and build something with alr exec -- gprbuild, to see if the problem comes from Alire or directly from the toolchain.

Ubuntu is basically Debian.

For reference, here is how hello is built under Ubuntu 22.04 LTS (so GNAT 11) without Alire:

> gprbuild -v -P hello.gpr
Changing to object directory of "Hello": "/home/dmitry/"
/usr/bin/gnatgcc -c -x ada -gnatA -gnatec=/tmp/GNAT-TEMP-000003.TMP -gnatem=/tmp/GNAT-TEMP-000004.TMP /home/dmitry/hello.adb
/usr/lib/gprbuild/gprbind hello.bexch
/usr/bin/gnatbind -o b__hello.adb /home/dmitry/hello.ali -x -F=/tmp/GNAT-TEMP-000005.TMP -O=/tmp/GNAT-TEMP-000007.TMP
/usr/bin/gnatgcc -c -x ada -gnatA -c -gnatA -gnatWb -gnatiw -gnatws -mtune=generic -march=x86-64 b__hello.adb -o b__hello.o
gnatgcc hello.o b__hello.o -L/home/dmitry/ -L/home/dmitry/ -L/usr/lib/gcc/x86_64-linux-gnu/11/adalib/ -shared-libgcc -lgnat-11 -ldl -Wl,-rpath-link,/usr/lib/gcc/x86_64-linux-gnu/11//adalib -Wl,-z,origin,-rpath,$ORIGIN/:/usr/lib/gcc/x86_64-linux-gnu/11/adalib:/usr/lib64:/usr/lib -o hello

Ok, just out of curiosity I installed Ubuntu 24.10 virtual machine. Then downloaded Alire:

wget https://github.com/alire-project/alire/releases/download/v2.0.2/alr-2.0.2-bin-x86_64-linux.zip

Unzipped it. Installed

alr init hello --bin

Suffered some pointless long question game and finally build it. No issues, except that hello.adb body is null! :rofl:

I modified it, rebuilt again:

alr build
ⓘ Building hello=0.1.0-dev/hello.gpr...
Compile
   [Ada]          hello.adb
Bind
   [gprbind]      hello.bexch
   [Ada]          hello.ali
Link
   [link]         hello.adb
✓ Build finished successfully in 0.31 seconds.

dmitry@Ubuntu64Testing:~/hello$ ./bin/hello
Hello World!

Ergo, you should seriously rethink using WSL. I am sure one can make it work, but…

Hi Simon, this what I got with alr build – -largs -Wl,-v

~/work/ada/hello$ alr build -- -largs -Wl,-v
ⓘ Building hello=0.1.0-dev/hello.gpr...
Link
   [link]         hello.adb
collect2 version 14.2.0
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld -plugin /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.2.0/liblto_plugin.so -plugin-opt=/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccst4DVH.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /home/alexis/work/ada/hello/bin//hello crt1.o crti.o /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/crtbegin.o -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/ -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0 -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib64/../lib64 -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib64 -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/lib -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../.. hello.o b__hello.o -v /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/libgnat.a -ldl -rpath-link /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0//adalib -z origin -rpath $ORIGIN/..//obj/development:$ORIGIN/../../../..//.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/crtend.o crtn.o
GNU ld (GNU Binutils) 2.42
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ldl: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lc: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
gprbuild: link of hello.adb failed
gprbuild: failed command was: /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/gcc hello.o b__hello.o -Wl,-v -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/ -static-libgcc /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/libgnat.a -ldl -Wl,-rpath-link,/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0//adalib -Wl,-z,origin,-rpath,$ORIGIN/..//obj/development:$ORIGIN/../../../..//.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib -o /home/alexis/work/ada/hello/bin//hello
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/alexis/work/ada/hello/hello.gpr", "-largs", "-Wl,-v"] exited with code 4
error: Compilation failed.

My severely untrained eye can’t spot any clues…

It’s beggining to look like a problem in the toolchain:

~/work/ada/hello$ alr exec -- gprbuild
using project file hello.gpr
Compile
   [Ada]          hello.adb
Bind
   [gprbind]      hello.bexch
   [Ada]          hello.ali
Link
   [link]         hello.adb
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ldl: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lc: No such file or directory
/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
gprbuild: link of hello.adb failed
gprbuild: failed command was: /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/bin/gcc hello.o b__hello.o -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/work/ada/hello/obj/development/ -L/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/ -static-libgcc /home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib/libgnat.a -ldl -Wl,-rpath-link,/home/alexis/.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0//adalib -Wl,-z,origin,-rpath,$ORIGIN/..//obj/development:$ORIGIN/../../../..//.local/share/alire/toolchains/gnat_native_14.2.1_06bb3def/lib/gcc/x86_64-pc-linux-gnu/14.2.0/adalib -o /home/alexis/work/ada/hello/bin//hello
error: Command ["gprbuild"] exited with code 4

I think Dmitry is probably right :sweat_smile:
Using WSL at work is breeze for me, but… :roll_eyes:

does any of this help:

I know it is WSL, but maybe some crossover on the issue.

1 Like

Aha! Had to do:

sudo apt-get update
sudo apt-get install libc-dev

That got alr build to work! These WSL distributions must be quite barebones out of the box.

Thanks @jere!

1 Like

:bangs head against wall:
-ldl tells the linker to look for libdl.a or libdl.so.
-lc likewise.

The crt*.o’s contain program startup code.
These will be in your distribution’s standard places.

Does a simple hello.c build with this compiler? does it build with the system’s compiler?

Is there a 64-bit vs 32-bit issue?

I don’t suppose this is a help - as I said, you need someone who knows Ubuntu & WSL.

Hi Simon, thank you. Doing sudo apt-get install libc-devgot it to work.

I’ve tried both on WSL’s Ubuntu 24.04 and 22.04. Gnat studio is producing a vulkan error on 24.04 so I’m going to stick to 22.04 for now, let’s see how it goes.

Thank you!