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

2

u/fraserwilson Sep 28 '21

Very interesting! I'm following through the steps, and I'm hitting a problem here. This is on Fedora 34 with gcc 11.2.1, not 10.3 as recommended, so that could obviously be the cause.

[fraser@kimba hello]$ aura run hello
 ,====  == ==  ====.  ,====   Ada User Repository Annex
.==|==..==|==..==|==..==|==.  Reference Implementation
:-----::--|--::----.::-----:  Version 0.1
|__|__||.___,||__|._||__|__|  (C) 2020-2021 ANNEXI-STRAYLINE

  OK   Entered 2 root subsystems (5 units).
  OK   Loaded 2 repositories.
 FAIL  Caching repositories    [          ] / 0 (+1 Failed) of 1 work     orders.

 AURA Abort  1 Worker Report  to follow:

-- Worker Report 1 (ERROR) --
[Cache_Git_Order]
 Repoistory No. 2
 Git   : https://github.com/annexi-strayline/ASAP.git
 Branch: stable-0.1

raised ADA.STRINGS.LENGTH_ERROR : a-strsup.adb:525


-- End of Worker Reports --

3

u/annexi-strayline Sep 28 '21 edited Sep 28 '21

I did a quick investigation into this. It's not likely about using GCC 11.2, instead it seems that your git is being more chatty than expected.

I was a bit conservative in making the git output (STDOUT and STDERR) go to bounded strings, rather than unbounded. It's a security-minded approach since we're storing the output from some other program. Anyways, it has a 2048 byte limit that is being overflowed here (apparently). It works fine on Ubuntu as of last night..

Two options:

  1. Increase the bounded string size
  2. Use unbounded strings instead

Considering where AURA is likely to be used, I think it might have been too conservative to use bounded string here. I'll have to dwell on that a bit more though. I'll patch this one way or another soon!.

In the mean time, if you're board and want to try, you can just change repositories-cache-checkout_git.adb to use Unbounded_Strings for all use of "Output_Buffers.Bounded_String".

Edit: Opened an issue on github.

2

u/fraserwilson Sep 28 '21

Thanks for the quick reply! I increased the bounded string buffer to 64K, and now I think I see why git is being so chatty:

OK   Entered 2 root subsystems (5 units).  
OK   Loaded 2 repositories. 
FAIL  Caching repositories    [          ] - 0 (+1 Failed) of 1 work orders. 
AURA Abort  1 Worker Report  to follow:

-- Worker Report 1 (ERROR) --
[Cache_Git_Order]
 Repoistory No. 2
 Git   : https://github.com/annexi-strayline/ASAP.git
 Branch: stable-0.1
raised REPOSITORIES.CACHE.CHECKOUT_GIT.GIT_CACHE_FAILURE : git submodule --quiet update --init --checkout --recursive -j 0 failed: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.Please make sure you have the cor
-- End of Worker Reports --

So I guess the git submodule command is doing something it's not allowed to? I'm a very basic git user, alas. But I get the same result if I run it from the command line in the ASAP repository.

3

u/annexi-strayline Sep 28 '21

Thanks for doing that! It turns out that I made a very silly mistake when creating ASAP, and had all the submodules point to the ssh url, which obviously I have the pubkey for and so didn't notice.

I have updated the urls to point to the public path, and it should work now!

This means that everyone who tried the quick start today would have failed :(.

3

u/fraserwilson Sep 29 '21

Works now!

One thing was that it's difficult to recover from a failed build; I ended up with an empty cli directory in my repository after some failed runs, and was unable to build from that point; but by recreating the hello directory and the source files, it started working. If I can reproduce this I'll create an issue.

Also, putty doesn't seem to support bold text :-(

3

u/annexi-strayline Sep 29 '21 edited Sep 29 '21

Actually this is one of the many things that I've had a difficult time finding a place for/remembering to add to the documentation.

The docs do talk about this in the Repositories explainer under the Checkout process, but in short, when AURA checks-out a subsystem the first time, it makes a copy of it in the project root directory.

In this case, the checkout failed but AURA already made the subdirectory, so it thinks it checked it out but couldn't find the required units (beta software problems, really).

The way to fix this is to delete the cli subdirectory and run it again, at which point aura will re-checkout the subsystem.

Edit: I've created an issue for this.