charm icon indicating copy to clipboard operation
charm copied to clipboard

`charmc`: exit code 0 on error in charmxi

Open tvandera opened this issue 1 year ago • 1 comments

Hi,

There is no set -o pipefail in charmc. Therefore, this pipe:

https://github.com/UIUC-PPL/charm/blob/738c09c9e845f2ec82c491f10a27f82729a847a5/src/scripts/charmc#L1915

can cause charmc to exit with status code 0, even when charmxi fails

tvandera avatar Mar 07 '24 10:03 tvandera

Hmm, I seems you'd also need a set -e for the set -o pipefail to work.

Another solution would be to use a temporary file to split the two commands

  Do $CMK_CPP_CHARM $OPTS_CPP $FILE -o $FILE.i
  Do $CHARMBIN/charmxi $XIOPTS -orig-file $FILE $FILE.i
  # original: Do $CMK_CPP_CHARM $OPTS_CPP $FILE | Do $CHARMBIN/charmxi $XIOPTS -orig-file $FILE

tvandera avatar Mar 07 '24 12:03 tvandera