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

feat: shorebird should support older flutter versions #472

Closed
eseidel opened this issue May 11, 2023 · 25 comments
Closed

feat: shorebird should support older flutter versions #472

eseidel opened this issue May 11, 2023 · 25 comments
Assignees

Comments

@eseidel
Copy link
Contributor

eseidel commented May 11, 2023

Currently shorebird is tied to a specific flutter revision. Which also means that its tied to a specific Flutter engine and Dart VM version.

Dart snapshots are not stable between Dart revisions. Flutter includes Dart snapshots (inside libapp.so) in your application. So when you do a release with Flutter or Shorebird, if you wish to later patch that release with Shorebird, you have to do it from an exactly matching Dart revision (implying a matching Flutter and matching Shorebird revision).

shorebird does not need to be tightly coupled to a single flutter release. We could offer fvm-like functionality, of downloading different versions of Flutter per project.

If we did this, then it would be possible for us to release a new version of Shorebird, which depend on a new version of Flutter without worrying that users then have to take explicit action to downgrade their version of Shorebird in order to patch older apps in the wild.

Presumably if we did this we would only support a limited set of older flutter revisions, and only back to some certain point, as we do currently maintain (very small) patches on top of Flutter which we might have to also maintain on older branches of Flutter in this model.

@eseidel eseidel converted this from a draft issue May 11, 2023
@eseidel eseidel removed the status in 0.2.1 : 100 users May 11, 2023
@eseidel
Copy link
Contributor Author

eseidel commented May 11, 2023

I expect we will do this, possibly soon. Right now we're prioritizing other work on the assumption that our users in production are comfortable being on limited to 3.10 for now. (Or comfortable manually checking out an older release of shorebird when needed.) When Dart does another breaking release (likely ~3 months or so from now judging from past schedules) we will need this.

Please feel welcome to 👍 if you need this sooner, or have other needs for older revisions.

@SpajicM
Copy link

SpajicM commented May 12, 2023

Presumably if we did this we would only support a limited set of older flutter revisions, and only back to some certain point, as we do currently maintain (very small) patches.

Does this only depend on what the customer is building with, or does something on Shorebird server side also has to match?

I'd say user being able to (try to) pick any version is ideal, though download and cherry-pick script.

@eseidel
Copy link
Contributor Author

eseidel commented May 12, 2023

Shorebird's servers can support a range of shorebird command line and updater versions.

The work here is to make shorebird command line interface with a range of flutter command line versions safely as well as publish Shorebird engine artifacts for a range of Flutter engine versions (which is the larger part of work). Thankfully Shorebird's changes to the Flutter engine are very small and so it should be straightforward to patch them to (even very old) Flutter versions, just will require some work on our part to build and test such.

@eseidel
Copy link
Contributor Author

eseidel commented May 12, 2023

Such a system could also let us more easily track Flutter channels (including beta and master).

@felangel felangel moved this to 1.0.0 in 0.2.1 : 100 users May 18, 2023
@felangel felangel self-assigned this May 25, 2023
@felangel felangel moved this from 1.0.0 to In Progress in 0.2.1 : 100 users May 25, 2023
@eseidel eseidel moved this from In Progress to Punted in 0.2.1 : 100 users Jun 9, 2023
@eseidel
Copy link
Contributor Author

eseidel commented Jul 10, 2023

Update:
Whenever we create a Release we save the exact hash of the Flutter version used to create such. This is to allow us to later pull that exact release when creating a patch (we don't support that yet, but that's what this bug is about).

Remaining work involves:

  • Moving our builds into the cloud: feat: automate building of shorebird's engine in the cloud #804 (so that "build another version" becomes a money problem rather than a time problem).
  • Set up at least basic testing of release versions in the cloud (currently most of our testing is manual).
  • Verify we've correctly automated creation of branches (e.g. flutter_releases/2.10.3) based on a flutter tag + our shorebird stack of patches. We believe this is mostly working today, but need to check.
  • Do the manual work to create alternative patches for points in the release history where our patch stack breaks (e.g. when Flutter moved from build.gradle to build.groovy) and teaching our "create a release branch from this patch stack + flutter version" about the existence of such alternatives.

@eseidel
Copy link
Contributor Author

eseidel commented Jul 27, 2023

There may be stages we can do to fix this.

  1. Fix just for patching. Where we automatically download the flutter you released with (since it's necessarily an existing Shorebird Flutter).
  2. Fix for releasing for existing Flutter releases (I'm not sure what the UI for this would look like?)
  3. Fix for a wider set of Flutter versions for releases.

@felangel seemed to think #1 was just a few hours of work. I think #2 probably just as easy, just requires some UI decisions. #3 is weeks of work (as described above).

@Ifeanyiejindu
Copy link

Hello guys, I just added shorebird to my flutter project and it is throwing a lot of errors while building although my normal flutter release build is working perfectly. I did shorebird doctor and realised that it is running flutter 3.10.2 while I am running flutter 3.7.12. Is there a way to make shorebird run same version as my system Flutter?

@eseidel
Copy link
Contributor Author

eseidel commented Jul 29, 2023

Hello guys, I just added shorebird to my flutter project and it is throwing a lot of errors while building although my normal flutter release build is working perfectly. I did shorebird doctor and realised that it is running flutter 3.10.2 while I am running flutter 3.7.12. Is there a way to make shorebird run same version as my system Flutter?

Shorebird currently only supports the latest released version of Flutter. This bug is about adding support for older versions. We hope to address it soon, but for now to use Shorebird requires being the app to be able to build with the latest stable Flutter.

@Ifeanyiejindu
Copy link

Hello guys, I just added shorebird to my flutter project and it is throwing a lot of errors while building although my normal flutter release build is working perfectly. I did shorebird doctor and realised that it is running flutter 3.10.2 while I am running flutter 3.7.12. Is there a way to make shorebird run same version as my system Flutter?

Shorebird currently only supports the latest released version of Flutter. This bug is about adding support for older versions. We hope to address it soon, but for now to use Shorebird requires being the app to be able to build with the latest stable Flutter.

Thanks for the reply. I am hoping this is done soon because, in reality, most folks won't keep updating their Flutter version and fighting dependency conflicts in order to use Shorebird on it. Just an honest review. I love the product and excited about it but this will be a major blocker for me at the moment.

@eseidel eseidel moved this from Backlog to Todo in Adoption Blockers Jul 31, 2023
@MRSEREY
Copy link

MRSEREY commented Aug 1, 2023

I cannot use Shorebird with older flutter version.
Flutter 2.8.1 • channel stable

Please kindly make it work for Flutter older versions

@felangel
Copy link
Contributor

felangel commented Aug 4, 2023

Shorebird now supports patching older releases 🎉
Created #1037 to track the remaining work needed to support switching flutter versions for releases.

@Ifeanyiejindu
Copy link

Shorebird now supports patching older releases 🎉 Created #1037 to track the remaining work needed to support switching flutter versions for releases.

does this mean that Shorebird supports older versions of Flutter at the moment?

@eseidel
Copy link
Contributor Author

eseidel commented Aug 4, 2023

Shorebird now correctly lets you patch existing applications which you released with a previous version of Shorebird (and thus Flutter).

Shorebird does not yet support releasing new applications with older versions of Flutter, only patching existing applications which have already been released with an older version of Flutter/Shorebird. #1037 tracks remaining work to support releasing new applications with older versions of Flutter.

@Ifeanyiejindu
Copy link

Shorebird now correctly lets you patch existing applications which you released with a previous version of Shorebird (and thus Flutter).

Shorebird does not yet support releasing new applications with older versions of Flutter, only patching existing applications which have already been released with an older version of Flutter/Shorebird. #1037 tracks remaining work to support releasing new applications with older versions of Flutter.

oh great. Thanks for the clarity. Waiting on the feature supporting releasing new applications with older flutter versions to be released. Thanks.

@eseidel
Copy link
Contributor Author

eseidel commented Aug 15, 2023

I've also filed #1100 to track adding support for more versions now that we have the client-side infrastructure to do so. We still need to add the build infrastructure.

@waqadArshad
Copy link

@eseidel We'll greatly appreciate it if we can build with a specific Flutter version because some big old projects are stable on specific Flutter versions (not so old but not the latest). This really will be problematic for a lot of us to adopt Shorebird even though it is a lifesaver. We appreciate the incredible work you guys have done. Thanks a lot for your efforts.

@felangel
Copy link
Contributor

felangel commented Oct 2, 2023

@eseidel We'll greatly appreciate it if we can build with a specific Flutter version because some big old projects are stable on specific Flutter versions (not so old but not the latest). This really will be problematic for a lot of us to adopt Shorebird even though it is a lifesaver. We appreciate the incredible work you guys have done. Thanks a lot for your efforts.

Which versions do you need?

@martin-bertele
Copy link

I have flutter installed only via fvm and run into shorebird doctor error "[✗] Flutter install is correct /
[✗] Failed to determine path Flutter version. FlutterValidationException: Flutter version check did not complete successfully. /bin/sh: flutter: command not found"
Even though from .zshrc my "alias flutter="fvm flutter" works fine in the project, the flutter command is detected.

how are shorebird and fvm supposed to play together ?

@eseidel
Copy link
Contributor Author

eseidel commented Oct 10, 2023

I have flutter installed only via fvm and run into shorebird doctor error "[✗] Flutter install is correct / [✗] Failed to determine path Flutter version. FlutterValidationException: Flutter version check did not complete successfully. /bin/sh: flutter: command not found" Even though from .zshrc my "alias flutter="fvm flutter" works fine in the project, the flutter command is detected.

how are shorebird and fvm supposed to play together ?

Thanks. Filed #1385. Please don't ever hesitate to file additional issues as desired.

@waqadArshad
Copy link

@eseidel We'll greatly appreciate it if we can build with a specific Flutter version because some big old projects are stable on specific Flutter versions (not so old but not the latest). This really will be problematic for a lot of us to adopt Shorebird even though it is a lifesaver. We appreciate the incredible work you guys have done. Thanks a lot for your efforts.

Which versions do you need?

Hi, sorry for the delayed response. I had a project running with 3.3.1 but when I checked the Supported Flutter Versions, I realized that the real magic starts from 3.10.6 given that the ios support and code push support starts after 3.10.6. So I upgraded my project to 3.10.6.

It would still be preferred that you start supporting more versions soon if that's not a big ask. and Thanks for getting back to me. I appreciate that.

@eseidel
Copy link
Contributor Author

eseidel commented Oct 10, 2023

I've updated our docs a bit to note that while we support 3.10.0 and newer the builds that we offer for 3.10.0 were made at the time of those releases and have not been updated since with newer shorebird features. They mostly exist to allow individuals to update existing apps that they already published with those (now months old) versions of Shorebird. If possible, I would encourage you to update all the way to the latest Flutter stable (which is where all the latest Shorebird features are added):
https://docs.shorebird.dev/flutter-version#supported-flutter-versions

Best of luck!

@eahb0y
Copy link

eahb0y commented Nov 13, 2023

Hello every one. I have some problems with shorebird, when I run command
"shorebird patch android" I catch the error
(Exception: Failed to create diff:).
Does someone found solution? I will be glade if someone helps me.

@lindrrow-gh
Copy link

lindrrow-gh commented Aug 20, 2024

Hi @eseidel, will shorebird support 2.x.x version or at least the highest version of it, 2.10.5? Our project is at 2.x.x and we would love to use shorebird but transitioning the flutter version from 2.x.x to 3.10.0 or higher version is a struggle since our project is big and a lot of breaking changes to fix, and also unsupported packages that we also use have no alternatives.

@eseidel
Copy link
Contributor Author

eseidel commented Aug 20, 2024

I think it's highly unlikely that Shorebird Code Push will be supported on Flutter 2.x.x anytime soon, if ever. Flutter 3 was released May 12, 2022, about 9 months before Shorebird started as a company. Flutter 3.10.x was the earliest version of Flutter Shorebird Code Push has ever supported.

@lindrrow-gh
Copy link

Oww I see. Nevertheless, thank you for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Punted
Status: Done
Development

No branches or pull requests

9 participants