Skip to content

Conversation

@MarcusTomlinson
Copy link
Contributor

@MarcusTomlinson MarcusTomlinson commented Mar 11, 2021

Description

If this library is missing, builds fail with:

//lib64/libgcrypt.so.20: undefined reference to fstat@GLIBC_2.33'`

Related Issues

Resolves: canonical/flutter-snap#32
Resolves: canonical/flutter-snap#36
Resolves: #77786
Resolves: #77293

Tests

I've updated the relative flutter-doctor tests.

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 11, 2021
@google-cla google-cla bot added the cla: yes label Mar 11, 2021
@MarcusTomlinson
Copy link
Contributor Author

Here's the corresponding website update: flutter/website#5466

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tool changes LGTM, adding @cbracken for more context

@jonahwilliams jonahwilliams requested a review from cbracken March 11, 2021 21:39
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need website docs updates as well, as usual.

I know I've said this before, but it would be really good if we could flush all of these out at once somehow.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm on the change.

Thanks for updating the install instructions in flutter/website#5466

@ditman
Copy link
Member

ditman commented Mar 13, 2021

This seems to have broken flutter/plugins CI, here:

https://github.com/flutter/plugins/runs/2099838499

Call Stack (most recent call first):

  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)

  flutter/CMakeLists.txt:29 (pkg_check_modules)

I'll attempt to follow the new instructions to update our CI environment :)

(PS: The change suggested in the docs worked!)

@stuartmorgan-g
Copy link
Contributor

stuartmorgan-g commented Mar 13, 2021

This seems to have broken flutter/plugins CI, here:

Since it's somewhat non-obvious (to the point that I forgot even though I should have known better): it breaks that CI because we have a test that creates a new app every time it runs, so we get the new requirement immediately.

@jensjoha
Copy link
Contributor

I can add that this calls pkg-config --exists libgcrypt which as far as I can tell requires libgcrypt.pc to be in something like /usr/lib/x86_64-linux-gnu/pkgconfig/libgcrypt.pc and that notably Debian Buster (stable) doesn't include this file (https://packages.debian.org/buster/amd64/libgcrypt20-dev/filelist) whereas Debian Sid (unstable) does (https://packages.debian.org/sid/amd64/libgcrypt20-dev/filelist).

This in effect means that Debian Stable users will get told to run apt-get install libgcrypt20-dev even if it's already installed. It also means that flutter run (desktop target) won't work on Debian Stable (because pkg_check_modules(GCRYPT REQUIRED IMPORTED_TARGET libgcrypt) also fails).

Technically this might be a Debian bug, but it might still be worth knowing on this end.

@ditman
Copy link
Member

ditman commented Mar 15, 2021

it breaks that CI because we have a test that creates a new app every time it runs, so we get the new requirement immediately.

Correct, in fact, it only broke the test in flutter channel master, because that's what grabs the latest changes from the top of the repo. Users in other channels weren't affected.

I don't have an opinion about the pkg-config --exists libgcrypt change; @stuartmorgan any thoughts about @jensjoha's comment?

@MarcusTomlinson
Copy link
Contributor Author

This in effect means that Debian Stable users will get told to run apt-get install libgcrypt20-dev even if it's already installed.

That sucks :/ Maybe we should expand the doctor check to try ldconfig if pkg-config fails. We’d also need to add a specialized cmake module for gcrypt then. What do you think @stuartmorgan?

@stuartmorgan-g
Copy link
Contributor

This would be a question for @cbracken at this point.

(I do think it's problematic that we are increasingly breaking configurations that used to work just fine just to support the snap distribution of Flutter.)

@MarcusTomlinson
Copy link
Contributor Author

MarcusTomlinson commented Mar 17, 2021

This would be a question for @cbracken at this point.

(I do think it's problematic that we are increasingly breaking configurations that used to work just fine just to support the snap distribution of Flutter.)

You're absolutely right. In the past this sort of change has been beneficial for both the manual and snap install options, but especially considering it breaks some manual installs, this change is indeed not something I think (now) should be applied upstream.

I've fixed this issue downstream in the snap (a solution that was actually very simple and should have picked up had I not been so hasty), so we can (and I think should) revert these changes:

#78415
flutter/website#5504

Please accept my sincerest apologies for the mess!

@MarcusTomlinson
Copy link
Contributor Author

MarcusTomlinson commented Mar 17, 2021

In the past this sort of change has been beneficial for both the manual and snap install options

Actually, this statement may in fact be false. I don't think the addition of libblkid and liblzma fixed anything but the snap. How do you feel about these? Should we revert these explicit requirements in flutter (and the website) as well? I'm leaning toward yes.

@MarcusTomlinson
Copy link
Contributor Author

MarcusTomlinson commented Mar 17, 2021

I can confirm that this in addition to removing the pkg_check_modules for libblkid and liblzma from the project's CMakeLists works just fine.

I've also confirmed that without those pkg_check_modules, manual install on a fresh system using just sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev works as well.

It seems a no-brainer to revert the libblkid and liblzma explicit requirements from flutter upstream as well then. I'll update the PR's linked above with these changes.

@MarcusTomlinson
Copy link
Contributor Author

@ditman
Copy link
Member

ditman commented Mar 17, 2021

@MarcusTomlinson thanks for the heads up! We may be able to trim our Docker image after these changes land!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

7 participants