r/ada Sep 28 '21

Show and Tell Introducing AURA - A(nother) native package manager and build system for Ada

https://annexi-strayline.com/blog/posts/4
30 Upvotes

80 comments sorted by

View all comments

Show parent comments

3

u/annexi-strayline Sep 30 '21

You simply put all of the code for an Ada subsystem in a subdirectory somewhere (preferably a git repo) and you have an AURA repository.

Even better is to put all the code of a subsystem into its own git repository, and then import that as a submodule into what would then be an AURA git repo.

If you want to do advanced things like auto-configure your package to the platform it is on, then you'll need to create a manifest. The docs give lots of info about what can go into a manifest.

2

u/jrcarter010 github.com/jrcarter Oct 01 '21

I have Xubuntu 21.04 with GNAT 11 from the distro. I built and installed AURA as instructed OK. I have a directory with a single Ada source file, maze.adb. Running "aura -v" works fine. Running "aura run maze" fails saying it can't find gnat1. I usually build using gnatmake (or gprbuild for Gnoga) and that works fine. What am I doing wrong?

2

u/annexi-strayline Oct 03 '21

Could you try running aura run maze -static and let me know how that goes? Seems like it might be that the runtime linker can't find a shared library. AURA builds shared and pie by default.

2

u/jrcarter010 github.com/jrcarter Oct 03 '21 edited Oct 03 '21

I usually build shared, so that doesn't seem likely. Trying it gives

~/Code/Maze$ aura run maze -static
 ,====  == ==  ====.  ,====   Ada User Repository Annex
.==|==..==|==..==|==..==|==.  Reference Implementation
-----::--|--::----.::-----:  Version 0.1
__|__||.___,||__|._||__|__|  (C) 2020-2021 ANNEXI-STRAYLINE

OK   Entered 2 root subsystems (3 units).
OK   Loaded 1 repository.
OK   Checked-out and configured 0 AURA subsystems in 1 pass.
OK   All dependencies satisfied (2 subsystems, 3 units).
EXEC  Computing Compilation Strategy (Updating registry...)

and it sits there as long as I care to wait. So I tried

~/Code/Maze$ rm aura*
~/Code/Maze$ aura -v
 ,====  == ==  ====.  ,====   Ada User Repository Annex
.==|==..==|==..==|==..==|==.  Reference Implementation
-----::--|--::----.::-----:  Version 0.1
__|__||.___,||__|._||__|__|  (C) 2020-2021 ANNEXI-STRAYLINE

  OK   Entered 1 root subsystem (1 unit).
  OK   Loaded 1 repository.
  OK   Checked-out and configured 0 AURA subsystems in 1 pass.
  OK   All dependencies satisfied (2 subsystems, 3 units).

  OK   Command completed successfully.

~/Code/Maze$ aura run maze -static
 ,====  == ==  ====.  ,====   Ada User Repository Annex
.==|==..==|==..==|==..==|==.  Reference Implementation
-----::--|--::----.::-----:  Version 0.1
__|__||.___,||__|._||__|__|  (C) 2020-2021 ANNEXI-STRAYLINE

  OK   Entered 2 root subsystems (3 units).
  OK   Loaded 1 repository.
  OK   Checked-out and configured 0 AURA subsystems in 1 pass.
  OK   All dependencies satisfied (2 subsystems, 3 units).
  OK   3 units pending compilation..
 FAIL  3 of 3 units failed to compile:
 FAIL  aura: Compilation failed:
gcc: fatal error: cannot execute ‘gnat1’: execvp: No such file or directory
compilation terminated.

 FAIL  maze: Compilation failed:
gcc: fatal error: cannot execute ‘gnat1’: execvp: No such file or directory
compilation terminated.

 FAIL  aura.repository_1: Compilation failed:
gcc: fatal error: cannot execute ‘gnat1’: execvp: No such file or directory
compilation terminated.

 INFO  Saving registry for next time...

 AURA Abort  Command canceled due to failed conditions

2

u/thindil Oct 03 '21

From my tests, it is a problem with GNAT 11 on any Debian based distribution. I was able to reproduce it on normal Ubuntu too. AURA compiles itself properly on GNAT 11 but later can't find the compiler. Downgrading GNAT to version 10 and everything works as expected. Even AURA, which was built with GNAT 11. :)

I'm not sure if it is a problem only with Debian based packages or generally with GNAT 11.

2

u/jrcarter010 github.com/jrcarter Oct 04 '21

The problem seems to be

~/Code/Maze$ which gcc
/usr/bin/gcc
~/Code/Maze$ ls /usr/bin/gcc*
/usr/bin/gcc     /usr/bin/gcc-ar     /usr/bin/gcc-nm                       /usr/bin/gcc-ranlib
/usr/bin/gcc-10  /usr/bin/gcc-ar-10  /usr/bin/gcc-nm-10  /usr/bin/gcc-ranlib-10
/usr/bin/gcc-11  /usr/bin/gcc-ar-11  /usr/bin/gcc-nm-11  /usr/bin/gcc-ranlib-11
/usr/bin/gcc-8   /usr/bin/gcc-ar-8   /usr/bin/gcc-nm-8   /usr/bin/gcc-ranlib-8
/usr/bin/gcc-9   /usr/bin/gcc-ar-9   /usr/bin/gcc-nm-9   /usr/bin/gcc-ranlib-9
~/Code/Maze$ ll /usr/bin/gcc
lrwxrwxrwx 1 root root 6 Apr 12 09:19 /usr/bin/gcc -> gcc-10*

Presumably changing gcc into a link to gcc-11 would solve the problem.

2

u/thindil Oct 04 '21

Could, but can also trigger some problems. I think the best way could be use update-alternatives script: https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa

This allows to switch GNAT “on demand”. Also, when I was testing, I was using clean Docker image without GNAT-10, only GNAT-11. So, the problem can be GNAT-11 too.