You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't prompt for Dart SDK updates when Dart SDK is found from a symlink in a Flutter SDK #5127
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:
Describe the solution you'd like
I'd like the following option to stop being a boolean value and having an array of options:
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.
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.
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?
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).
Either a Dart-only project or a Flutter project both still show the message for the latest stable Flutter:
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.
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)?
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?
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).
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.
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).
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:
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).
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.
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
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
Activity
FMorschel commentedon Jun 20, 2024
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.
DanTup commentedon Jun 20, 2024
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 toDartin the Status bar) show?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).
FMorschel commentedon Jun 20, 2024
Either a Dart-only project or a Flutter project both still show the message for the latest stable Flutter:

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 doctorDanTup commentedon Jun 20, 2024
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 fromPATHwould make things inconsistent). We should be finding your Flutter SDK first, and then taking the Dart SDK frombin\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)?
FMorschel commentedon Jun 20, 2024
Here it is:
dart-code-startup-log-786b.txt
DanTup commentedon Jun 20, 2024
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.exethat 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?
DanTup commentedon Jun 20, 2024
I guess it's probably this from the readme:
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).
FMorschel commentedon Jun 20, 2024
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.DanTup commentedon Jun 20, 2024
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 thedart.flutterSdkPathinto 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!
FMorschel commentedon Jun 20, 2024
Yes, exactly it. It downloads and manages them for us. When running
puro use environmentit 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: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).
DanTup commentedon Jun 20, 2024
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.
[-]"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[/+][-]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[/+]Consider Dart as from Flutter if either original or symlink-resolved …