The compiler reports errors under Wine, but not under Windows

I have a .mqh

syntax error source file such as generated with the following command:

echo some_error > fail.mqh

      

I am now using the Metaeditor compiler for syntax checking, and my goal is to print errors to standard output ( CON

) instead of writing them to file ( /log:file.log

). See: Compilation .

The following syntax works fine on Linux / macOS as below (also under wine cmd.exe

):

$ wine metaeditor.exe /s /log:CON /compile:fail.mqh
??fail.mqh : information: Checking 'fail.mqh'
fail.mqh(1,1) : error 116: 'some_error' - declaration without type
fail.mqh(1,1) : error 161: 'some_error' - unexpected end of program
 : information: Result 2 error(s), 0 warning(s)

      

Note that a parameter is required /log

, otherwise the compiler does not print anything by default. Therefore, if specified /log

, then by default it writes the compilation result to a file. And I am using a special device CON

to display errors.

The problem is, when I run the same command on Windows (cmd), then I have no output:

> metaeditor.exe /s /log:CON /compile:fail.mqh

      

Ditto for CON:

/ CON:

. Also on PowerShell.

While CON

working for echo

, for example: echo test > CON

.

I could have guessed it might be a compiler bug, but then it works fine under Wine. Why does this only work under Wine?

Is there any other way to output errors to the terminal screen on Windows instead of a log file?


Note. You can install the compiler from the site or download a binary ( 32bit or 64bit ) to check above.


Clarification: my main blocker for using two separate commands (compiling and printing the error log after that) is that the CI test might print errors, making the tests useless, and that's history for another question. So my goal is to check the syntax and print the errors in one go.

+1


source to share


1 answer


According to the support team, Metaeditor does not have a console, so it cannot display logs to the screen. So the wine

ad-hoc device seems to be handling CON

differently. I reported this issue to the Service Desk and is still open, so they may implement console support in the future.



Currently the only workaround is to use the command type

to output the log file to the console after the files are compiled (or emulate it underneath wine

). Even if the compiler can display it on the console, it will not work properly with CI (in terms of handling error codes), since the logic to exit back from is metaeditor.exe

completely broken as it returns the number of successfully compiled instead of an error code (for example, if you compile 20 files, you get 20 error code!)! So, relying on the reverse output metaeditor.exe

is a bug and the MQL team is not planning to fix it anyway, as they say that is how it should work in their opinion.

0


source







All Articles