New API: dart:io.Platform.resolvedDartTool #60724
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-io
type-enhancement
A request for a change that isn't a bug
Uh oh!
There was an error while loading. Please reload this page.
Developers sometimes rely on Platform.resolvedExecutable to find the "running"
dart
command on which a script is running. Then you can run, for example,Process.start(Platform.resolvedExecutable, ['pub', 'get'])
. This works when the running script is being run as JIT, withdart
ordart.exe
as the resolved executable.But for a script which is compiled with AOT,
Platform.resolvedExecutable
resolves todartaotruntime
. Anddartaotruntime pub get
does not work. In order to compatibly use adart
binary, for example to runpub get
, you can use thedart
sibling toPlatform.resolvedExecutable
(or thedart.exe
sibling).It would be nice to expose this executable as a static getter on
Platform
. MaybedartExecutable
ordartTool
(dart --help
describes itself as a "utility". The website docs calldart
"The Dart command-line tool".Developers of analyzer plugins may need to be aware of this as analyzer is compiled AOT. See #50498.
The text was updated successfully, but these errors were encountered: