Open theskyblockman opened 1 year ago
Does this persist after flutter clean
?
No, I forgot to say that I found this note in the verbose logs:
[ +23 ms] = note: /snap/flutter/current/usr/bin/ld: /usr/libexec/gcc/x86_64-redhat-linux/13/liblto_plugin.so: error loading plugin: /var/lib/snapd/snap/flutter/141/usr/bin/../../lib/x86_64-linux-gnu/libc.so.6: version
`GLIBC_2.33' not found (required by /usr/libexec/gcc/x86_64-redhat-linux/13/liblto_plugin.so)
I have checked and I have this version of GLIB installed.
Not sure if that error is related. It seems that Rust is unable to build any binary on your computer. But there is about a million reasons why it could fail so it's hard to say why exactly.
Can you try the following:
git clone https://github.com/superlistapp/super_native_extensions.git
cd super_native_extensions/super_native_extensions/rust
cargo build
And post here the output?
The build fails because of a missing system dependency:
➜ rust git:(main) cargo build
Compiling gio-sys v0.17.10
Compiling futures-executor v0.3.28
Compiling gdk-sys v0.17.0
Compiling atk-sys v0.17.0
Compiling cairo-sys-rs v0.17.10
Compiling gdk-pixbuf-sys v0.17.10
The following warnings were emitted during compilation:
warning: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "atk" "atk >= 2.28"` did not exit successfully: exit status: 1
error: failed to run custom build command for `atk-sys v0.17.0`
Caused by:
process didn't exit successfully: `/home/theskyblockman/Developement/dart/super_native_extensions/super_native_extensions/rust/target/debug/build/atk-sys-3aa39b951afcfeef/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=ATK_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:warning=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "atk" "atk >= 2.28"` did not exit successfully: exit status: 1
error: could not find system library 'atk' required by the 'atk-sys' crate
--- stderr
Package atk was not found in the pkg-config search path.
Perhaps you should add the directory containing `atk.pc'
to the PKG_CONFIG_PATH environment variable
Package 'atk', required by 'virtual:world', not found
Package 'atk', required by 'virtual:world', not found
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `gdk-sys v0.17.0`
Caused by:
process didn't exit successfully: `/home/theskyblockman/Developement/dart/super_native_extensions/super_native_extensions/rust/target/debug/build/gdk-sys-92ab4a51652a3664/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=GDK_3.0_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "gdk-3.0" "gdk-3.0 >= 3.22"` did not exit successfully: exit status: 1
error: could not find system library 'gdk-3.0' required by the 'gdk-sys' crate
--- stderr
Package gdk-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdk-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gdk-3.0', required by 'virtual:world', not found
Package 'gdk-3.0', required by 'virtual:world', not found
(I have checked and I have the package installed)
If pkg-config --libs --cflags atk
fails it probably means that you don't atk-devel
installed, which is dependency of libgtk-3-dev
, which is necessary dependency for Flutter development.
I'm not entirely sure why the error would not show in the original log though.
The command failed so I installed atk-devel
but the build still failed with the same logs
You shouldn't be installing atk-devel
directly, that's just one of the dependencies. What response do you get for
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "gdk-3.0" "gdk-3.0 >= 3.22"
Have you tried installing libgtk-3-dev
?
You shouldn't be installing
atk-devel
directly, that's just one of the dependencies. What response do you get forPKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "gdk-3.0" "gdk-3.0 >= 3.22"
I get the same error:
Package gdk-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdk-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gdk-3.0', required by 'virtual:world', not found
Package 'gdk-3.0', required by 'virtual:world', not found
Have you tried installing
libgtk-3-dev
?
When I installed gtk3-devel
the missing dependency error went away, the cargo build
succeeded but I still get the same error with flutter run
can you do flutter clean
and then flutter run -d linux -v
and send me the full output?
I still get the same error:
Are you able to run /snap/flutter/current/usr/bin/ld
?
From the full log it seems that cargo is trying to link with /snap/flutter/current/usr/bin/ld
but the command fails to run. cargo build
passed because it wasn't trying to build within the snap environment.
Yes, it runs without any problems:
➜ /snap/flutter/current/usr/bin/ld --version
GNU ld (GNU Binutils for Ubuntu) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.
Yes, it runs without any problems:
➜ /snap/flutter/current/usr/bin/ld --version GNU ld (GNU Binutils for Ubuntu) 2.34 Copyright (C) 2020 Free Software Foundation, Inc.
Actually, that might not mean much :-/ The problem seems to happen when loading the liblto plugin /usr/libexec/gcc/x86_64-redhat-linux/13/liblto_plugin.so
, which might not be loaded during ld --version
.
I'll see if I can reproduce this with Fedora 38 and Flutter from snap. Both 37 and 38 have way newer glibc version than 2.3.3 so that shouldn't matter.
There is similar issue discussed here: https://stackoverflow.com/questions/74156104/glibc-2-33-not-found-while-building-flutter-for-linux
I tried to reinstall Flutter and run the build process again, but I still got the same error:
➜ linux flutter run -d linux
Changing current working directory to: /home/theskyblockman/Developement/flutter/explainomia
Resolving dependencies...
_fe_analyzer_shared 64.0.0 (65.0.0 available)
analyzer 6.2.0 (6.3.0 available)
coverage 1.6.4 (1.7.0 available)
flutter_lints 2.0.3 (3.0.0 available)
irondash_engine_context 0.1.1 (0.3.1 available)
irondash_message_channel 0.1.1 (0.3.1 available)
lints 2.1.1 (3.0.0 available)
material_color_utilities 0.5.0 (0.8.0 available)
meta 1.10.0 (1.11.0 available)
super_clipboard 0.1.7+6 (0.6.4 available)
super_drag_and_drop 0.1.9+3 (0.6.4 available)
super_native_extensions 0.1.8+2 (0.6.4 available)
web 0.2.1-beta (0.3.0 available)
Got dependencies!
13 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Launching lib/main.dart on Linux in debug mode...
error: linking with `cc` failed: exit status: 1
collect2: error: ld returned 1 exit status
error: could not compile `log` (build script) due to previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit status: 1
collect2: error: ld returned 1 exit status
error: could not compile `semver` (build script) due to previous error
error: linking with `cc` failed: exit status: 1
collect2: error: ld returned 1 exit status
error: could not compile `anyhow` (build script) due to previous error
Building Linux application...
Exception: Build process failed
Okay, I think see where the problem is. The flutter snap is shipped with libc-2.31, but the ld
from it is trying to load a lto
plugin from your system, which depends on libc-2.33
. Which of course fails.
Btw, I just published 0.7.0. It will use precompiled libraries if Rust is not available. You can try upgrading your project to 0.7.0 and uninstalling Rust.
I reported the Flutter issue here: https://github.com/flutter/flutter/issues/137036
Another options would be simply not use Flutter from snap. All you need to do is checkout the flutter project and add the bin
directory to PATH.
Moved to flutter-snap: https://github.com/canonical/flutter-snap/issues/109
Hello, I recently wanted to install the super_drag_and_drop package, but after I updated my rust version (
rustc 1.73.0
) and tried to runflutter run
on my Fedora 38 machine, I got those linker errors:When I ran
flutter run -v
to try to get more information, I just got this:Here's my
flutter doctor -v
:I am building for Linux, Windows and MacOS.