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?
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.
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
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).
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.
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?
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.
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
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.