Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 129405 - dev-lang/gnat and dev-lang/gnat-gcc can't coexist cleanly
Summary: dev-lang/gnat and dev-lang/gnat-gcc can't coexist cleanly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: ada team [OBSOLETE]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 111340
  Show dependency tree
 
Reported: 2006-04-09 18:36 UTC by fabio de francesco
Modified: 2006-04-13 13:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fabio de francesco 2006-04-09 18:36:48 UTC
I have installed dev-lang/gnat-3.45 a few days ago and everything was working fine until I installed dev-lang/gnat-gcc-4.1.0. Since the last emerge I am no more able to compile Ada sources because got a lot of strange errors on the same sources that used to compile without problems.

First of all I can't choose which compiler to use with "eselect gnat". When I run it as "eselect gnat list" it shows only "i686-pc-linux-gnu-gnat-gcc-4.1". It is like it doesn't see dev-lang/gnat-3.45.

Anyway while compiling a simple program of mine with "gnatmake -gnatv manage.adb" it shows messages like the following:

gnatgcc -c -gnatv manage.adb
GNAT 3.4.5 Copyright 1992-2004 Free Software Foundation, Inc.
Compiling: manage.adb (source file time stamp: 2006-03-28 00:24:03)
==============Error messages for source file: /usr/lib/gnat-gcc/i686-pc-linux-gnu/4.1/adainclude/a-numeri.ads
    24.    ["03C0"] : constant := Pi;
           |
        >>> wide character not allowed in identifier
 64 lines: 1 error
gnatmake: "manage.adb" compilation error

You can see from the above message that dev-lang/gnat-3.45 seems to be invoked, but that "a-numeri.ads" (that seems bugged by itself) comes from gnat-gcc-4.1.0 as it is clear from the shown path.

Am I missing something? I think you don't need "emerge --info" in order to check that issue, do you?

Thanks.

fabio de francesco
Comment 1 George Shapovalov (RETIRED) gentoo-dev 2006-04-11 03:36:44 UTC
Of course they cannot. The gnat-* stuff is masked in fact as of now, although I am about to unmask it, at which point simple gnat will be masked..

The dev-lang/gnat is the "old" gnat in portage - really a messy collection of gnat's by AdaCore and FSF without much care taken on how they interact. The "new" gnat's are dev-lang/gnat-{gcc,gpl} (possibly -pub-3.15). These compilers are SLOTted (so that you can have gnat-gcc-3.x and gnat-gcc-4.1 installed together) and can coexist (gcc with gpl versions) and the old gnat does not know anything about it.. Please take a look at bug #111340 for more details. 

To resolve the problem you got now, the best course of action is to 
1. unmerge all instances of gnat you have now, 
2. rm -rf /usr/share/gnat, if such exists and not empty
3. locally unmask gnat-gcc and/or gnat-gpl (optionally mask gnat)
4. emerge gnat-gcc/gnat-gpl versions that you want

Using these new ebuilds you *can* have gnat-gcc-3.4.6 and gnat-gcc-4.1.0 together, just please do not try to mix them with old gnat..

George
Comment 2 fabio de francesco 2006-04-13 10:20:39 UTC
I have done, in the following order:

1) emerge --unmerge gnat
2) emerge =dev-lang/gnat-gcc-3.4.6 =dev-lang/gnat-gcc-4.1.0
3) eselect gnat set i686-pc-linux-gnu-gnat-gcc-4.1

It seems everything is working. Thank you.

But... There is only a problem left. The following is the output of "emerge -vuDNp world":

[blocks B     ] dev-lang/gnat-gcc (is blocking dev-lang/gnat-3.45)
[blocks B     ] dev-lang/gnat (is blocking dev-lang/gnat-gcc-4.1.0)
... More packages cut ...
[ebuild  N    ] dev-lang/gnat-3.45  0 kB

What's more is that when I try to install or re-install all most of the packages of dev-ada group, emerge wants to install both dev-lang/gnat-3.45 and gnat-3.15p-r5 and obviously it adds that gnat-gcc blocks gnat-3.45.

Thank you for your help.
Comment 3 George Shapovalov (RETIRED) gentoo-dev 2006-04-13 13:50:15 UTC
Thanks for testing and reporting! The compilers indeed seem to be working fine now and are ready to be unmasked. I am planning to do that (unmask them) soon..
However the situation with libs is quite different. Right now we only have old versions, working with the legacy dev-lang/gnat with varying degree of success (that is, in my experience half of them are in fact broken :().

The libs will have to be reworked to play along with new gnat compilers, which is I am about to start. However it will be some time before they will be workable. 

The blocks that you report are to be expected, as now you have new gnat compilers installed (and listed in your world file) and portage wants to pull in legacy gnat as a dependency of ada libs you have installed.. Unfortunately there is no easy way around this until I update the libs :(.
You may try replacing dev-lang/gnat with virtual/gnat(which I just added to the tree) in [R]DEPEND of the libs you need to use and see if they "just compile". If they do, you may live for a while with such hybrid system. However the real fix will be more involved, as I need to make every lib build binaries for every installed compiler and update eselect-gnat to switch them along with selecting certain gnat compiler (plus all the relevant guards..), so, as I said, this is going to take some time unfortunately..

I am going to close this bug, as the issue is now resolved (I added blockers at all the relevant places). Please add yourself to CC of #111340 if you are interested in how things progress. I might open a new bug to track the state of the libs specifically, but if I do it will be linked to that bug..

George