all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding GNAT/GCC-Ada to Guix
@ 2023-07-16  8:47 Fernando Oleo Blanco
  2023-07-16 14:36 ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 5+ messages in thread
From: Fernando Oleo Blanco @ 2023-07-16  8:47 UTC (permalink / raw)
  To: Guix Devel

Dear Guix community,

I would like to bring once again [1] the discussion regarding the 
addition of a modern Ada compiler to Guix. In this case, GCC-Ada, aka GNAT.

TL;DR: GCC-Ada/GNAT cannot be bootstrapped. I would like to package a 
binary up until a bootstrap path is available; which is already under 
discussion.

As far as I know, GCC-Ada has not been added to Guix for two major 
reasons. The first one is the lack of bootstrappability and the second 
one is that no one has given it a thorough try. This emails hopes to 
shed some light on both of these topics.

1. Bootstrapping Ada

GCC-Ada (originally known as GNAT) has always required a previous GNAT 
version to compile newer releases. Ada was made an official language of 
the GCC stack with the GCC 3.1 release. Before this release, GNAT was 
distributed as a set of patches that had to be applied to GCC's src and 
it required a previous GNAT compiler to be available. I could not find 
"the original binary", but I have found ancient GNAT patch sets. The 
first (non-public) binaries were created using an Ada 83 compiler, 
potentially with Ada-Ed, an Ada 83 interpreter written in C (already 
available in Guix). However, the first publicly available patches dating 
from (GCC 2) already used Ada 95 features and required the Ada 95 
compiler based on GCC. What does this wall of text mean?

There was never a publicly available GNAT/GCC-Ada compiler that could be 
bootstrapped. The bootstrapping path was never made available and has 
been lost to history.

Why did I tell all of this?
Because I would like to add GCC-Ada to Guix and I am fully aware of the 
work that the Guix and the #bootstrappable people are doing towards a 
fully transparent compilation history. Opaque binaries are not allowed 
for that purpose. Sadly that is not currently possible with Ada. 
Therefore, I would like to get permission to add GCC-Ada as a binary up 
until there is a bootstrapping path available. I am aware that some 
languages/tools have received this treatment before.

2. A path towards bootstrapping GCC-Ada

As I said, some of us are aware of the issue mentioned above. We have 
already talked about a solution. I will not explain it here. Please, 
read the forum posts available in [2]. However, a bootstrapping compiler 
is years into the future.

3. What can Ada provide to Guix?

Apart from being an official language of the GCC toolsuite, it is also 
used in some important and unique places. For example, the graphics 
stack of Coreboot/Libreboot among other drivers are written in Ada [3] 
(you can find more by running `find . -type f -name "*.ad*"` on 
Coreboot's root folder). It is also the base programming language of 
SPARK [4], a verifiable, GPLv3 licensed, programming language, used for 
the ARIANE rockets and the Rosetta space probe for example. And of 
course, there are plenty of libraries, tools and programs written in 
Ada! Without a compiler, none of this can be packaged in Guix...

4. The dreaded binaries

As I said, I would like to package GCC-Ada, but it would initially be a 
binary blob (a semi-trusted one, maybe one from the Alire [5,6] project 
or Debian [7]). Are the Guix maintainers okay with this? Would you 
accept such a commit?

4.5 Some technical data about the proposed binaries

The Debian binary is just the GNAT/GCC-Ada compiler, meaning it has as 
dependencies gcc-12, libc6, libgmp10, libgnat-12 (Ada STL), etc. The 
compressed size of the package is ~18 MB, uncompressed it weighs ~91 MB. 
This indicates that it is not a high entropy package. However, as I said 
before, this is a very barebones Ada installation and it may make the 
package creation quite complex as other binaries may be required.

The Alire installation [6] weighs 296 MB compressed. Uncompressed it 
becomes a 837 MB folder. The reason for the much larger weight (but 
still relatively low entropy) is that the Alire binary comes with the 
entire compilation suit. It has a C/C++ compiler, Ada, binutils, GDB, 
some runtime environments, etc. It is a full, self-contained 
installation that is designed to be a drop-in deployment to get started 
compiling Ada. The compilation of this package is done using this python 
script [8], so the process is transparent.

5. Closing up

I personally would like the Alire installation media to be allowed as a 
binary if this proposal is accepted. This is because it is much easier 
to package (as the package would not need to link to other compilers or 
libraries) and it is the standard tooling used in the Alire project 
(think of Rust's Cargo but for Ada), which makes it fairly standard 
within the community.

What do you think? Is this a good idea? Should Guix accept this? Should 
Guix not provide an Ada compiler unless it can be bootstrapped, which 
will take years?
Of course, I would like to see this accepted, but I believe an initial 
discussion is required.

[1] https://lists.gnu.org/archive/html/guix-devel/2017-01/msg01568.html
[2] https://fossil.irvise.xyz/gnat-bootstrap/forum
[3] 
https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src/drivers/intel/gma/
[4] https://github.com/AdaCore/spark2014
[5] https://alire.ada.dev/
[6] 
https://github.com/alire-project/GNAT-FSF-builds/releases/tag/gnat-12.2.0-1
[7] https://packages.debian.org/bookworm/gnat-12
[8] https://github.com/alire-project/GNAT-FSF-builds

Best regards and thank you for your time,
Fer



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-27  1:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-16  8:47 Adding GNAT/GCC-Ada to Guix Fernando Oleo Blanco
2023-07-16 14:36 ` Denis 'GNUtoo' Carikli
2023-07-17  7:44   ` Ricardo Wurmus
2023-07-20 18:13     ` Fernando Oleo Blanco
2023-07-27  1:35       ` Timothy Sample

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.