Package Details: flutter-intellij-patch 3.24.3-2

Git Clone URL: https://aur.archlinux.org/flutter.git (read-only, click to copy)
Package Base: flutter
Description: Flutter SDK component - IntelliJ Flutter plugin hotfix
Upstream URL: https://flutter.dev
Keywords: android fuchsia ios mobile sdk
Licenses: custom, BSD, CCPL
Groups: flutter
Submitter: flipflop97
Maintainer: WithTheBraid
Last Packager: WithTheBraid
Votes: 140
Popularity: 2.92
First Submitted: 2017-06-05 21:03 (UTC)
Last Updated: 2024-10-14 13:51 (UTC)

Pinned Comments

WithTheBraid commented on 2024-03-28 00:44 (UTC) (edited on 2024-05-10 11:44 (UTC) by WithTheBraid)

TL;DR

Upgrade using aur/yay might take very long and works inefficiently.

Upgrade using aur/paru requires the -d flag.

This is not my fault.


Note to the lovers of AUR helpers : It looks like dependency resolution is a complex topic. Despite all package relations being properly declared in the Flutter packages, most AUR helpers seem to have trouble resolving the dependency chain between the package bases aur/flutter and aur/flutter-artifacts-google-bin. This is not my fault and I cannot do anything about it.

It looks like the initial installation works fine using aur/paru. Sadly aur/paru does not reach at building updates for the package without additional flags. Please use paru -Syud (whereas the -d is the relevant flag) to upgrade the package.

On the other hand aur/yay properly reaches at both installing and updating this package, even though it builds the package 15 times (!!!) again and again.

If you use aur/paru, consider to simply execute pacman -R flutter && pacman -Rns flutter to clean up the previous installation of both package bases.

If you build both package bases using makepkg -sfC and later on install all build outputs using pacman -U, both the installation and the updates work like a charm.

I'm very sorry for the inconvenience, but sadly there's nothing I can do about this.

WithTheBraid commented on 2024-03-25 20:55 (UTC) (edited on 2024-05-10 11:45 (UTC) by WithTheBraid)

Huge update to the Flutter AUR package :

The previous implementation basically did a user installation of Flutter - downloaded the custom Dart SDK, CI artifacts from Chromium CI and had to be kept in user R/W access in order to have the Flutter Cache Manager working.

These times are now over - a clean and (almost) completely rewritten PKGBUILD which now uses clean dependency declarations, system Dart and Gradle and for sure no more user R/W installation directory.

This AUR entry is now a split package. Installing aur/flutter will still bundle the entire toolchain you knew from before. The other way round, if you don't need everything - e.g. when depending on Flutter as a build dependency in another package, you can choose to only depend on what you need.

The following split packages are available :

  • flutter : meta package containing all other split packages

  • flutter-common : the common files for Flutter needed for all use cases

  • flutter-devel : your option of choice as a developer - ships the Flutter tool and all required templates to e.g. create a new project

  • flutter-tool : The pure Flutter tool. Use as depends to build your package.

  • flutter-target-linux : The Flutter Linux build files. Use as depends to build your package.

  • flutter-target-web : The Flutter web build files. Use as depends to build web apps (e.g. fluffychat-web does this).

  • flutter-target-android : The Flutter Android build files. Use if you want to develop Android apps.

  • flutter-gradle : The Flutter Gradle wrapper. Populated from system Gradle.

  • flutter-intellij-patch : a tiny patch to make the IntelliJ Flutter plugin work with the new package.

  • flutter-material-fonts-google-bin : Mandatory fonts package, planned to have a system-installed drop-in replacement soon.

  • flutter-engine-common-google-bin : Shared part of the Flutter engine - downloaded from Google servers.

  • flutter-sky-engine-google-bin : Flutter sky engine - downloaded from Google servers.

  • flutter-engine-linux-google-bin : Linux part of the Flutter engine - downloaded from Google servers.

  • flutter-engine-web-google-bin : Web part of the Flutter engine - downloaded from Google servers.

  • flutter-engine-android-google-bin : Android part of the Flutter engine - downloaded from Google servers.

  • flutter-gradle-google-bin : The Flutter Gradle wrapper - downloaded from Google servers.

  • flutter-dart-google-bin : The Flutter original Dart SDK - downloaded from Google servers. This is helpful if the extra/dart package is not available in the right version on your distro or remix.

