Skip to content

[file_selector_linux]When compiling the project with Debian 10, the following error occurred: [-Werror, -Wunused-function] #158900

@kero990

Description

@kero990

Steps to reproduce

I attempted to compile the localsend project on Debian 10 using Flutter version 3.24.4, and the error can be replicated on any clean Debian 10 installation.
The basic compilation process is as follows:

apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev libfuse2
git clone -b 3.24.4 https://github.com/flutter/flutter
export PATH=.....
flutter doctor
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/localsend/localsend
cd localsend/app
flutter pub get
flutter pub run build_runner build -d
flutter build linux

Expected results

I tried to compile the localsend project and required glibc to be less than 2.28, so I used the Debian 10 environment. In the earlier versions of this project, compilation was normal.

Actual results

Based on my experience with C language compilation, the error should just be a warning level issue, but when I tried to add the CFLAGS parameter in several CMakeLists files without effect, including the system environment variables.

I'm not sure how to correct this seemingly simple compilation problem. Even I'm not sure if it's a Flutter issue or a problem with the plugin.

Code sample

~/localsend/app/linux/flutter/ephemeral/.plugin_symlinks/file_selector_linux/linux/messages.g.cc:234:1: error: unused function 'FFS_IS_MESSAGE_CODEC' [-Werror,-Wunused-function]             
~/localsend/app/linux/flutter/ephemeral/.plugin_symlinks/file_selector_linux/linux/messages.g.cc:436:1: error: unused function 'FFS_IS_FILE_SELECTOR_API' [-Werror,-Wunused-function]         
Building Linux application...                                           
Build process failed

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

flutter doctor -v
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Flutter assets will be downloaded from https://mirrors.cloud.tencent.com/flutter. Make sure you
trust this source!
[✓] Flutter (Channel stable, 3.24.4, on Debian GNU/Linux 10 (buster) 4.19.0-arm64-desktop, locale
    zh_CN.UTF-8)
    • Flutter version 3.24.4 on channel stable at /opt/runtime/flutter
    • Framework revision 603104015d (3 周前), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3
    • Pub download mirror https://mirrors.cloud.tencent.com/dart-pub
    • Flutter download mirror https://mirrors.cloud.tencent.com/flutter

[✗] Android toolchain - develop for Android devices
    • Android SDK at /usr/lib/android-sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
    • cmake version 3.28.1
    • ninja version 1.8.2
    • pkg-config version 0.29

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-arm64 • Debian GNU/Linux 10 (buster) 4.19.0-arm64-desktop

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 4 categories.

Although the environment is arm64, the issue actually occurs on x86 as well.

Metadata

Metadata

Labels

P2Important issues not at the top of the work listp: file_selectorThe file_selector pluginpackageflutter/packages repository. See also p: labels.platform-linuxBuilding on or for Linux specificallyteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions