[M3devel] m3cc often succeeds when it should fail
Olaf Wagner
wagner at elegosoft.com
Fri Aug 27 19:23:31 CEST 2010
Quoting Jay K <jay.krell at cornell.edu>:
>> Could you elaborate what exactly fails?
>
> I use make | tee -a.
> Any compilation failure..and still success.
You loose stderr there. One standard solution would be to write
stderr to a file and check that for content afterwards:
make 2>make.err | tee -a log
if[ -s make.err ]; then # error
>> I'm also not sure that we can easily implement it in quake.
>
> Here is where I disagree...though I'm not certain.
> You put in a substantial sh emulation already, in sysutils, already
> exposed in quake.
>
> m3-libs/sysutils/src/System.m3
>
> PROCEDURE WaitForAll() : INTEGER =
> VAR p: Process.T; ret: INTEGER := 0;
> BEGIN
> WHILE processes.size() > 0 DO
> p := NARROW(processes.remlo(), Process.T);
> ret := Process.Wait(p);
> CloseFiles(cjobid);
> INC(cjobid);
> END;
> RETURN ret;
> END WaitForAll;
>
> A small change there would do what I want I think.
>
> PROCEDURE WaitForAll() : INTEGER =
>
> VAR p: Process.T; ret := 0; overall := 0;
> BEGIN
> WHILE processes.size() > 0 DO
> p := NARROW(processes.remlo(), Process.T);
> ret := Process.Wait(p);
> IF ret <> 0 AND overall = 0 THEN
> overall := ret;
> END;
> CloseFiles(cjobid);
> INC(cjobid);
> END;
> RETURN overall;
> END WaitForAll;
>
> It could be made optional, though the way I showed would be global for
> that cm3 invocation, once set.
>
> It'd probably be safe to make it not optional. ?
If this is what is used in your situation I'm in favour of making
it the default to heed all return codes.
I only said that I'm not sure it can be done easily, as there are
different ways how processes are created in quake, often via
system shells (might even be a cmd.exe) or anything specified in
QUAKE_SHELL.
As long as we're using one of the new functions I wrote some years
ago it should be no problem. If it's working for you, just change
it and document it in the quake manual (cm3/doc/help/cm3/quake.html).
Olaf
--
Olaf Wagner -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
More information about the M3devel
mailing list