kburtch / SparForte

Bourne shell, template engine, scripting language reliable, scalable projects. Based a ISO standard proven effective for large, mission-critical projects, SparForte is designed for fast development while, at the same time, providing easier designing, maintenance and bug removal. About 130.000 lines of code.
https://www.sparforte.com
GNU General Public License v2.0
50 stars 6 forks source link

Tried building Sparforte with FSF GCC 13 recently? #27

Closed jrmarino closed 4 months ago

jrmarino commented 1 year ago

Sparforte currently doesn't build for me since switching from GCC 11.2 to GCC 13.2

The first issue was stopped on a treat-warnings-as-errors here:

parser_memcache.adb:105:01: warning: type "aMemcacheClusterEntry" is frozen by body [enabled by default]
parser_memcache.adb:105:01: warning: an equality operator cannot be declared after this point [enabled by default]
parser_memcache.adb:110:10: warning: equality operator must be declared before type "aMemcacheClusterEntry" is frozen (RM 4.5.2 (9.8)) (Ada 2012) [enabled by default]
parser_memcache.adb:110:10: warning: equality operation may not compose [enabled by default]
parser_memcache.adb:154:01: warning: type "aMemcacheDualClusterEntry" is frozen by body [enabled by default]
parser_memcache.adb:154:01: warning: an equality operator cannot be declared after this point [enabled by default]
parser_memcache.adb:159:10: warning: equality operator must be declared before type "aMemcacheDualClusterEntry" is frozen (RM 4.5.2 (9.8)) (Ada 2012) [enabled by default]
parser_memcache.adb:159:10: warning: equality operation may not compose [enabled by default]

I got past that by adding the "-gnatd.E" flag.

But a bit further it crashed again due to a compiler ICE:

+===========================GNAT BUG DETECTED==============================+
| 13.2.0 (x86_64-raven-freebsd13) GCC error:                               |
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.cc:475                  |
| Error detected at parser_pen.adb:4017:61                                 |
| Compiling parser_pen.adb                                                 |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

The ICE isn't the code's fault but there might be during coding choice that works around it.

In any case I would be interested to hear if these issues can be reproduced by others.

kburtch commented 1 year ago

I have not heard of anyone else reporting these issues. I plan to return to work on SparForte in the fall, anticipating another spring release.

jrmarino commented 1 year ago

Well, until proven otherwise, I'm going to assume that this is reproducible and that nobody with the latest release of GCC (aka FSF gnat) can build sparforte.

jrmarino commented 7 months ago

For the record, the new release 2.6.2 also cannot be built by GCC 13 - due to the same GNAT Bug ICE

bluebat commented 6 months ago

Same on Fedora Linux with GCC 13. After removing all lines with 'param_ptr :=' in src/parser_pen.adb and adding '-gnatwv' flag, 'make' passed.

kburtch commented 6 months ago

This is one of the top items in the TODO file.

The database and graphics packages are two of the largest and oldest components in SparForte and both need to be rebuilt. As GCC 13 starts entering stable Linux distributions, both of these packages will be come harder to maintain. Raspberry Pi Bookworm is only the first stable distribution with this problem. At least now I can reproduce it.

I understand the issue but I have a full-time job and am a caretaker in my family. I'm limited to about 30 minutes work per week on SparForte right now. Unless some volunteers can assist, the best I can do is temporarily remove the pen package until the issues can be resolved. That will break some of my own projects that use the pen package but it will keep SparForte compiling.

jrmarino commented 6 months ago

I just want to point out that a GNAT BUG is a defect in the compiler (Internal Compiler Error). Technically there is probably nothing wrong with the code since it compiled with previous versions of GNAT. In my opinion, the first step is to make a small, compat test case that invokes the ICE, and then open a bug report at GNU/GCC so the bug can be fixed for later releases.

After that, then sure, if alternate code avoids the ICE, then a patch can be provided if not outright change the code.

kburtch commented 6 months ago

Bug report has been submitted.

kburtch commented 6 months ago

Bug report rejected because I have not created a small example. GCC recommends using newer compilers when they become available.

jrmarino commented 6 months ago

GCC will fix ICEs quickly if they they can be reproduced easily, but them saying to "try newer compilers" is not good advice. In my experience, once they introduce a gnat bug, it persist to newer releases.

kburtch commented 4 months ago

I have update the --without-sdl option to not compile any SDL dependencies and have removed the "nosdl" files. The language is passing tests. However, when I try a clean virtual machine with no SDL C libraries present, it builds but when I run it the language is raising exceptions for unknown reasons when running commands. I will continue to investigate.

kburtch commented 4 months ago

I wasn't able to duplicate the exceptions when performing the same build on Rocky Linux. I've released a new version 2.6.3 with the ability to disable SDL through the gnat preprocessor as a workaround for the GCC 13 issues.