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

Support nested dart sdk #259

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fb87
Copy link

@fb87 fb87 commented May 11, 2023

Some system like NixOS, the dart is nested within flutter/bin which leads to the error where dart will not be found as current implementation. This patch adds the flutter/bin/cache/dart-sdk/bin to the search paths along with flutter/bin. This is short term solution, for long term, IMO we can search for the executable dart within flutter/bin.

Signed-off-by: Si Dao <dao@singoc.com>
@akinsho
Copy link
Collaborator

akinsho commented May 12, 2023

Hi @fb87,

Is this problem specific to NixOS? there was also an attempt in #179 which frankly I didn't like the look of but this looks more robust than that. Generally I really want to avoid having logic for specific OSes, I really didn't but should have realised what a nasty rabbit hole I was getting into handling any of the path stuff for users and should frankly have just said something like make sure the binaries are in the $PATH for vim or use the full path. Anyway ship has sailed now.

I think rather than just adding another path to search I'd rather first see if the full path passed to the config can't work for Nix or anyone else who's path is more custom than what is already handled and if not see if theres some way to just expose something that the user can take control of and do with what they may rather than continue down the path of more and more edge cases for different OSes.

@fb87
Copy link
Author

fb87 commented May 13, 2023

The binaries (dart, flutter) are in the PATH already, the main issue is _flutter_sdk_dart_bin(...) returns the path of flutter/bin/dart.

IMO, we can introduce the other options which allows user to specify where the dart is, such as dart_sdk_path = "<full/path/if/needed>" or dart_lookup_cmd.

@akinsho
Copy link
Collaborator

akinsho commented May 14, 2023

IMO, we can introduce the other options which allows user to specify where the dart is, such as dart_sdk_path = "<full/path/if/needed>" or dart_lookup_cmd.

I think this would be good since hopefully the combination will close out all future requests for custom locations since users will now just be able to set it themselves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants