Skip to content

Support custom sdkRoot for frontend server executable paths#2777

Open
nielsenko wants to merge 1 commit intodart-lang:mainfrom
nielsenko:fix-sdk-root
Open

Support custom sdkRoot for frontend server executable paths#2777
nielsenko wants to merge 1 commit intodart-lang:mainfrom
nielsenko:fix-sdk-root

Conversation

@nielsenko
Copy link

@nielsenko nielsenko commented Feb 13, 2026

The sdkRoot parameter was already accepted but wasn't actually used when resolving executable and snapshot paths. All paths were unconditionally derived from Platform.resolvedExecutable via sdkDir, ignoring any custom sdkRoot passed by the caller.

This fix wires sdkRoot through to the path helpers so that when a custom SDK root is provided, all resolved paths (dart executable, AOT runtime, AOT snapshot, and AppJIT snapshot) use it instead of the host process's SDK location.

Changes:

  • Converted _dartAotRuntimePath, _feServerAotSnapshotPath, and _feServerAppJitSnapshotPath from static final fields to functions that accept an optional sdkRoot, falling back to sdkDir when not provided.
  • Added _dartExecutable(sdkRoot) helper that returns the custom SDK's bin/dart when sdkRoot is set, otherwise Platform.resolvedExecutable.
  • Updated all Process.start calls to use the resolved paths.

Fixes: #2767


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.

@nielsenko nielsenko marked this pull request as draft February 13, 2026 10:01
@nielsenko nielsenko marked this pull request as ready for review February 13, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The sdkRoot argument to start is not honoured everywhere

1 participant