Skip to content

Don't prompt for Dart SDK updates when Dart SDK is found from a symlink in a Flutter SDK #5127

Closed

Description

@FMorschel

Is your feature request related to a problem? Please describe.
Flutter 3.22.1 at this current date, is using Dart 3.4.1 while Dart 3.4.2 is already released.

Every project I open I receive this warning:
image

Describe the solution you'd like
I'd like the following option to stop being a boolean value and having an array of options:
image

Options like:

  • Always
  • Latest Flutter bundled
  • Never

Describe alternatives you've considered
Waiting for a new Flutter release and hope that it syncs again while the Dart SDK doesn't release another update.

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on May 30, 2024
  2. FMorschel commented on Jun 20, 2024

    @FMorschel
    ContributorAuthor

    Since I created this and #5126 almost at the same time, maybe you missed this as well. Sorry for the ping, I was just not sure you ever saw this, @DanTup.

  3. DanTup commented on Jun 20, 2024

    @DanTup
    Member

    Thanks - I had not seen this. I'll review the issue list, seems I didn't get email notifications for some of these.

    I raised this in #4976 but was unable to reproduce it, and I couldn't find a code path for it (we are never supposed to prompt about Dart SDK versions when the Dart SDK is from Flutter).

    Can you still reproduce this? What does the language status (click the {} next to Dart in the Status bar) show?

    image

    And is the project you have open a Flutter or Dart project? (You can still use the Dart SDK from the Flutter SDK for a Dart project, and also still should not prompt).

  4. added
    awaiting infoRequires more information from the customer to progress
    on Jun 20, 2024
  5. FMorschel commented on Jun 20, 2024

    @FMorschel
    ContributorAuthor

    Either a Dart-only project or a Flutter project both still show the message for the latest stable Flutter:
    image

    image

    Not sure but if you can't reproduce it maybe it has something to do with the current SDK not being in my path (using puro)

    flutter doctor

    [!] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.22631.3737], locale pt-BR)
        ! Warning: `dart` on your path resolves to C:\Users\felip_0vh5fa6\.puro\shared\caches\dd37cefd4a94c91032a2e99bf4ca83c81425ed9d\dart-sdk\bin\dart.exe, which is not inside your current Flutter SDK
          checkout at C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter. Consider adding C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter\bin to the front of your path.
    [√] Windows Version (Installed version of Windows is version 10 or higher)
    [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.5)
    [√] Android Studio (version 2024.1)
    [√] VS Code (version 1.90.1)
    [√] VS Code (version 1.88.0-insider)
    [√] Connected device (4 available)
    [√] Network resources
    
    ! Doctor found issues in 1 category.
  6. DanTup commented on Jun 20, 2024

    @DanTup
    Member

    Not sure but if you can't reproduce it maybe it has something to do with the current SDK not being in my path (using puro)

    ! Warning: `dart` on your path resolves to C:\Users\felip_0vh5fa6\.puro\shared\caches\dd37cefd4a94c91032a2e99bf4ca83c81425ed9d\dart-sdk\bin\dart.exe, which is not inside your current Flutter SDK
         checkout at C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter. Consider adding C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter\bin to the front of your path.
    
    

    Generally the extension doesn't care what's on your PATH. Besides locating an initial SDK, we shouldn't use it (because we allow overriding it and using anything from PATH would make things inconsistent). We should be finding your Flutter SDK first, and then taking the Dart SDK from bin\cache\dart-sdk.

    Can you confirm there is a normal Dart SDK at C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter\bin\cache\dart-sdk?

    If you open VS Code (and a project where this happens), then immediately run the Dart: Open Extension Log command, it'll open a log file that should detail the search for SDKs that might help. Are you able to share that (be sure to remove anything sensitive)?

  7. FMorschel commented on Jun 20, 2024

    @FMorschel
    ContributorAuthor
  8. DanTup commented on Jun 20, 2024

    @DanTup
    Member

    Thanks! I think this is the problem:

    Following symlink: C:\Users\user.puro\envs\stable\flutter\bin\cache\dart-sdk\bin\dart.exe -> C:\Users\user.puro\shared\caches\edd8546116457bdf1c5bdfb13ecb9463d2bb5ed4\dart-sdk\bin\dart.exe

    Your Flutter SDK has a symlink at C:\Users\user\.puro\envs\stable\flutter\bin\cache\dart-sdk\bin\dart.exe that points to another location. This is not a configuration we support - we assume the Flutter SDK is complete as Flutter would create it. In this case, we're using a Dart SDK that is not inside the Flutter SDK, and therefore treat it as a standalone SDK.

    I'm not very familiar with Puro - do you know why it's symlinking this or whether you can control it?

  9. DanTup commented on Jun 20, 2024

    @DanTup
    Member

    I guess it's probably this from the readme:

    It also uses symlinks to share the same engine version between multiple installations:

    I don't like this - it breaks assumptions we make. However if this prompt is the only issue caused by it, then it might be worth handling this case.

    Out of interest - what does Puro do for you that the built-in SDK switching in the Dart extension doesn't? (I often switch between versions of both Dart and Flutter SDKs and built-in support to make it fairly easy).

  10. FMorschel commented on Jun 20, 2024

    @FMorschel
    ContributorAuthor

    In my company we have, as of right now, 5 different apps in production and 1 in development. We have set a different puro environment for each.

    flutter/flutter#148692 is an example of cases we'd like to avoid.

    While some of our projects were not implementing TextEditingControllers, others were. The ones that would break we stationed until there were a fix and the others we upgraded to the latest stable.

  11. DanTup commented on Jun 20, 2024

    @DanTup
    Member

    We have set a different puro environment for each.

    I'm not familiar with Puro so it's not obvious to me how this differs to setting the SDK in VS Code. For example if you had your SDKs at ~/flutter/(version) and committed the dart.flutterSdkPath into each projects .vscode/settings.json, what would you be missing?

    I guess you'd have to set the SDKs up manually whereas I presume Puro does that for you - but I wonder if it does anything else? There are a number of version mangers out there and they all have their own slightly-different quirks and often lead to issues (like this one) so it's useful for me to understand the reasons people use them (because it might impact how things work here).

    Thanks!

  12. FMorschel commented on Jun 20, 2024

    @FMorschel
    ContributorAuthor

    Yes, exactly it. It downloads and manages them for us. When running puro use environment it replaces those values you mentioned for both vsCode and IntelliJ. It's also a little bit easier to manage them when you can run, say:

    pruo upgrade env1 stable
    puro upgrade env2 3.22.1
    puro upgrade edge master
    puro upgrade beta beta

    That would be like going to those specific environment folders you suggested and upgrading them.

    At least in my company this is all it does for us at the moment. There may be some other current use cases if you take a look at some closed issues or potentially new cases in open ones.

    One thing I've not yet tried to do was to benchmark the download/install time for puro or flutter alone, but here at their website they talk about it being faster (they explain how just under this part).

  13. DanTup commented on Jun 20, 2024

    @DanTup
    Member

    Gotcha, thanks for the insight.

    I've pushed a fix so we'll check both the original path and the resolved path to see if it's a Flutter SDK. I couldn't get Puro working (I filed an issue in their GH for this) but I created a symlink manually and could repro the issue before my fix, but not without.

    I can't promise there won't be other issues with this kind of setup, but I assume if there were you'd have seen them by now.

  14. added
    in flutterRelates to running Flutter apps
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jun 20, 2024
  15. added this to the v3.92.0 milestone on Jun 20, 2024
  16. changed the title [-]"Check for SDK updates" option to check for latest Flutter bundled[/-] [+]Don't prompt for SDK updates when Dart SDK is found from a symlink in a Flutter SDK[/+] on Jun 20, 2024
  17. changed the title [-]Don't prompt for SDK updates when Dart SDK is found from a symlink in a Flutter SDK[/-] [+]Don't prompt for Dart SDK updates when Dart SDK is found from a symlink in a Flutter SDK[/+] on Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in flutterRelates to running Flutter appsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions