mlt icon indicating copy to clipboard operation
mlt copied to clipboard

Compile error in Glaxnimate module

Open frdbr opened this issue 2 years ago • 10 comments

[ 39%] Building CXX object src/modules/glaxnimate/CMakeFiles/mltglaxnimate.dir/glaxnimate/src/core/io/lottie/cbor_write_json.cpp.o
/home/farid/mlt-git/src/mlt/src/modules/glaxnimate/glaxnimate/src/core/io/lottie/cbor_write_json.cpp:21:6: error: identifier ‘char8_t’ is a keyword in C++20 [-Werror=c++20-compat]
   21 | enum char8_t : uchar {};
      |      ^~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src/modules/glaxnimate/CMakeFiles/mltglaxnimate.dir/build.make:440: src/modules/glaxnimate/CMakeFiles/mltglaxnimate.dir/glaxnimate/src/core/io/lottie/cbor_write_json.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1061: src/modules/glaxnimate/CMakeFiles/mltglaxnimate.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

frdbr avatar May 06 '23 16:05 frdbr

This is still a problem upstream: https://gitlab.com/mattbas/glaxnimate/-/blob/master/src/core/io/lottie/cbor_write_json.cpp#L20

Since we import this as a git submodule based on the latest release, I am going to turn off warnings as errors for anything but Debug builds.

ddennedy avatar May 06 '23 16:05 ddennedy

For now you can try building (requires a clean build directory) with CXXFLAGS environment variable containing -Wno-c++20-compat.

ddennedy avatar May 06 '23 16:05 ddennedy

Since I'm running from a PKGBUILD arch script I couldn't figure out how to properly add the CXXFLAGS but changing the build type from Debug to Release fixes it.

frdbr avatar May 06 '23 17:05 frdbr

If this is a good enough answer I can close it.

frdbr avatar May 06 '23 17:05 frdbr

I just ran into this too on msys2 (Windows) for Shotcut daily. This happened because Arch and msys2 upgraded gcc from major version 12 to 13. Do not close; I want to track fixing this in a Debug build for a future version of glaxnimate.

ddennedy avatar May 06 '23 17:05 ddennedy

Reported upstream: https://gitlab.com/mattbas/glaxnimate/-/issues/603

ddennedy avatar May 06 '23 18:05 ddennedy

Dan, I agree with your approach here. I would like OUR builds to fail on warnings, but 3rd party builds to succeed. Should we update our daily build actions to build for debug? Or I could add another switch that we could enable in our builds.

bmatherly avatar May 07 '23 22:05 bmatherly

Depends on what you mean by “OUR.” If you mean local then set the CMAKE_BUILD_TYPE=Debug If you mean Shotcut daily then no. If you mean melt on macOS daily and Linux on push, then yeah we can set that up.

ddennedy avatar May 07 '23 22:05 ddennedy

I already make my local builds with CMAKE_BUILD_TYPE=Debug. That that does not catch them all for some reason (compiler versions, I suppose).

I was thinking we could enable it for all these builds: https://github.com/mltframework/mlt/actions

Shotcut? Maybe someday in the future. I dunno.

bmatherly avatar May 07 '23 22:05 bmatherly

Ok but not the Docker build. I already have a local change yet to push to update the gitlab pipeline with more recent Fedora and turn on debug. That will catch more. But I don’t think we’ll ever catch them all. The case of Glaxnimate is more difficult as it is a git submodule, and we don’t yet have a way to set a separate build type for that module if that is even possible, which I doubt.

ddennedy avatar May 07 '23 22:05 ddennedy