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

Make pub aware of used platforms #3932

Closed
wujek-srujek opened this issue May 28, 2023 · 2 comments
Closed

Make pub aware of used platforms #3932

wujek-srujek opened this issue May 28, 2023 · 2 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@wujek-srujek
Copy link

I'm writing a mobile app with Flutter and I'm using packages (wakelock and package_info_plus) that in their most recent versions have a conflict in their win32 dependency. For this reason, my project fails to resolve dependencies, even though I don't care about Windows at all (this is a fact and won't change, the app makes no sense on the desktop).

Pub could know about the platforms my project supports (I specify them when I create a new project with flutter create --platforms ...) and then it could decide to not report error conditions for irrelevant ones.

@sigurdm sigurdm added the type-enhancement A request for a change that isn't a bug label May 30, 2023
@sigurdm
Copy link
Contributor

sigurdm commented May 30, 2023

There was a push once to base resolution on "features" that could be enabled/disabled, but we have left that behind.
The main reasons:

  • Added complexity
    While there might be a few times like this where a platform-specific dependency would save the day,
    it comes at the cost of a cognitive overhead of enabling/disabling features, and also the implementation
    cost in the pub client.
  • Doesn't work well with the language
    Currently Dart has only very limited support for compile-time conditional inclusion. There are conditional imports, but they only condition on library-availability (web vs. non-web).
  • Usually it helps everybody more if there is a bigger push to keep packages compatible and up-to-date.

Hopefully the packages in question will soon be updated to be compatible, or you can try to use a dependency_overrides to force a version.

@sigurdm
Copy link
Contributor

sigurdm commented May 30, 2023

Will close this for now, as I don't think we currently have any plans to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants