-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Remove CFE/analyzer/compiler/VM support for .packages
file
#48939
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
Comments
@a-siva can we get this one assigned? I believe it's the last know issue in related to these changes. |
This seems to be a front end issue, the code here in
If I modify the above code as follows |
As I recall this was discussed with the design of the automagic redirect to package_config, so I think this is working as intended. I'll see if I can dig out an issue. |
@jensjoha the plan is to deprecate the support for |
As specified here: From the above:
The
seems wrong --- but I have no idea what
Someone should specify something then --- /cc @lrhn |
Allowing redirection from a specified The This only makes sense for the stand-alone VM, not AoT, since there are no source directories available if you're not running from source. I don't know what the method does in AoT, but I'd make it throw We also provide My suggestion is that the front end provides a way to access the actual package resolution information that it used for a compilation (package resolution file path, maybe So, I'd say the bug is in the VM methods. We can choose to support an efficient implementation of that from the front-end, or we can leave it up to the VM to do the exact same package-configuration file search as the front-end, so that it gets the same results. If we choose to remove the redirect from out tools (and to be precise: Any tool which currently does not redirect from |
I think we should go ahead and remove that redirection. We're about to stop the generation of the file, so I think we can remove the redirection too. |
Let's remove support for That is:
That will break scripts depending on the redirection. That's OK, they are no longer supported since they use the unsupported As always, which error message to show in that case is completely open, and nicely telling people that How to do this: Where you use If you use I'll add a |
I think we should specifically test for the file name |
To sum up the conversation so far: May 16:
May 16:
May 18:
May 20:
May 20:
This still leaves me confused as what the CFE team should do. Let me try to ask some specific questions:
|
I don't know where we are with the next release. If it's not too close, meaning we'll have at least one more dev-release before stable release, I'd do 1.4, otherwise 2.4. So, definitely X.4, only depending on when we release the change. @mit? I'd make the error message depend on whether the specified name is That also means that when searching for a configuration file, If you specify |
We shipped our last stable a week ago, so we are several months, dozens of dev-releases, and several beta-releases from the next stable. We also announced that So, my answers to your specific questions, are to immediately:
|
Maybe I should start by stating that I don't have a strong opinion about what is decided here (I guess technically I do, but I don't have energy to fight for it) --- but I don't want to have to implement the change several times because we're not clear on what we actually want (we've already done that a bunch of times for the language versioning feature that the new package format was a part of). I will point out, though, that the
At a time where the next stable would be 2.17. It then states
The way I would read that, would be that the whole process was shifted by one release, meaning that the |
The only thing we pushed to 2.19 is support for generating it: "to no longer generate the .packages file" That part is retained as there may be tools owned by others than the Dart or Flutter team that for some reason havn't updated, and that we're not aware of, and thus still have a dependency on the I'll see if the wording in the breaking change issue needs to be clarified a bit. |
.packages
file.packages
file
.packages
file.packages
file
We some surprising behavior when we give the Dart VM a
--packages=path/to/packages/file
flag. We tripped on this as we try to migrate code away from using .packages, so this may be relevant for eternal users after we deprecate.packages
in the near future.Repro steps require:
--packages
flag pointing to a non-existing.packages
file (but in the location that is expected to be, so the.dart_tool/package_config.json
file can be resolved)..dart_tool/package_config.json
in the expected location relative to the old conventions with.packages
files.Expected behavior: the input script URI shouldn't be resolved, and an error should be emitted.
Actual behavior: the script URI is resolved and executes, however later within the app the
Isolate.resolvePackageUri
cannot resolve the input URI script (because it uses the non-existing .packages file, instead of the implicit package_config.json file).Here is a full repro example:
lib/foo.dart
.dart_tool/package_config.json:
If you invoke the Dart VM as
dart --packages=.dart_tool/package_config.json package:foo/foo.dart
, you see the following output:If however you invoke it as
dart --packages=.packages package:foo/foo.dart
, you see the following output:If you provide a different name for the packages file:
dart --packages=.nothing package:foo/foo.dart
, you see the following output:This last output is what I'd expect to get in the first place.
The text was updated successfully, but these errors were encountered: