openvpn-gui
openvpn-gui copied to clipboard
make windres fail on resource errors
if resource file is broken, windres produces a "warning" on that.
those might be errors actually, like these
https://github.com/OpenVPN/openvpn-gui/commit/727eaee0c54b0aee01ad28f622c1da7011e7b7c1 https://travis-ci.org/OpenVPN/openvpn-gui/jobs/221950708#L683-L686
we need to turn those warnings into errors
Agreed. I tested what happens if I introduce an error in a .rc file and then go through the build like Travis would. And here's what happened:
$ x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I/home/samuli/image/include -D_UNICODE -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=_WIN32_WINNT_VISTA -DWINVER=_WIN32_WINNT -i res/openvpn-gui-res.rc -o openvpn-gui-res.o
In file included from res/openvpn-gui-res.rc:46:0:
res/openvpn-gui-res-fi.rc:47:22: warning: missing terminating " character [enabled by default]
LTEXT "Sala"sana:", 0, 6, 26, 50, 10
^
x86_64-w64-mingw32-windres: res/openvpn-gui-res-fi.rc:47: syntax error
x86_64-w64-mingw32-windres: preprocessing failed.
$ echo $?
2
So the return value is 2, not 1. However, if I run the windres command alone it exits with 1:
$ x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I/home/samuli/image/include -D_UNICODE -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=_WIN32_WINNT_VISTA -DWINVER=_WIN32_WINNT -i res/openvpn-gui-res.rc -o openvpn-gui-res.o
In file included from res/openvpn-gui-res.rc:46:0:
res/openvpn-gui-res-fi.rc:34:29: warning: missing terminating " character [enabled by default]
CHECKBOX "Save pass"word", ID_CHK_SAVE_PASS, 6, 33, 100, 10
^
x86_64-w64-mingw32-windres: res/openvpn-gui-res-fi.rc:34: syntax error
x86_64-w64-mingw32-windres: preprocessing failed.
$ echo $?
1
The error message is identical to the one shown in Travis, except that the advise
res/openvpn-gui-res-kr.rc:268: use "" to put " in a string
is missing. The man-page of x86_64-w64-mingw32-windres does not show any options that we could use, and the error is coming from windres, not the preprocessor (gcc -E ...).
Is this perhaps an issue in the Travis' build environment?
I tried local build, it was the same as travis-ci. actually, I had a couple of thoughts
- use windres "preprocessor" feature
- parse output
I do not like either of above.
what is your windres version ?
/usr/bin/x86_64-w64-mingw32-windres --version
GNU windres (GNU Binutils) 2.23.52.20130620
ok, I will have a look at travis-ci and my local tools
have a look
https://travis-ci.org/chipitsine/openvpn-gui/jobs/230523093#L1469
and
https://travis-ci.org/chipitsine/openvpn-gui/jobs/230527072#L1629
as I had a look at windres sources, it is ... designed to compile any resource file, if possible with warning, but not fail. too bad.
I suppose we have to just keep an eye on windres warnings..
if we convert rc into "visual studio compatible", we can run VS under appveyor
I'll ask at binutils/windres community. Maybe we just miss something obvious
surprise, windres does fail on its own (i.e. fails as expected), on the same "kr" resource
https://travis-ci.org/chipitsine/windres-xprmnts/jobs/231258891#L1258
it seems to fail ... when including files ?
We no have MSVC builds and this should not be an issue any longer.