archlinux arm builds fail 2.0.2 due to Wnarrowing and
Not a high priority issue, but I just happened to stumble upon these build logs from Arch Linux Arm attempting to compile musescore 2.0.2 a month ago:
http://archlinuxarm.org:81/builder/in-log/musescore-2.0.2-1-armv5.log.h…
http://archlinuxarm.org:81/builder/in-log/musescore-2.0.2-1-armv6.log.h…
http://archlinuxarm.org:81/builder/in-log/musescore-2.0.2-1-armv7.log.h…
They all fail %22 through with clef.cpp lines 34-58
due to compiler preventing those -1 ints to be narrowed to chars:
"/build/musescore/src/MuseScore-2.0.2/libmscore/clef.cpp:58:7: error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]"
and then v8 fails with "/usr/bin/fmtutil: line 375: luajittex: command not found"
http://archlinuxarm.org:81/builder/in-log/musescore-2.0.2-1-armv8.log.h…
That one seems to just be a package dependency error in the pacman build script. Anyway, just making a note here on the forums in case any of you have any thoughts. I do have a few arm boards I could try to compile on. I bet there would be more errors afterwards. I suspect many of these errors may be due to arch linux using different environment (most likely due to arch using latest versions of things like libraries and compilers). musescore 1.3 is in the arch linux arm package repository, so it would be nice to get the newer releases to pass.
ps, a couple years ago I did run 1.3 inside my Galaxy Note 2 smartphone...musescore opened and displayed an empty score on my phone, but I wasn't really able to interact usefully. I'm also aware of other people on these forums running on arm computers like [#22469], (but probably different distros).
Comments
I guess those "char"s would need to be changed into "signed char"s?
Edit: actually they are, see libmscore/clef.h:
enum class ClefType : signed char {
INVALID = -1,
...
struct ClefTypeList {
ClefType _concertClef = ClefType::G;
ClefType _transposingClef = ClefType::G;
...
In reply to I guess those "char"s would by Jojo-Schmitz
for some reason compiler doesn't want those -1 ints :11111111111111111111111111111111 to turn into -1 chars: 11111111DISREGARDFor some reason the narrowing is an error instead of a warning. Could be something wrong with the build script. I think might pass if explicitly cast all those -1 into signed in the assigment block, but I don't know for sure. (I think it is also complaining about the _lines array in addition to the enum.)
EDIT: This seems to be a similar error: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790667 ...they say the issue is where plain char is signed on amd64 but unsigned on arm64.
It might be the line array in clef.h that needs to be declared as signed chars, like you suggest.
In reply to for some reason compiler by ericfontainejazz
should be easy enough for you to test, shouldn't it? OTOH it is pretty clear that it needs to be signed char _lines[14], seeing that it gets initializes with -1 at times.
I'll make a PR.
In reply to should be easy enough for you by Jojo-Schmitz
Will take some time to setup my compiler environment. I might end up doing a cross compiler on my x86-64 machines and use distcc just to make the builds fast...I can figure that out, but maybe in the next week or so. But once it is setup, should be easy to test it, and the future archlinuxarm bugs that are likely to appear.
In reply to Will take some time to setup by ericfontainejazz
see https://github.com/musescore/MuseScore/pull/2171