Skip to content

Platform.resolvedExecutable no longer follows symlinks as described in the documentation #61206

@nshahan

Description

@nshahan

When the Dart executable is accessed through a symlink Platform.resolvedExecutable no longer resolves the symlink.

For my local development setup I add the following symlink to my path so my local Dart executable is always accessible through it.
/Users/nshahan/dart-sdk/bin

That path is on a symlink I have setup so that I can change at any time when I want to configure what version of the Dart SDK I am running.

This program illustrates the difference I am seeing.

import 'dart:io';

main() {
  print(Platform.executable);
  print(Platform.resolvedExecutable);
}

When running with this symlink pointing to a stable Dart 3.8.1 download:
/Users/nshahan/dart-sdk -> /Users/nshahan/.dart-sdks/3.8.1

$ /Users/nshahan/dart-sdk/bin/dart repro.dart
dart
/Users/nshahan/.dart-sdks/3.8.1/bin/dart

When running with this symlink pointing to a local Dart SDK build after ab44b20:
/Users/nshahan/dart-sdk -> /Users/nshahan/code/dart-sdk/sdk/xcodebuild/ReleaseARM64/dart-sdk

$ /Users/nshahan/dart-sdk/bin/dart repro.dart
/Users/nshahan/dart-sdk/bin/dart
/Users/nshahan/dart-sdk/bin/dart

cc @a-siva

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.triagedIssue has been triaged by sub teamtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions