Skip to content

Commit

Permalink
fix: correct git errors in flutter plugin (#5264)
Browse files Browse the repository at this point in the history
  • Loading branch information
bepri authored Feb 19, 2025
1 parent f36284b commit 3e9d22f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/release-notes/snapcraft-8-7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ patch releases.
See individual issue links for any mitigations.

- `#4996`_ Remote build gives an unfriendly error when attempting to cross-compile.
- `#5258`_ The Flutter plugin fails to install Flutter for ``core22`` and ``core24``
snaps.


Fixed bugs and issues
---------------------

The following issues have been resolved in Snapcraft 8.7:

- `#5258`_ The Flutter plugin failed to install Flutter for ``core22`` and ``core24``
snaps.
- `#5250`_ Resources path for ``QtWebEngineProcess`` wasn't exported for snaps
using the KDE Neon 6 extension.
- `craft-parts#978`_ The ``source-subdir`` field was ignored for the
Expand Down
5 changes: 5 additions & 0 deletions snapcraft/parts/plugins/flutter_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""The flutter plugin."""

from typing import Literal, cast

from craft_parts import infos, plugins
Expand Down Expand Up @@ -85,6 +86,10 @@ def _get_setup_flutter(self, options) -> list[str]:
return [
# TODO detect changes to plugin properties
f"git clone --depth 1 -b {options.flutter_channel} {FLUTTER_REPO} {self.flutter_dir}",
# Workaround for flutter#163308
# Deletion of this file avoids an if statement that causes the following commands to
# fail
f"rm {self.flutter_dir}/engine/src/.gn",
"flutter precache --linux",
"flutter pub get",
]
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/parts/plugins/test_flutter_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_get_build_commands(part_info):
assert plugin.get_build_commands() == [
"git clone --depth 1 -b stable https://github.com/flutter/flutter.git "
f"{plugin.flutter_dir}",
f"rm {plugin.flutter_dir}/engine/src/.gn",
"flutter precache --linux",
"flutter pub get",
"flutter build linux --release --verbose --target lib/main.dart",
Expand All @@ -81,6 +82,7 @@ def test_get_build_commands_alternative_target(part_info):
assert plugin.get_build_commands() == [
f"git clone --depth 1 -b stable https://github.com/flutter/flutter.git "
f"{plugin.flutter_dir}",
f"rm {plugin.flutter_dir}/engine/src/.gn",
"flutter precache --linux",
"flutter pub get",
"flutter build linux --release --verbose --target lib/not-main.dart",
Expand All @@ -98,6 +100,7 @@ def test_get_build_commands_different_channels(part_info, value):
assert plugin.get_build_commands() == [
f"git clone --depth 1 -b {value} https://github.com/flutter/flutter.git "
f"{plugin.flutter_dir}",
f"rm {plugin.flutter_dir}/engine/src/.gn",
"flutter precache --linux",
"flutter pub get",
"flutter build linux --release --verbose --target lib/main.dart",
Expand Down

0 comments on commit 3e9d22f

Please sign in to comment.