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

SDK path detection on Linux / Mac is not reliable #17

Closed
hentoesch opened this issue Aug 4, 2016 · 6 comments
Closed

SDK path detection on Linux / Mac is not reliable #17

hentoesch opened this issue Aug 4, 2016 · 6 comments
Assignees
Milestone

Comments

@hentoesch
Copy link

package installs successfully, after restart i get error message that sdk is not on path and must be configured in settings.
i have dart sdk in PATH and configuration of sdk in settings is not possible.

@DanTup
Copy link
Member

DanTup commented Aug 5, 2016

i have dart sdk in PATH

My guess is that this is the same issue I had when testing; you have something like /usr/bin in PATH which has a dart symlink. This means the actual Dart SDK location (/usr/lib/dart?) is not in PATH. I'll try and put a fix in for this today (by either searching the default install location when using Google's apt package, or detecting a dart executable and if it's a symlink, resolving it).

configuration of sdk in settings is not possible

If you do File -> User Preferences (or whatever the equiv is) you should get a split pain of JSON (left is defaults, right is your overrides). If you start typing dart as a new value on the right, you don't get auto-complete for dart.sdkPath? If you do, add "dart.sdkPath": "/usr/lib/dart" (or whatever the real path is - it needs to be such that the folder contains bin/snapshots/analysis_server.dart.snapshot exists inside the configured sdkPath).

@hentoesch
Copy link
Author

hentoesch commented Aug 5, 2016

i did have /usr/bin AND /usr/lib/dart/bin in my PATH (but in that respective order).
after changing the order in .bashrc, so that /usr/lib/dart/bin was first, the error message did not go away.

i think the problem is that my PATH config is /usr/lib/dart/bin and you are awaiting /usr/lib/dart (without the bin).

editing the User Preferences and specifying /usr/lib/dart as sdkpath did make the error message disappear.

@DanTup
Copy link
Member

DanTup commented Aug 5, 2016

In PATH I assume it's to the bin folder (else dart wouldn't work) but assume the sdkPath is root, but maybe something isn't working quite as expected. Glad you got it working be setting sdkPath, but I will definitely make some improvements in this area. If Dart is on your path in any form I should be able to use it and not force you to have to enter it (though for now, specifying it will improve startup performance until I do #8).

Thanks for the feedback and responses; really appreciate it!

@DanTup
Copy link
Member

DanTup commented Aug 5, 2016

Just occurred to me, the reason it failed to search path was nothing to do with symlinks, it's because the path delimiter on Linux is different! This will all be fixed before next release.

@DanTup DanTup added the good first issue :octocat: A relatively straight forward issue that could be done by a new contributor label Aug 5, 2016
@DanTup DanTup added this to the 0.5.0 milestone Aug 5, 2016
@DanTup DanTup self-assigned this Aug 5, 2016
@DanTup DanTup changed the title ubuntu 16.04, cannot find sdk path SDK path detection on Linux / Mac is not reliable Aug 5, 2016
@DanTup
Copy link
Member

DanTup commented Aug 5, 2016

Thanks for the report; the next preview release (which I hope to put in the store this weekend) now correctly handles Linux/Max paths and will resolve symlinks. I've just tested this on a clean Ubuntu install without the sdkPath set and it worked fine with the apt-get version from Google.

@DanTup DanTup closed this as completed Aug 5, 2016
@DanTup
Copy link
Member

DanTup commented Aug 5, 2016

If you remove the old version you can install a new preview from the VS Code marketplace which resolves the SDK issues (you can remove the sdkPath and it should still work):

https://marketplace.visualstudio.com/items?itemName=DanTup.dart-code

@DanTup DanTup removed the good first issue :octocat: A relatively straight forward issue that could be done by a new contributor label May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants