comp.lang.ada
 help / color / mirror / Atom feed
* gnatmake (GNAT GPL 2009): bug or feature?
@ 2009-07-30 22:00 Damien Carbonne
  2009-07-31 10:04 ` Damien Carbonne
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Carbonne @ 2009-07-30 22:00 UTC (permalink / raw)


Hi,

I have discovered a strange behaviour with GPS today. I think it is a 
bug, but one never knows ...: an ALI file is removed in the lib 
directory of a library project, and it shouldn't (IMO).

This happens on a Linux box, with GNAT GPL 2009 and the behaviour is the 
same with GNAT GPL 2009 on windows XP (run through VirtualBox).

I managed to reproduce the problem quite simply.

Files are organised like this:
---------------------------------------------------------------------------
(rootdir)/
    glada.gpr
    gluada.gpr
    Makefile
    src/
       gl/
          gl.ads
       glu/
          glu.ads


Files are as follows:
---------------------------------------------------------------------------
glada.gpr:
project GLAda is
    for Languages use ("Ada");
    for Source_Dirs use ("src/gl/**");
    for Object_Dir use "obj/gl";
    for Library_Kind use "static";
    for Library_Dir use "lib";
    for Library_Name use "glada";
end GLAda;
---------------------------------------------------------------------------
gluada.gpr:
with "glada.gpr";
project GLUAda is
    for Languages use ("Ada");
    for Source_Dirs use ("src/glu/**");
    for Object_Dir use "obj/glu";
    for Library_Kind use "static";
    for Library_Dir use "lib";
    for Library_Name use "gluada";
end GLUAda;
---------------------------------------------------------------------------
gl.ads:
package GL is
    pragma Pure;
end GL;
---------------------------------------------------------------------------
glu.ads
package GLU is
    pragma Pure;
end GLU;
---------------------------------------------------------------------------
Makefile:
all:
	rm -fr lib obj
	gnatmake -p -Pglada.gpr
	ls -R obj lib
	gnatmake -p -Pgluada.gpr
	ls -R obj lib
---------------------------------------------------------------------------

Now, execution of make (in root directory) gives:

rm -fr lib obj
gnatmake -p -Pglada.gpr
object directory "/home/damien/dev/ws/gprbug/obj/gl" created for project 
glada
library directory "/home/damien/dev/ws/gprbug/lib" created for project glada
gcc -c -I- -gnatA /home/damien/dev/ws/gprbug/src/gl/gl.ads

building static library for project glada
ar cr /home/damien/dev/ws/gprbug/lib/libglada.a 
/home/damien/dev/ws/gprbug/obj/gl/gl.o
ranlib /home/damien/dev/ws/gprbug/lib/libglada.a
ls -R obj lib
lib:
gl.ali	libglada.a

obj:
gl

obj/gl:
gl.ali	gl.o
gnatmake -p -Pgluada.gpr
object directory "/home/damien/dev/ws/gprbug/obj/glu" created for 
project gluada
gcc -c -I- -gnatA /home/damien/dev/ws/gprbug/src/glu/glu.ads

building static library for project gluada
ar cr /home/damien/dev/ws/gprbug/lib/libgluada.a 
/home/damien/dev/ws/gprbug/obj/glu/glu.o
ranlib /home/damien/dev/ws/gprbug/lib/libgluada.a
ls -R obj lib
lib:
glu.ali  libglada.a  libgluada.a

obj:
gl  glu

obj/gl:
gl.ali	gl.o

obj/glu:
glu.ali  glu.o
---------------------------------------------------------------------------

The strange thing is that gl.ali has been created when glada project is 
generated (as expected), but removed after generation of gluada (as 
unexpected).
gl.ali is still present in obj/gl directory in the end.

So, did I make something wrong with GNAT projects?
If not, is this a known behaviour or a bug?

If you think it is a bug, I'll report it to AdaCore and try to analyse 
gnatmake to see where it can come from (GNAT GPL 2010 is still in a long 
time !)

Regards,
Damien Carbonne



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

* Re: gnatmake (GNAT GPL 2009): bug or feature?
  2009-07-30 22:00 gnatmake (GNAT GPL 2009): bug or feature? Damien Carbonne
@ 2009-07-31 10:04 ` Damien Carbonne
       [not found]   ` <9fSdnSwo5cGqVO7XnZ2dnUVZ_rudnZ2d@earthlink.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Carbonne @ 2009-07-31 10:04 UTC (permalink / raw)


Damien Carbonne a �crit :
> Hi,
> 
> I have discovered a strange behaviour with GPS today. I think it is a 
> bug, but one never knows ...: an ALI file is removed in the lib 
> directory of a library project, and it shouldn't (IMO).
> 

Doing some more tests, I found the same behaviour with a package named 
abcde in glu project and packages named a, ab, abc and abcd in gl project.
If the target libs for both project are different, then everything works 
fine.
Names of libs or directories have no influence (I also renamed gl to 
dir1, glu to dir2, changed names of generated libraries, ...)
By changing settings in GPS (Build/Settings/Targets menu) in order to 
use gprbuild instead of builder (generic GNAT builder, which is set to 
gnatmake by default), everything works correctly.
I didn't find yet how default builder can be set.

Damien



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

* Re: gnatmake (GNAT GPL 2009): bug or feature?
       [not found]   ` <9fSdnSwo5cGqVO7XnZ2dnUVZ_rudnZ2d@earthlink.com>
@ 2009-08-01  7:52     ` Damien Carbonne
  0 siblings, 0 replies; 3+ messages in thread
From: Damien Carbonne @ 2009-08-01  7:52 UTC (permalink / raw)


Dennis Lee Bieber a �crit :
> On Fri, 31 Jul 2009 12:04:44 +0200, Damien Carbonne
> <damien.carbonne@free.fr> declaimed the following in comp.lang.ada:
> 
>> Doing some more tests, I found the same behaviour with a package named 
>> abcde in glu project and packages named a, ab, abc and abcd in gl project.
>> If the target libs for both project are different, then everything works 
>> fine.
> 	Hypothesis... Some confusion with the compressed names for the ada.*
> standard packages?

Perhaps. But gprbuild works with the same data. And the issue happens 
with other patterns (gl/glu  h/hu, ...).
I sent a report to AdaCore (but I'm a non-paying customer !).



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

end of thread, other threads:[~2009-08-01  7:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-30 22:00 gnatmake (GNAT GPL 2009): bug or feature? Damien Carbonne
2009-07-31 10:04 ` Damien Carbonne
     [not found]   ` <9fSdnSwo5cGqVO7XnZ2dnUVZ_rudnZ2d@earthlink.com>
2009-08-01  7:52     ` Damien Carbonne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox