Skip to content

Compatibility with AOT analysis_server #328

Open
@srawlins

Description

@srawlins

The Dart analysis server snapshot (bin/snapshtos/analysis_server.dart.snapshot) will soon be compiled and run as an AOT snapshot (bin/snapshtos/analysis_server_aot.dart.snapshot). (Maybe Dart 3.9.)

custom_lint seems to be incompatible with this change, at least in one place:

Future<void> runPubGet(Directory tempDir) async {

runPubGet uses Platform.resolvedExecutable, something like ${Platform.resolvedExecutable} pub get. But when it is running from the AOT-compiled analysis server, the resolved executable is dartaotruntime (instead of dart). dartaotruntime cannot be used to run pub.

custom_lint should instead look to find the dart (or dart.exe) binary next to Platform.resolvedExecutable. I am not sure if there is a vetted, canonical way of doing so. But it isn't too hard in a few lines to get the sibling binary file.

As for testing, maybe not easy 😅 I have a WIP CL that allows for running analysis server as AOT. I can probably test a fix locally.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions