Best practices for gnat studio installation?

Hello All,

After months of building all tools from source and installing myself (a frustrating, but educational experience!), combined with vim, and other workhorse tools, I am wanting to try the other path.

As this will be done on a fresh virtual machine, there are not many constraints.

What are your recommendations for installing gnat studio, etc.?:

  • Any approaches to avoid?
  • Go “all in” on using Alire or not? (I hesitate to do this, have had trouble with repositories for Void Linux. In general, it feels “fragile”. But maybe I am wrong here.)
  • Should I do a custom rebuild of latest gcc-16 (with latest gnat, etc.)? Or use something else?
  • Any non-obvious tips you have?

In general, my goal is to be able to spend more time writing Ada code, rather than the care-and-feeding of associated tooling.

All insights are kindly appreciated

Hi!

Best practice is to use alire to download all of the tools. There you can also select the versions you want/need (gnat16 is not out yet iirc)

Using your distros repo is very much hit or miss :confused:

Other than they you should be good to go!

Which distros works best with Alire?

GNAT Studio installs pretty easily. Just do not take 2026.2. It is barely usable due to a massive bug. Install the previous release. It has issues, like disappearing cursor, but you could live with that.

I am using a range of GNAT compiler versions on different virtual or not machines to keep my code as much compatible as possible. It is helpful to run a 32-bit compiler from time to time. I develop under Windows, it is more comfortable and stable than Linux. Then I test under Debian, Arch, Ubuntu, Fedora, CentOS. Though not much. Ada is extremely portable and safe.

I never run for the latest compiler version and refrain from newest Ada features. I do not find them appealing and they are usually ridden with bugs.

I reduce generics to the unavoidable minimum. Generics never worked well in GNAT and probably never will.

There are problems with discriminated tagged types. When the inheritance tree gets deeper than 3 levels and you keep on adding new discriminants controlling a variant part, you will eventually crash the compiler. The nasty part is that it crashes quite late at the stage of code generation. So you might compile all files successfully for a long time and only when all files get compiled the compiler sends you back to the drawing board. It is quite annoying.

I do not use Alire. Gprbuid + native packaging offer more than Alire does. Neither provides a usable project management / automated release testing framework, nor I expect them to do it.

I do not use any “tools” except for the compiler and gprbuild. I do not find “tools” useful. I write documentation myself. I write unit tests myself. I turn off autoformatting and auto-indentation. I would turn off the annoying floating “help” popup window if I knew how. I do not care about highlighting. All I need from GNAT Studio is working “go to definition” and “find all references.”

And finally, will I live to see errors listed before warnings!

P.S. Note that most people disagree with me.

Dmitry,

Thanks for your information here. Probably for similar reasons, I am wary of to relying on “towering levels of infrastructure”. They just break too often. Sometimes remaining closer to the ground-level can be better.

But, I am curious, what are the benefits that GNAT Studio brings to your set-up, as opposed to just using a working compiler and working editor? I mean what are the attraction points to GNAT Studio for you?

There are many advantages to me:

  • Tabbed view. I have 4 tabs side by side. It is extremely useful to see ads, adb and the client code at once.
  • Project view. I have deeply nested projects and source navigation through the project view is easy. I need not to care about actual folders. Moreover, the selected scenario filters out irrelevant files. E.g. the target OS dependent bodies.
  • I use search, messages and locations tabs at the layout bottom.
  • Search in files is very useful, I frequently use it for searching non-Ada files. Windows search is a disaster and the Linux one is an abomination.
  • Search within a selected project.
  • I like the ability to set up the run command arguments.
  • I use build/run selectors. My test projects have many main procedures. I can select the one I debug and build/run with a single button press.
  • Then of course “go to definition” and “find all references.”

Well, the debugger is unusable, but that is because of GDB, not GNAT Studio. I gave up visual debugging long ago. Last time I used it was under ObjectAda, then I could dive into an alien dynamic librariy. With GDB you would wait for a half an hour and get nothing in the end. Nothing compares with the DEC debugger, but that was in other century on other planet…