lf-lang / lingo

Package manager and build tool for the Lingua Franca coordination language
BSD 2-Clause "Simplified" License
4 stars 1 forks source link

`lingo run` returns with `- Main: Success` even when the program exits with error #42

Closed erlingrj closed 8 months ago

erlingrj commented 9 months ago
target C;

main reactor {
    reaction (startup)  {=
        lf_print("Hello World!");
        lf_print_error_and_exit("ERROR");
    =}
} 

Yields:

Running "/home/erling/dev/lf/lingo/tmp/c/target/bin/Main"
FATAL ERROR: ERROR
---- Start execution at time Tue Oct 10 17:15:55 2023
---- plus 538501132 nanoseconds
Environment 0: ---- Spawning 1 workers.
Hello World!
---- Terminating environment 0
---- Elapsed logical time (in nsec): 0
---- Elapsed physical time (in nsec): 235,323
- Main: Success
erlingrj commented 9 months ago

Also. The ordering of output on stderr and stdout is not correct. This is what I get when running it normally:

---- Start execution at time Tue Oct 10 19:12:24 2023
---- plus 356385314 nanoseconds
Environment 0: ---- Spawning 1 workers.
Hello World!
FATAL ERROR: ERROR
---- Terminating environment 0
---- Elapsed logical time (in nsec): 0
---- Elapsed physical time (in nsec): 414,840
tanneberger commented 9 months ago

This is fixed in the testing branch