Stay tuned for non google-bin versions of the engine, they are in coming !

Since almost everything is written from scratch and heavy patches are applied to use the system packages as dependencies, there might still be bugs occurring. Please report them otherwise I can't fix them !

Latest Comments

« First ‹ Previous 1 .. 5 6 7 8 9 10 11 12 13 14 15 .. 25 Next › Last »

patlefort commented on 2024-03-25 21:38 (UTC)

Looking at the PKGBUILD, I don't think its compiling the engine from source, instead installs artefacts compiled by google. This would make it a binary package and I think people should be informed about it.

Reminder that I made package flutter-engine and flutter-engine-google-bin for packages that depends on flutter and give the user choice between compiling the engine from source or using pre-compiled binaries from google.

WithTheBraid commented on 2024-03-25 20:55 (UTC) (edited on 2024-05-10 11:45 (UTC) by WithTheBraid)

Huge update to the Flutter AUR package :

The previous implementation basically did a user installation of Flutter - downloaded the custom Dart SDK, CI artifacts from Chromium CI and had to be kept in user R/W access in order to have the Flutter Cache Manager working.

These times are now over - a clean and (almost) completely rewritten PKGBUILD which now uses clean dependency declarations, system Dart and Gradle and for sure no more user R/W installation directory.

This AUR entry is now a split package. Installing aur/flutter will still bundle the entire toolchain you knew from before. The other way round, if you don't need everything - e.g. when depending on Flutter as a build dependency in another package, you can choose to only depend on what you need.

The following split packages are available :

  • flutter : meta package containing all other split packages

  • flutter-common : the common files for Flutter needed for all use cases

  • flutter-devel : your option of choice as a developer - ships the Flutter tool and all required templates to e.g. create a new project

  • flutter-tool : The pure Flutter tool. Use as depends to build your package.

  • flutter-target-linux : The Flutter Linux build files. Use as depends to build your package.

  • flutter-target-web : The Flutter web build files. Use as depends to build web apps (e.g. fluffychat-web does this).

  • flutter-target-android : The Flutter Android build files. Use if you want to develop Android apps.

  • flutter-gradle : The Flutter Gradle wrapper. Populated from system Gradle.

  • flutter-intellij-patch : a tiny patch to make the IntelliJ Flutter plugin work with the new package.

  • flutter-material-fonts-google-bin : Mandatory fonts package, planned to have a system-installed drop-in replacement soon.

  • flutter-engine-common-google-bin : Shared part of the Flutter engine - downloaded from Google servers.

  • flutter-sky-engine-google-bin : Flutter sky engine - downloaded from Google servers.

  • flutter-engine-linux-google-bin : Linux part of the Flutter engine - downloaded from Google servers.

  • flutter-engine-web-google-bin : Web part of the Flutter engine - downloaded from Google servers.

  • flutter-engine-android-google-bin : Android part of the Flutter engine - downloaded from Google servers.

  • flutter-gradle-google-bin : The Flutter Gradle wrapper - downloaded from Google servers.

  • flutter-dart-google-bin : The Flutter original Dart SDK - downloaded from Google servers. This is helpful if the extra/dart package is not available in the right version on your distro or remix.

Stay tuned for non google-bin versions of the engine, they are in coming !

Since almost everything is written from scratch and heavy patches are applied to use the system packages as dependencies, there might still be bugs occurring. Please report them otherwise I can't fix them !

WithTheBraid commented on 2024-03-25 11:42 (UTC)

