Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make VM prefer .dart_tool over .packages. #41748

Closed
mkustermann opened this issue May 3, 2020 · 3 comments
Closed

Make VM prefer .dart_tool over .packages. #41748

mkustermann opened this issue May 3, 2020 · 3 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@mkustermann
Copy link
Member

The VM will start to support .dart_tool/package_config.json for resolving package Uris in various scenarios.

We do have a Isolate.packageConfig API in dart:isolate which says atm:

  /**
   * The package root of the current isolate, if any.
   *
   * If the isolate is using a [packageRoot] (**) or the isolate has not been
   * setup for package resolution, this getter returns `null`, otherwise it
   * returns the package config URI.
   *
   * (**) the deprecated packages/ folder
   */
  external static Future<Uri> get packageConfig;

Now the question is: Should this getter return a Uri to .dart_tool/package_config.json if the VM is using it for package resolution? Or should we expose a new get packageJsonConfig getter?

Right now there are a few packages out there, e.g. package:package_resolver which invoke this getter and expect the file at that Uri to be of .packages format (and not the json format). This package is in fact used by e.g. flutter atm (see /src/flutter/lib/web_ui/dev/test_platform.dart)

Those packages will break once the VM favors .dart_tool/package_config.json over .packages.

@mkustermann mkustermann added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label May 3, 2020
@lrhn
Copy link
Member

lrhn commented May 3, 2020

Should this getter return a Uri to .dart_tool/package_config.json if the VM is using it for package resolution?

Yes.

There won't be any .packages file to refer to soon enough. Anyone needing to understand the file contents will need to understand the new file format.

@mkustermann
Copy link
Member Author

Thanks for the confirmation, @lrhn

I have filed flutter/flutter#56289 for the flutter team to take this on.

Will re-classify this issue as area-vm and mark it blocked until flutter/flutter#56289 has been addressed.

@mkustermann mkustermann added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. and removed area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels May 4, 2020
@mkustermann mkustermann changed the title Clarify Isolate.packageConfig API semantics Make VM prefer .dart_tool over .packages. May 4, 2020
@mkustermann mkustermann added the status-blocked Blocked from making progress by another (referenced) issue label May 4, 2020
@mkustermann mkustermann self-assigned this May 6, 2020
@mkustermann
Copy link
Member Author

Flutter has moved to Lasse's new package, so we should be unblocked on preferring to use the new .dart_tool/package_config.json over .packages.

Made CL: https://dart-review.googlesource.com/c/sdk/+/146840

@mkustermann mkustermann removed the status-blocked Blocked from making progress by another (referenced) issue label May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants