Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

stuartmorgan-g
Copy link
Contributor

Anything with a transitive dependency on path_provider (which is a
lot) is broken on Flutter 1.26 due to Dart FFI changes. path_provider
2.0.0 doesn't have this problem, but for transitive dependencies that
means users need to force an override in their pubspec (and more
importantly, know that they need to do so).

This creates a new minor release to path_provider_windows that uses a
1.26-friendly version of FFI, but has the null safety changes and major
version bump backed out, so that transitive dependencies can safely
resolve to this working version just by doing a pub update.

Should help avoid issues like flutter/flutter#76705

Pre-launch Checklist

  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

Anything with a transitive dependency on `path_provider` (which is a
lot) is broken on Flutter 1.26 due to Dart FFI changes. path_provider
2.0.0 doesn't have this problem, but for transitive dependencies that
means users need to force an override in their pubspec (and more
importantly, know that they need to do so).

This creates a new minor release to path_provider_windows that uses a
1.26-friendly version of FFI, but has the null safety changes and major
version bump backed out, so that transitive dependencies can safely
resolve to this working version just by doing a pub update.
@stuartmorgan-g
Copy link
Contributor Author

I manually tested this by making a new project on Flutter master, adding path_provider: ^1.6.0, and trying to build (which failed as expected) then adding a dependency_overrides for path_provider_windows pointing to my local version of this, and successfully building.

@blasten
Copy link

blasten commented Mar 3, 2021

sgtm. The checks on the beta channel should be able to test the dependency resolution, right?

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes this work compares to 0.0.4+4? Is the only difference the min dart version? Does the sdk version resolve to a lower version when using 0.4.4+4?

@stuartmorgan-g
Copy link
Contributor Author

What makes this work compares to 0.0.4+4?

Pinning the ffi package to ^1.0.0

@stuartmorgan-g
Copy link
Contributor Author

Oh, I see the confusion. This isn't branched from 0.0.4, it's branched from master, so the important changes are not the diffs

@stuartmorgan-g
Copy link
Contributor Author

The checks on the beta channel should be able to test the dependency resolution, right?

The automated tests aren't going to test anything meaningful since this is only going to come into play when using path_provider 1.x. I could set up a special test on the branch maybe.

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stuartmorgan-g stuartmorgan-g force-pushed the path-provider-windows-prenull-compat branch from 569a4b7 to 1ad924e Compare March 3, 2021 18:18
@stuartmorgan-g
Copy link
Contributor Author

stuartmorgan-g commented Mar 3, 2021

Oops, I forgot to push the reversion to path_provider_platform_interface: ^1.0.3. I expect this to break automated tests, since it won't interoperate with all the current versions of the plugins (and isn't meant to). It's needed to actually work with path_provider 1.6.

@stuartmorgan-g stuartmorgan-g merged commit 7564db9 into flutter:path-provider-windows-0-0-5 Mar 3, 2021
@stuartmorgan-g stuartmorgan-g deleted the path-provider-windows-prenull-compat branch March 3, 2021 18:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants