rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.23k stars 193 forks source link

Unable to build flutter application for linux #390

Open rolandgeider opened 6 months ago

rolandgeider commented 6 months ago

Description

It seems it's not possible to build flutter application for linux

Steps To Reproduce

$ flutter build linux

/home/roland/entwicklung/wger/flutter/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SBParagraph.c:618:16: error: unused variable 'stringLength' [-Werror,-Wunused-variable]
Building Linux application...                                           
Build process failed

Source .riv/.rev file

n/a

Expected behavior

The build succeds. It seems that 0.13.0 is the version that introduced the bug, it's possible to build the application with 0.12.4 without any problems.

Screenshots

n/a

Device & Versions (please complete the following information)

Additional context

Also happens on github's CI: https://github.com/wger-project/flutter/actions/runs/9052280531/job/24869782253

FeodorFitsner commented 6 months ago

Got the same error: https://ci.appveyor.com/project/flet-dev/flet/build/job/8ml3csb67k1mi5dr#L1994

FeodorFitsner commented 6 months ago

0.13.2 introduced that issue. 0.13.1 gives successful build: https://ci.appveyor.com/project/flet-dev/flet/builds/49860784/job/ctoa28981dcvrgg5#L1926

0.13.2 adds rive_common native plugin: https://github.com/flet-dev/flet/commit/40030648ff9de15c80dfe83990aeb729cfd80c25#diff-b944988673a542aa817aea9d0faaa93591b3acab9f6b5ca62be94d0b951c8989

Toph92 commented 5 months ago

Same error with 0.13.1 and latest 0.13.5 on Linux Mint. Build is OK with 0.12.4 thanks rolandgeider

/home/cdesbois/Documents/flutter_app/SP/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SBParagraph.c:619:16: error: unused variable 'stringLength' [-Werror,-Wunused-variable]

flutter --version
Flutter 3.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5dcb86f68f (il y a 3 semaines) • 2024-05-09 07:39:20 -0500
Engine • revision f6344b75dc
Tools • Dart 3.4.0 • DevTools 2.34.3
KingkorAtMaxint commented 4 months ago

This should be higher priority issue. Almost 2 months but no fix is applied for an unused variable warning causing build error. Please update it with a fix.

FeodorFitsner commented 2 months ago

Is there any update? It's still impossible to build the app for Linux with the latest Rive.

jwinarske commented 1 month ago

As a data point I build Rive 0.4.11 (added CMake) for Yocto Linux using this repo: https://github.com/meta-flutter/rive-common/

The install target also installs a package config file.

This Yocto recipe supports both GCC 13 and Clang 18: https://github.com/meta-flutter/meta-flutter/blob/scarthgap/recipes-graphics/rive/rive-text_0.4.11.bb

wenyue commented 1 month ago

Same issue, please fix this bug.

caseymdk commented 2 days ago

You can get around this by adding -Wno-unused-variable and -Wno-unused-function flags after the existing -Werror flags on this line of your CMakeLists.txt file in the linux directory.

target_compile_options(${TARGET} PRIVATE -Wall -Werror -Wno-unused-variable -Wno-unused-function)

Those flags are already in the clang build command for rive and the SheenBidi dependency...I don't know why I have to add the flags to my global flutter linux config in order to make things work.

Running with flutter build linux -v shows the particular clang command causing the error. Maybe someone has insight as to why it still throws the error despite those two -Wno flags already being included.

[  +52 ms] [2/7] Building C object plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o
[        ] FAILED: plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o 
[   +6 ms] /usr/bin/clang -DAPPLICATION_ID=\"com.example.example\" -DFLUTTER_PLUGIN_IMPL -DNDEBUG -Drive_common_plugin_EXPORTS
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/harfbuzz/src
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/rive-cpp/skia/renderer/include
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/rive-cpp/include
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/SheenBidi/Headers
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/miniaudio
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/linux/../macos/yoga
-I/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral -isystem /usr/include/gtk-3.0 -isystem /usr/include/pango-1.0 -isystem /usr/include/glib-2.0
-isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem
/usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/fribidi -isystem /usr/include/cairo -isystem /usr/include/pixman-1 -isystem
/usr/include/gdk-pixbuf-2.0 -isystem /usr/include/webp -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/atk-1.0 -isystem /usr/include/at-spi2-atk/2.0
-isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem /usr/lib/x86_64-linux-gnu/dbus-1.0/include -DYOGA_EXPORT= -DSB_CONFIG_UNITY
-DWITH_RIVE_TEXT -DWITH_RIVE_AUDIO_TOOLS -DWITH_RIVE_AUDIO -DMA_NO_RESOURCE_MANAGER -DHAVE_OT -DHB_NO_FALLBACK_SHAPE -DHB_NO_WIN1256  -DHB_NO_CFF
-DHB_NO_BUFFER_VERIFY -DHB_NO_BUFFER_MESSAGE -DHB_NO_PAINT -DHB_NO_MMAP -DHB_NO_META -Wno-documentation -Wno-comma -Wno-unreachable-code -Wno-shorten-64-to-32
-ansi -pedantic -Wno-unused-function -Wno-unused-variable -DANSI_DECLARATORS -O3 -DNDEBUG -fPIC -Wall -Werror -O3 -pthread -MD -MT
plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o -MF
plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o.d -o
plugins/rive_common/CMakeFiles/rive_common_plugin.dir/__/macos/SheenBidi/Source/SheenBidi.c.o -c
/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SheenBidi.c
[   +2 ms] In file included from
/home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SheenBidi.c:36:
[        ] /home/caseymdk/tmp/rive-flutter/example/linux/flutter/ephemeral/.plugin_symlinks/rive_common/macos/SheenBidi/Source/SBParagraph.c:618:16: error:
unused variable 'stringLength' [-Werror,-Wunused-variable]
[   +1 ms]   618 |     SBUInteger stringLength = codepointSequence->stringLength;
[        ]       |                ^~~~~~~~~~~~
[        ] 1 error generated.