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

Flutter plugin breaks during precache #5258

Open
bepri opened this issue Feb 13, 2025 · 4 comments · May be fixed by #5264
Open

Flutter plugin breaks during precache #5258

bepri opened this issue Feb 13, 2025 · 4 comments · May be fixed by #5264
Assignees
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@bepri
Copy link
Contributor

bepri commented Feb 13, 2025

Bug Description

Currently, the Flutter plugin installs Flutter using an undocumented git-based method, which breaks due to what appear to be some internal forks to git in Flutter:

 :: + flutter precache --linux
::    Woah! You appear to be trying to run flutter as root.
::    We strongly recommend running the flutter tool without superuser privileges.
::   /
:: 📎
:: fatal: Not a valid object name origin/master

(note the last line especially)

The issue here is that we clone with -b stable, which means only the stable branch is present locally. Cloning the master branch instead gets us further, but still fails due to what appears to be the Flutter repository using a placeholder "0.0.0" version in that branch.

However, there is a Flutter snap, which does not appear to have any of these troubles.

We could, alternatively, rename the local remote stable to master as a workaround.

To Reproduce

Attempt to build anything with the Flutter plugin

Environment

Any version of Snapcraft

snapcraft.yaml

name: flutter-hello
version: "1.0"
summary: simple flutter application
description: build a flutter application using core22
base: core22
confinement: strict

apps:
  flutter-hello:
    command: "flutter_hello"
    extensions: [gnome]

parts:
  hello:
    source: .
    plugin: flutter

Relevant log output

:: + flutter precache --linux
::    Woah! You appear to be trying to run flutter as root.
::    We strongly recommend running the flutter tool without superuser privileges.
::   /
:: 📎
:: fatal: Not a valid object name origin/master

Additional context

No response

@bepri bepri self-assigned this Feb 13, 2025
@bepri bepri added bug Actual bad behavior that don't fall into maintenance or documentation triaged labels Feb 13, 2025
Copy link

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-4149.

This message was autogenerated

@bepri bepri changed the title Use Flutter snap in Flutter plugin Flutter plugin breaks during precache Feb 13, 2025
@munch-software
Copy link

Good day, is there any workaround for this issue in the meantime?

I have tried building without the Flutter plugin and tried to do things manually on the override-build step but run into all sorts of errors during runtime.

@mr-cal
Copy link
Collaborator

mr-cal commented Feb 18, 2025

Hi @munch-software, unfortunately we don't have a workaround, but we're planning to fix this ASAP - it should be resolved this week.

@bepri
Copy link
Contributor Author

bepri commented Feb 18, 2025

Relevant upstream issue: flutter/flutter#163198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants