Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve error message when installing plugins #150

Open
Giuspepe opened this issue Dec 16, 2022 · 1 comment
Open

Improve error message when installing plugins #150

Giuspepe opened this issue Dec 16, 2022 · 1 comment
Labels
sidekick_core https://pub.dev/packages/sidekick_core

Comments

@Giuspepe
Copy link
Contributor

During installation of plugins we use sidekickDartRuntime to run pub get to download the dependencies of the plugin's installer. sidekickDartRuntime may depend on a different Dart SDK version than the actual sidekick CLI does. This may lead to an error like the following:

Process `/var/folders/c0/vw17q1tx6k50xkmzl4wx1pbh0000gn/T/iH2gEe/dashi sidekick plugins install flutterw_sidekick_plugin` exited with exitCode 255. Output:

    Installing flutterw_sidekick_plugin   for dashi
    Downloading from pub flutterw_sidekick_plugin...
    Running sidekickDartRuntime.dart with dart at /private/var/folders/c0/vw17q1tx6k50xkmzl4wx1pbh0000gn/T/iH2gEe/packages/dashi_sidekick/build/cache/dart-sdk/bin/dart
    Running sidekickDartRuntime.dart with dart at /private/var/folders/c0/vw17q1tx6k50xkmzl4wx1pbh0000gn/T/iH2gEe/packages/dashi_sidekick/build/cache/dart-sdk/bin/dart
    Installer downloaded
    Preparing flutterw_sidekick_plugin installer...
    Running sidekickDartRuntime.dart with dart at /private/var/folders/c0/vw17q1tx6k50xkmzl4wx1pbh0000gn/T/iH2gEe/packages/dashi_sidekick/build/cache/dart-sdk/bin/dart
    The current Dart SDK version is 2.14.0.
    
    Because dart_style >=2.2.0 <2.2.1 depends on analyzer ^2.0.0 and dart_style >=2.2.1 <2.2.2 depends on analyzer >=2.6.0 <4.0.0, dart_style >=2.2.0 <2.2.2 requires analyzer >=2.0.0 <4.0.0.
    And because dart_style >=2.2.2 <2.2.3 depends on analyzer ^3.3.1, dart_style >=2.2.0 <2.2.3 requires analyzer >=2.0.0 <4.0.0.
    And because dart_style >=2.2.3 <2.2.4 depends on analyzer >=3.3.1 <5.0.0 and dart_style >=2.2.4 requires SDK version >=2.17.0 <3.0.0, dart_style >=2.2.0 requires analyzer >=2.0.0 <5.0.0.
    So, because flutterw_sidekick_plugin depends on both analyzer ^5.0.0 and dart_style ^2.2.0, version solving failed.
[e] Unhandled exception:
[e] /private/var/folders/c0/vw17q1tx6k50xkmzl4wx1pbh0000gn/T/iH2gEe/packages/dashi_sidekick/build/cache/dart-sdk/bin/dart pub get 
[e] exit: 1

The sidekick CLI is using Dart SDK version 2.18, so it should be able to use the plugin. However, because its sidekickDartRuntime is on Dart SDK version 2.14, pub get fails.

A clearer error message should be printed in this case. The solution would be to update the sidekickDartRuntime's Dart SDK version (see #149)

@Giuspepe Giuspepe added the sidekick_core https://pub.dev/packages/sidekick_core label Dec 16, 2022
@passsy
Copy link
Contributor

passsy commented Dec 17, 2022

Idea: Add a sidekick upgrade-embedded-sdk command, we can print to overcome such issues. Exactly what you wrote in #149

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
sidekick_core https://pub.dev/packages/sidekick_core
Projects
None yet
Development

No branches or pull requests

2 participants