mdsplus icon indicating copy to clipboard operation
mdsplus copied to clipboard

CompileTree: Exit with non-zero status code for error messages.

Open Louwrensth opened this issue 3 years ago • 7 comments

This would make CompileTree a bit more POSIX compatible and scripting based on exit status would become possible (instead of reading (locale-dependent) error messages, which now also go to standard error as they should).

N.B. Some error messages are only messages themselves and have no System.exit(1) statement. Is this by choice? I left it this way.

Hope the intention is appreciated and applied through out mdsplus, not just CompileTree.

Louwrensth avatar Feb 07 '22 14:02 Louwrensth

retest this please

GabrieleManduchi avatar Feb 09 '22 08:02 GabrieleManduchi

Apparently there is no space left on device in the build&test system. Josh, could you have a look at it?

GabrieleManduchi avatar Feb 09 '22 13:02 GabrieleManduchi

sure

joshStillerman avatar Feb 09 '22 14:02 joshStillerman

retest this please

GabrieleManduchi avatar Feb 11 '22 15:02 GabrieleManduchi

retest this please

joshStillerman avatar Feb 16 '22 20:02 joshStillerman

retest this please

zack-vii avatar May 02 '22 12:05 zack-vii

I also concur that the proposed changes are good.

Note though that MDSplus uses two different schemes for error codes. (Of course, error codes returned by functions are not the same thing as an exit code returned by a terminating process. But they are often related.)

  • POSIX is used in some modules (such as the Java code in this PR).

  • VAX/VMS is used by a lot of the functions in the core MDSplus libraries. It has many non-zero error codes that denote success. For more details, refer to the deploy/gen_messages.py file around line 280. description of MDSplus error codes

These two schemes treat an error code of 1 quite differently.

  • In POSIX, 1 is a failure (i.e., success is a 0).
  • In VAX/VMS, 1 is a success (as is any error code with the low order bit set).

mwinkel-dev avatar Feb 13 '24 22:02 mwinkel-dev

There are two CompileTree.java files in the entire source code. This PR only changes the jtraverser version. Should a similar change be made to the jtraverser2 version? https://github.com/MDSplus/mdsplus/blob/alpha/java/jtraverser2/src/main/java/mds/jtraverser/tools/CompileTree.java

If so, should that change be added to this PR? Or done as a separate PR?

mwinkel-dev avatar May 02 '24 16:05 mwinkel-dev

Retest this please

WhoBrokeTheBuild avatar May 03 '24 16:05 WhoBrokeTheBuild