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

Commit 88baf62f made gtk+-3.0 an unconditional requirement #144421

Closed
aduskett opened this issue Feb 29, 2024 · 4 comments · Fixed by flutter/engine#51179
Closed

Commit 88baf62f made gtk+-3.0 an unconditional requirement #144421

aduskett opened this issue Feb 29, 2024 · 4 comments · Fixed by flutter/engine#51179
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console e: local-engine-development Local builds of the engine working better engine flutter/engine repository. See also e: labels. r: fixed Issue is closed as already fixed in a newer version team-linux Owned by the Linux platform team

Comments

@aduskett
Copy link

From what I can tell, commit 88baf62f1e66e973e919faef7d80fb1a4c3ef90c which added the following to flutter/testing/BUILD.gn:54

  if (is_linux) {
    # So that we can call gtk_init in main().
    configs += [ "//flutter/shell/platform/linux/config:gtk" ]
  }

Now forces embedded devices to have gtk+-3.0 built and installed to configure Flutter 3.19+. This is not ideal, and raises a few questions:

  1. Why is the testing directory included at all when --no-enable-unittests is passed to flutter/tools/gn?
  2. Is there a clean way of disabling the above test?

My testing was done via the Buildroot embedded Linux SDK and updating from Flutter 3.16.8 to 3.19.2.

This is the output of the error described above:

PATH=output/host/share/depot_tools:"output/host/bin:output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" PUB_CACHE=fosdem/dl/br-flutter-pub-cache HOME=output/host/share/flutter/sdk ./flutter/tools/gn --clang --embedder-for-target --linux-cpu x64 --no-build-embedder-examples --no-clang-static-analyzer --no-enable-unittests --no-goma --no-prebuilt-dart-sdk --no-stripped --runtime-mode profile --target-os linux --target-sysroot output/host/x86_64-buildroot-linux-gnu/sysroot --target-toolchain output/build/flutter-engine-3.19.2/buildtools/linux-x64/clang --target-triple x86_64-unknown-linux-gnu --no-lto --enable-fontconfig --enable-impeller-opengles --no-build-glfw-shell --disable-desktop-embeddings

Generating GN files in: out/linux_profile_x64
ERROR at //build/config/linux/pkg_config.gni:103:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: output/build/flutter-engine-3.19.2/out/linux_profile_x64/
Command: vpython3 output/build/flutter-engine-3.19.2/build/config/linux/pkg-config.py -s output/host/x86_64-buildroot-linux-gnu/sysroot -a x64 --system_libdir lib gtk+-3.0
Returned 1.
stderr:

Traceback (most recent call last):
  File "output/build/flutter-engine-3.19.2/build/config/linux/pkg-config.py", line 247, in <module>
    sys.exit(main())
  File "output/build/flutter-engine-3.19.2/build/config/linux/pkg-config.py", line 144, in main
    prefix = GetPkgConfigPrefixToStrip(options, args)
  File "output/build/flutter-engine-3.19.2/build/config/linux/pkg-config.py", line 82, in GetPkgConfigPrefixToStrip
    prefix = subprocess.check_output([options.pkg_config,
  File "output/host/share/flutter/sdk/.vpython-root/store/cpython-n8umfpv0s1ufm2q1s4irhb59jc/contents/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "output/host/share/flutter/sdk/.vpython-root/store/cpython-n8umfpv0s1ufm2q1s4irhb59jc/contents/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pkg-config', '--variable=prefix', 'gtk+-3.0']' returned non-zero exit status 1.

See //flutter/shell/platform/linux/config/BUILD.gn:8:1: whence it was called.
pkg_config("gtk") {
^------------------
See //flutter/testing/BUILD.gn:56:18: which caused the file to be included.
    configs += [ "//flutter/shell/platform/linux/config:gtk" ]

Removing

  if (is_linux) {
    # So that we can call gtk_init in main().
    configs += [ "//flutter/shell/platform/linux/config:gtk" ]
  }

from flutter/testing/BUILD.gn fixes the issue, but it still begs the question as to why the testing directory is being included at all if --no-enable-unittests is being set?

@huycozy huycozy added the in triage Presently being triaged by the triage team label Mar 1, 2024
@huycozy
Copy link
Member

huycozy commented Mar 1, 2024

Labeling this as desktop issue since that commit (flutter/engine@88baf62) was to fix for the issue on linux.

@huycozy huycozy added engine flutter/engine repository. See also e: labels. a: desktop Running on desktop e: local-engine-development Local builds of the engine working better team-desktop c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels Mar 1, 2024
@aduskett
Copy link
Author

aduskett commented Mar 1, 2024

Labeling this as desktop issue since that commit (flutter/engine@88baf62) was to fix for the issue on linux.

Thank you!
3.19.x also seems to require wayland, with multiple complaints that wayland.h is missing.

@dkwingsmt
Copy link
Contributor

@gspencergoog who made the said change.

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
@cbracken cbracken added team-linux Owned by the Linux platform team and removed team-desktop labels Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console e: local-engine-development Local builds of the engine working better engine flutter/engine repository. See also e: labels. r: fixed Issue is closed as already fixed in a newer version team-linux Owned by the Linux platform team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants