Skip to content

Support dart install webdev #2689

@dcharkes

Description

@dcharkes
$ dart install webdev

$ webdev serve
Unhandled exception:
ProcessException: No such file or directory
  Command: /Users/dacoharkes/Library/Application Support/Dart/install/app-bundles/webdev/hosted/3.7.2/bundle/bin/dart pub 
#0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:519)
#1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:686)
#2      Process.runSync (dart:io-patch/process_patch.dart:79)
#3      _runPubDeps (package:webdev/src/pubspec.dart:50)

(Dart install is available in beta and dev releases.)

This is because it assumes it's running in JIT mode and that the running executable is dart.exe.

final String _sdkDir = (() {
// The Dart executable is in "/path/to/sdk/bin/dart", so two levels up is
// "/path/to/sdk".
final aboveExecutable = p.dirname(p.dirname(Platform.resolvedExecutable));
assert(FileSystemEntity.isFileSync(p.join(aboveExecutable, 'version')));
return aboveExecutable;
})();
final String dartPath = p.join(_sdkDir, 'bin', 'dart');

However, with dart install we get a self-contained application bundle in AOT mode.

We should find dart or dart.exe on PATH with which dart or where dart.exe.

cc @biggs0125 @srujzs @nshahan

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onpackage:webdevtriaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions