Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap uses an old version of CMake #53

Closed
lil5 opened this issue Sep 27, 2021 · 4 comments · Fixed by #61
Closed

Snap uses an old version of CMake #53

lil5 opened this issue Sep 27, 2021 · 4 comments · Fixed by #61

Comments

@lil5
Copy link

lil5 commented Sep 27, 2021

I have encountered an error where I have needed to add a dependency to my project that depends on CMake.

My Linux mint (20.2) installation includes CMake version 3.16.3, yet in flutter the dependency in question sees a version of CMake 3.10.2.

❓ Why is such an old version of CMake used in flutter-snap, while ubuntu's repos have updated to CMake 3.16.3?

Related issue: objectbox/objectbox-dart#317


For any developers currently running into this issue my advice is to follow the manual tar.gz installation process on the official flutter documentation.

https://docs.flutter.dev/get-started/install/linux#install-flutter-manually

@tsinis
Copy link

tsinis commented Nov 5, 2021

Same here, it would be nice to have a version of CMake 3.15 or higher, at least on edge. Related Issue: harmonoid/libwinmedia#8

@lil5
Copy link
Author

lil5 commented Nov 7, 2021

Possible duplicate of #45

@bazookon
Copy link

bazookon commented Feb 4, 2022

Hi! , any news? I have the same problem. CMake of core18 is too old, please

@purencool
Copy link

I raised this issue with the flutter team, and they very kindly pointed me to the Flutter Snap project. I am adding it for transparency and anyone who finds the issue I raised. Flutter plugins are now using newer versions of CMake in their plugins. Please see the attached link from the Flutter issue queue.

flutter/flutter#101726

LGro pushed a commit to LGro/coagulate that referenced this issue Feb 1, 2024
If Flutter has not been installed before building VeilidChat on Linux,
the user can end up with CMake 3.16.3 and encounter errors for
Corrosion files that require CMake 3.22 or later. Unfortunately,
recovering from this is apparently more complex than putting a newer
cmake earlier in the PATH, so it's perhaps best not to obtain CMake
3.16.3 in the first place.

The set of conflicts that cause this issue to exist include:

veilidchat indirectly recommends the Flutter snap:

https://gitlab.com/veilid/veilidchat/-/blob/268b86d1319d3bd77dff857c7154250679a081ef/setup_linux.sh#L19

https://gitlab.com/veilid/veilid/-/blob/f59c4509ea7e0c0e8b1088138a6eb5297844b112/veilid-flutter/setup_flutter.sh#L23

https://docs.flutter.dev/get-started/install

https://docs.flutter.dev/get-started/install/linux

"The easiest way to install Flutter on Linux is by using snapd."

Flutter apparently requires CMake 3.16.3 and someone is not especially
interested in newer versions. Historically, CMake in the Flutter snap
has been multiple minor versions behind upstream CMake (e.g., 3.10
when a user needed 3.16, 3.16 when a user needed 3.22, etc.):

https://github.com/flutter/flutter/blob/9427b77376d22ceb2c02174ac65dfe9983377a6e/packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart#L120

canonical/flutter-snap#53

flutter/flutter#101726 (comment)

"We discourage plugin developers from requiring a newer version of
CMake than Flutter requires, but we cannot control what third-party
developers do. ... If you want to use the snap installation, and want
an update with a newer version of CMake, you'd need to file a request
at https://github.com/canonical/flutter-snap"

When the Flutter snap is installed, flutter commands execute cmake
from within the snap's read-only filesystem, and do not use the cmake
found in the PATH. This may lead to challenges regardless of whether
the user already has a /usr/bin/cmake that is recent enough, or
whether the user needs to replace /usr/bin/cmake by following the
https://apt.kitware.com process.

3.16.3 is not recent enough because veilid uses Corrosion from GitHub:

https://gitlab.com/veilid/veilid/-/blob/f59c4509ea7e0c0e8b1088138a6eb5297844b112/veilid-flutter/linux/rust.cmake#L11

https://corrosion-rs.github.io/corrosion/

"The master branch of Corrosion currently requires CMake 3.22 or
newer."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants