Patchwork [Ada] Simultaneous compilations and -gnateG

login
register
mail settings
Submitter Arnaud Charlet
Date Oct. 4, 2010, 1:17 p.m.
Message ID <20101004131713.GA17826@adacore.com>
Download mbox | patch
Permalink /patch/66648/
State New
Headers show

Comments

Arnaud Charlet - Oct. 4, 2010, 1:17 p.m.
When there are several simultaneous compilations, the compilation switch
-gnateG (generate preprocessed source) is used and the same preprocessed
source is necessary for several of these simultaneous compilation, one
or several compilations may fail. This patch makes sure that no
compilation will fail for the reason that the processed file cannot be
saved to disk.
The test for this is to invoke gnatmake with -f -j20 -gnateD... -gnateG
a main that withs many package spec that in turn with the same spec
that needs to be preprocessed. There should not be any compilation
failure if the same invocation of gnatmake succeeds without the -j
switch.

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-10-04  Vincent Celier  <celier@adacore.com>

	* sinput-l.adb (Load_File): Do not fail when switch -gnateG is
	specified and the processed file cannot be written. Just issue a
	warning and continue.

Patch

Index: sinput-l.adb
===================================================================
--- sinput-l.adb	(revision 164906)
+++ sinput-l.adb	(working copy)
@@ -591,10 +591,9 @@  package body Sinput.L is
 
                         if not Status then
                            Errout.Error_Msg
-                             ("could not write processed file """ &
+                             ("?could not write processed file """ &
                               Name_Buffer (1 .. Name_Len) & '"',
                               Lo);
-                           return No_Source_File;
                         end if;
                      end;
                   end if;