Skip to content

Stop producing .packages #47431

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

Closed
2 tasks done
mit-mit opened this issue Mar 11, 2020 · 19 comments · Fixed by dart-lang/pub#3413
Closed
2 tasks done

Stop producing .packages #47431

mit-mit opened this issue Mar 11, 2020 · 19 comments · Fixed by dart-lang/pub#3413
Labels
area-sdk Use area-sdk for general purpose SDK issues (packaging, distribution, …). enhancement-breaking-change An enhancement which is breaking.

Comments

@mit-mit
Copy link
Member

mit-mit commented Mar 11, 2020

We added logic to produce the new packages file: .dart_tool/package_config.json, however we now generate both that and .packages. I think we should stop generating .packages, so that there is a single master, and less room for confusion.

Known dependants of the .packages file that will need to get fixed first:

@mit-mit
Copy link
Member Author

mit-mit commented Mar 11, 2020

cc @kevmoo @jonasfj @lrhn @leafpetersen @munificent any concerns with this? I guess it is a breaking change and should be announced?

@mit-mit
Copy link
Member Author

mit-mit commented Mar 11, 2020

Even further, I think we should consider having pub delete any existing .packages when it creates the new config file.

@lrhn
Copy link
Member

lrhn commented Mar 11, 2020

There is a number of (third-party?) tools which read .packages. That's the ones we broke them when we tried added the version information to the .packages file itself.
We chose to make a different configuration file in order to not break these tools.
Removing .packages will likely break those tools again, so we need to force them all to migrate before that's a real possibility - breaking them was considered too problematic once already, and I don't see what should have changed since then.
I'm willing to bet that none of them have migrated to package_config.json yet.

@jakemac53
Copy link
Contributor

Ya, the original plan was to wait a (long) while before deleting this file, possibly even until Dart 3.0. The value of removing it likely doesn't justify the breaking change at this time given all the other churn that is happening due to NNBD and language versioning.

We could add a pointer to the new file in the comment at the top of the file?

@jonasfj
Copy link
Member

jonasfj commented Mar 11, 2020

possibly even until Dart 3.0

Seems reasonable to me... Or at-least we should wait until users have migrated from package_config 1.x to 2.x, given that we're in that process and haven't done it yet, I think it's best to wait a bit.

@jakemac53
Copy link
Contributor

Part of the problem is the old format was so easy to parse there was little reason to even depend on package_config in the first place, so tools often did not and parsed it on their own. So unfortunately even if the world migrates to package_config 2.x which has no .packages support we will still likely have usage of it.

@lrhn
Copy link
Member

lrhn commented Mar 11, 2020

We will move away from creating .packages, and I am hopeful we can do it within a few quarters. Those tools need to be updated. I just don't think we can break them without some migration time, by removing .packages immediately.

(It would be interesting to add a flag that makes Pub generate the .packages files, one which defaults to on for now, would flip to being off in, say, one quarter, and then be removed/disabled in two quarters. Then we could run tests in google3 with the flag off and see which code still needs to be migrated. @jonasfj, WDYT?)

@natebosch
Copy link
Member

Then we could run tests in google3 with the flag off and see which code still needs to be migrated.

pub is not used internally. Our concerns are around tools in the external ecosystem, and it will be more challenging to have confidence we've caught everything.

@leafpetersen
Copy link
Member

cc @devoncarew who I think was familiar with some of the external tooling that uses .packages (something around Intellij perhaps?).

@devoncarew
Copy link
Member

Fuchsia I believe also reads the .packages file.

It would be good to track the tools that need to migrate, and slowly change them over, but we'll want that changeover to be a fair ways out.

@devoncarew
Copy link
Member

run tests in google3 with the flag off and see which code still needs to be migrated

And, CIs won't provide many signals for which tools will break.

@mit-mit mit-mit transferred this issue from dart-lang/pub Oct 11, 2021
@mit-mit
Copy link
Member Author

mit-mit commented Oct 11, 2021

I moved this to the SDK tracker as it's such a cross-cutting issue.

@mit-mit mit-mit added the enhancement-breaking-change An enhancement which is breaking. label Oct 11, 2021
@a-siva a-siva added the area-sdk Use area-sdk for general purpose SDK issues (packaging, distribution, …). label Oct 13, 2021
@rakudrama
Copy link
Member

In my personal workflow on small code snippets (often copy/paste from bug reports) I use

dart/sdk$ sdk/bin/dart --packages=.packages  /some/path/foo.dart
dart/sdk$ sdk/bin/dart2js_developer --packages=.packages  /some/path/foo.dart

What would this look like if .packages was removed?
I have over 1200 of these small programs, so creating some kind of project for each one would cumulatively have been quite a burden.

@mit-mit
Copy link
Member Author

mit-mit commented Feb 2, 2022

Can't you just pass a package_config.json file instead?

dart/sdk$ sdk/bin/dart --packages=package_config.json /some/path/foo.dart
dart/sdk$ sdk/bin/dart2js_developer --packages=package_config.json  /some/path/foo.dart

Yes, we'd have to replace our current .packages file with a package_config.json file, but that is an SDK specific issue.

@natebosch
Copy link
Member

Yes, we'd have to replace our current .packages file with a package_config.json file, but that is an SDK specific issue.

@rakudrama - this issue refers to the .packages file created by dart pub get in packages. I think you're referring to doing development directly in the SDK repo. That .packages file removal is tracked at #48275

We already have a replacement file it the SDK repo, you can change --packages=.packages to --packages=.dart_tool/package_config.json. This should work today.

@sigmundch
Copy link
Member

An issue we discovered today that is worth tracking before we stop generating .packages files:

@mit-mit
Copy link
Member Author

mit-mit commented May 10, 2022

PR for this: dart-lang/pub#3413

I'll move the VM issue discussed in #47431 (comment) to #48272

@mit-mit
Copy link
Member Author

mit-mit commented May 12, 2022

@sigurdm
Copy link
Contributor

sigurdm commented May 12, 2022

Roll is https://dart-review.googlesource.com/c/sdk/+/244621

Actual roll is: https://dart-review.googlesource.com/c/sdk/+/244623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-sdk Use area-sdk for general purpose SDK issues (packaging, distribution, …). enhancement-breaking-change An enhancement which is breaking.
Projects
None yet
Development

Successfully merging a pull request may close this issue.