@sotoleni Thanks for the hint. I modified the package stage to only have a symlink to the /usr/bin/flutter - and have the modified flutter.sh directly in the installation folder. Additionally fixed the /usr/lib/flutter/bin/dart executable to be a symlink to the system Dart installation. This might fix issues when running dart run from the IDE terminal window. Additionally I sadly had to symlink /usr/lib/flutter/bin/cache/dart-sdk to /opt/dart-sdk since this relation is hard-coded into the Flutter IntelliJ plugin : https://github.com/flutter/flutter-intellij/blob/master/flutter-idea/src/io/flutter/sdk/FlutterSdkUtil.java#L231

sotoleni commented on 2024-03-25 10:11 (UTC)

A helpful tip for those using the Flutter plugin with VSCode:

When the plugin searches for the Flutter SDK, it looks in the "/usr/lib/flutter/" directory. Then, it attempts to run the Flutter executable found at "/usr/lib/flutter/bin/flutter". However, this action results in an error message that reads: "Error: The Flutter directory is not a clone of the GitHub project."

To resolve this issue, you can follow these steps:

Rename the original Flutter executable to keep it as a backup. To do this, execute the following command in your terminal: sudo mv /usr/lib/flutter/bin/flutter /usr/lib/flutter/bin/flutter.original

Next, copy the Flutter executable from the new AUR package installation to the expected location by running: sudo cp /usr/bin/flutter /usr/lib/flutter/bin/

After performing these steps, the Flutter plugin in VSCode should work correctly.

Would it be possible to include these adjustments in the AUR package to streamline the setup process for future users?

WithTheBraid commented on 2024-03-25 09:18 (UTC)

@hxzhao527 Thanks for your report. Being available despite great firewall blocking should have been considered as more important before. I apologize I didn't have this in mind. I now patched the PKGBUILD to respect the FLUTTER_STORAGE_BASE_URL environment variable.

WithTheBraid commented on 2024-03-25 09:08 (UTC)

@sotoleni Thanks for the hint, I fixed it and pushed a new patch. Thanks a lot for testing !

sotoleni commented on 2024-03-25 06:42 (UTC)

Hello,

congratulations for the new installation system. But, please fix this line of the patch:

system-dart.patch 127:+ final Directory devToolsDir = _fileSystem.directory(dartSdkRoot + 'bin/resources/devtools');

For this one with the slash before the bin: 127:+ final Directory devToolsDir = _fileSystem.directory(dartSdkRoot + '/bin/resources/devtools');

Thank you very much for your work!

silikeite commented on 2024-03-25 02:13 (UTC) (edited on 2024-03-25 02:17 (UTC) by silikeite)

Currently getting the following error when updating from an existing installation with the new build process:

[☠] Flutter (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not
      helpful, please let us know about this issue at
      https://github.com/flutter/flutter/issues.
    ✗ Exception: Could not find directory at /opt/dart-sdkbin/resources/devtools

Did a fresh uninstall/install and the error is still there. (Reverting to previous version resolves the issue).

hxzhao527 commented on 2024-02-28 12:31 (UTC)

In China, storage.googleapis.com maybe not available, according to the official document Using Flutter in China, I had to modify the PKGBUILD to do that:

diff --git a/PKGBUILD b/PKGBUILD
index fca6c4f..8b0d856 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -36,8 +36,15 @@ optdepends=("android-sdk: develop for Android devices"
 backup=("opt/${pkgname}/packages/${pkgname}_test/pubspec.yaml" "opt/${pkgname}/packages/${pkgname}/pubspec.yaml")
 options=("!emptydirs")
 install="${pkgname}.install"
+
+baseurl="https://storage.googleapis.com"
+if [[ -v FLUTTER_STORAGE_BASE_URL ]]; then
+  baseurl=${FLUTTER_STORAGE_BASE_URL}
+fi
+
+
 source=(
-  "${pkgname}-${pkgver}.tar.xz::https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/${pkgname}_linux_${pkgver/.hotfix/+hotfix}-stable.tar.xz"
+  "${pkgname}-${pkgver}.tar.xz::${baseurl}/flutter_infra_release/releases/stable/linux/${pkgname}_linux_${pkgver/.hotfix/+hotfix}-stable.tar.xz"
   "${pkgname}.sh"
   "${pkgname}.csh"
 )