At the moment, it seems only dart is symlinked. We should include dart2js, pub, etc
_Set owner to @sgjesse._
_Added Started label._
Issue #21362 has been merged into this issue.
cc @whesse.
This is currently on hold. The way our scripts for dart2js, pub, ... are done does not work if symlinked using a relative path.
E.g. /usr/bin/pub -> ../lib/dart/bin/pub
Running /usr/bin/pub gives
/usr/bin/pub: line 22: cd: ../lib/dart/bin: No such file or directory
/usr/bin/pub: line 41: /usr/dart: No such file or directory
If a absolute link is used it works fine (/usr/bin/pub -> /usr/lib/dart/bin/pub), but the Debian package builder creates relative links.
_This comment was originally written by nane.krat...@gmail.com_
I am no expert with the deb package builder.
Nevertheless this unofficial dartlang package https://launchpad.net/~hachre/+archive/ubuntu/dart manages this problem somehow.
Because it does, it is my preferred package so far. Nevertheless official packages are most of the times preferable.
_This comment was originally written by nane.kratzke...@gmail.com_
I am no expert with the deb package builder.
Nevertheless this unofficial dartlang package
https://launchpad.net/~hachre/+archive/ubuntu/dart manages this problem
somehow.
Because it does, it is my preferred package so far. Nevertheless official
packages are most of the times preferable.
2014-10-22 9:59 GMT+02:00 <[email protected]>:
_This comment was originally written by @radicaled_
I think this package should be removed from the dartlang _website_ until this issue is resolved. Given Dart's heavy reliance on pub, its absence makes this Dart package essentially unusable outside of running stand-alone .dart files.
It just doesn't seem like a good idea to have a "non-functional" (loosely speaking) package advertised as a way to setup the Dart SDK on Ubuntu/Debian. I would have just downloaded the .tar.gz and unpacked it to /opt myself if I had I would be editing my $PATH variable anyway.
_This comment was originally written by nane.krat...@gmail.com_
I think the idea to extend the PATH variable to the bin directory where dart2js, pub, etc... live is a pragmatical idea. Should be possible to do this in the official docker image and it should solve the symlink problem.
Realizable?
Issue #21577 has been merged into this issue.
The package https://launchpad.net/~hachre/+archive/ubuntu/dart uses absolute links
/usr/bin/dart -> /opt/google/dartvm/dart
/usr/bin/pub -> /opt/google/dartsdk/bin/pub
/usr/bin/dart2js -> /opt/google/dartsdk/bin/dart2js
...
That works fine with the scripts pub, dart2js, etc.
However I don't see having to add /usr/lib/dart/bin to the PATH as a huge issue, which is why this issue have been on hold for some time.
The latest version of the docker image should already set the path, see https://registry.hub.docker.com/u/google/dart/dockerfile/.
Note that the package from the Dart Team is build for Debian 7 whereas the other package only work on Ubuntu due to glibc issues as it is packaging the .tar.gz files the Dart Team also distribute. The binaries in these .tar.gz files only work on Ubuntu.
_This comment was originally written by nane.kra...@gmail.com_
So if that is true, this issue should be closed to avoid irritations.
_This comment was originally written by willie.mo...@gmail.com_
Here is a dart program to set things up.
import 'dart:io';
main() {
if (!Platform.isLinux) return;
var bin = new File(new File('/usr/bin/dart').resolveSymbolicLinksSync()).parent.path;
new Link('/usr/bin/dart2js').create("$bin/dart2js").catchError((e){});
new Link('/usr/bin/dartanalyzer').create("$bin/dartanalyzer").catchError((e){});
new Link('/usr/bin/dartdocgen').create("$bin/dartdocgen").catchError((e){});
new Link('/usr/bin/dartfmt').create("$bin/dartfmt").catchError((e){});
new Link('/usr/bin/docgen').create("$bin/docgen").catchError((e){});
new Link('/usr/bin/pub').create("$bin/pub").catchError((e){});
}
_This comment was originally written by dvorap...@gmail.com_
any prograss on this?
At the moment adding /usr/lib/dart/bin to the PATH is the recommended way of getting access to all Dart tools.
The issue mentioned in #颅3 still remains, and nobody have been looking into how to get the Debian package manager to create absolute links. Looking as the Debian Policy Manual section 10.5 (https://www.debian.org/doc/debian-policy/ch-files.html) absolute symlinks should not be used, so using dh_link (or dart.links) will not do the trick.
Either the scripts should support being symlinked using a relative path or the install should run a custom script.
I just run into this as well, have always been using the manual install before.
Maybe as a temporary workaround the package could print out a recommendation to add /usr/lib/dart/bin to the PATH during/after the installation? Or add the info on the download page that you have to setup your path for pub to work.
And another user brought this up in our Slack channel. Maybe we can take another look at this?
cc @whesse @mit-mit
Not familiar with Debian package system; does it allow packages to put things in /etc/profile.d?
You can see answer at here: https://stackoverflow.com/questions/28466798/how-to-install-pub-command-line-usage-for-dart-on-ubuntu-web-server
Maybe having created some scripts in /usr/bin that inside them call the snapshots would do the trick?
like a 'pub' shell script that contains:
/usr/bin/dart /usr/lib/dart/bin/snapshots/pub.dart.snapshot "$@"
What makes this confusing for a new user is that dart is symlinked into /usr/bin but others like pub is not and on the SDK install webpage step 3 recommends installing stagehand using pub without mentioning that its not added to the path while dart via its symlink is. Step 2 does say:
As you install, note the path to the SDK. You鈥檒l need it in the next step.
yet the next step makes no mention of it :-(
Most helpful comment
I just run into this as well, have always been using the manual install before.
Maybe as a temporary workaround the package could print out a recommendation to add /usr/lib/dart/bin to the PATH during/after the installation? Or add the info on the download page that you have to setup your path for pub to work.