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
Set FLUTTER_ROOT automatically to simplify running flutter_tools tests #4427
Currently you may have to set the FLUTTER_ROOT variable manually in launch.config/dart.env when running flutter_tools tests.
Since we know where the SDK is, perhaps we could just always set this when starting the Flutter debug adapters, as long as there isn't already one defined?
@christopherfujino can you see any cases where this wouldn't do the right thing?
changed the title [-]Set FLUTTER_TOOL automatically to simplify running flutter_tools tests[/-][+]Set FLUTTER_ROOT automatically to simplify running flutter_tools tests[/+]on Mar 7, 2023
@christopherfujino can you see any cases where this wouldn't do the right thing?
Can't think of anything wrong with this. To clarify, my understanding is that Dart-Code tracks an absolute path to the Flutter SDK checkout, and it invokes the flutter tool by absolute path? In this case, I think it would be safe (and ideal) to always provide FLUTTER_ROOT=ABSOLUTE_FLUTTER_SDK_PATH when invoking the tool.
To clarify, my understanding is that Dart-Code tracks an absolute path to the Flutter SDK checkout
Not specifically to the checkout (edit: I guess it's always a checkout with Flutter, it's not like Dart where I have a release SDK + source code separately), but to the SDK it found (via PATH, settings, whatever).
I didn't want to set it too aggressively in case it might impact things unexpectedly (for example what if you have a Flutter SDK that isn't the one you're hacking on), so I decided to set it only in the case where you have an open folder that is also inside the SDK that we detected (so if you open the repo root, or flutter_tools, etc., and there is no other FLUTTER_ROOT set).
Activity
[-]Set FLUTTER_TOOL automatically to simplify running flutter_tools tests[/-][+]Set FLUTTER_ROOT automatically to simplify running flutter_tools tests[/+]christopherfujino commentedon Mar 7, 2023
Can't think of anything wrong with this. To clarify, my understanding is that Dart-Code tracks an absolute path to the Flutter SDK checkout, and it invokes the
fluttertool by absolute path? In this case, I think it would be safe (and ideal) to always provideFLUTTER_ROOT=ABSOLUTE_FLUTTER_SDK_PATHwhen invoking the tool.christopherfujino commentedon Mar 7, 2023
Cool, you merged it already :)
DanTup commentedon Mar 7, 2023
Not specifically to the checkout(edit: I guess it's always a checkout with Flutter, it's not like Dart where I have a release SDK + source code separately), but to the SDK it found (via PATH, settings, whatever).I didn't want to set it too aggressively in case it might impact things unexpectedly (for example what if you have a Flutter SDK that isn't the one you're hacking on), so I decided to set it only in the case where you have an open folder that is also inside the SDK that we detected (so if you open the repo root, or flutter_tools, etc., and there is no other FLUTTER_ROOT set).
I've pushed a new pre-release build of the Dart extension so if you're using that, you can remove any dart.env or launch.json value you have for this and see if it's all good. If so, we could simplify https://github.com/flutter/flutter/wiki/The-flutter-tool#debugging-the-flutter-command-line-tool-in-vs-code.
Set FLUTTER_ROOT automatically when working in the Flutter SDK