Skip to content

Conversation

@sigurdm
Copy link
Contributor

@sigurdm sigurdm commented Mar 7, 2022

Replace .packages with .dart_tool/package_config.json in BuildInfo.packagesPath.

Fixes: #99678

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 7, 2022
@sigurdm sigurdm changed the title Replace .packages with .dart_tool/package_config.json in BuildInfo Migrate .packages -> package_config.json Mar 7, 2022
@sigurdm sigurdm closed this Mar 10, 2022
@sigurdm sigurdm reopened this Mar 10, 2022
@sigurdm
Copy link
Contributor Author

sigurdm commented Mar 10, 2022

Not sure about the failing windows test - is it a regular timeout or is something else going on...

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test itself might be flaky right now, though @christopherfujino might know more.

Otherwise LGTM, if LG to @christopherfujino

BuildMode.debug,
'',
treeShakeIcons: false,
packagesPath: '.dart_tool/package_config.json',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this field removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because this is now the default argument

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, cool

@christopherfujino
Copy link
Contributor

Re-ran the tool integration test.

required this.treeShakeIcons,
this.performanceMeasurementFile,
this.packagesPath = '.packages', // TODO(zanderso): make this required and remove the default.
this.packagesPath = '.dart_tool/package_config.json', // TODO(zanderso): make this required and remove the default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this hard-coded path separator is leading to coverage collection failing on Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd that it is failing only for windows. Really, you should be able to use / conditionally ...

Perhaps the coverage code is doing some string matching instead of using package:path ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the platform separator will make the constructor non-const (which might not be a problem).

Cursory inspection doesn't show anything in package:coverage that should depend on backslash on windows...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll debug this one today, I use a windows machine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonahwilliams
Copy link
Contributor

So from investigation, it looks like the coverage resolver in package:coverage wants the packages path to be both a file path and a URI, which only works on Linux/macOS:

https://github.com/dart-lang/coverage/blob/master/lib/src/resolver.dart#L87

I'm going to work out how to fix this

@jonahwilliams
Copy link
Contributor

Fix is dart-archive/coverage#371 , which needs to be rolled into flutter first

@christopherfujino
Copy link
Contributor

Fix is dart-lang/coverage#371 , which needs to be rolled into flutter first

That PR was merged, we are now blocked on a new published pub version. @bkonyi or @natebosch do you know the process for publishing package:coverage? it looks like there are several batched changes.

@bkonyi
Copy link
Contributor

bkonyi commented Mar 24, 2022

Fix is dart-lang/coverage#371 , which needs to be rolled into flutter first

That PR was merged, we are now blocked on a new published pub version. @bkonyi or @natebosch do you know the process for publishing package:coverage? it looks like there are several batched changes.

Either @natebosch or @liamappelbe (maybe) should be able to publish a new version.

@christopherfujino
Copy link
Contributor

Fix is dart-lang/coverage#371 , which needs to be rolled into flutter first

That PR was merged, we are now blocked on a new published pub version. @bkonyi or @natebosch do you know the process for publishing package:coverage? it looks like there are several batched changes.

Either @natebosch or @liamappelbe (maybe) should be able to publish a new version.

Pretty please :)

@liamappelbe
Copy link
Contributor

Fix is dart-lang/coverage#371 , which needs to be rolled into flutter first

That PR was merged, we are now blocked on a new published pub version. @bkonyi or @natebosch do you know the process for publishing package:coverage? it looks like there are several batched changes.

Either @natebosch or @liamappelbe (maybe) should be able to publish a new version.

Pretty please :)

Done

@christopherfujino
Copy link
Contributor

christopherfujino commented Mar 26, 2022

@sigurdm if you rebase to ef8e357 or later, you should pick up the fix to package:coverage

@sigurdm sigurdm merged commit 66ed64b into flutter:master Mar 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Mar 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 4, 2022
cbracken added a commit to cbracken/flutter that referenced this pull request May 14, 2022
Until recently, BuildInfo.packagesPath defaulted to `.packages` however,
the .packages file has been deprecated [1] and is being removed. In
flutter#99677 the default was changed to
`.dart_tool/package_config.json` but the doc comment was accidentally
updated to `.dart_tool/packages`. This corrects it to the true default
value.

1: dart-lang/sdk#48272

Spotted in the midst of some related cleanup relating to
flutter#103775
cbracken added a commit that referenced this pull request May 14, 2022
Until recently, BuildInfo.packagesPath defaulted to `.packages` however,
the .packages file has been deprecated [1] and is being removed. In
#99677 the default was changed to
`.dart_tool/package_config.json` but the doc comment was accidentally
updated to `.dart_tool/packages`. This corrects it to the true default
value.

1: dart-lang/sdk#48272

Spotted in the midst of some related cleanup relating to
#103775
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter should not consume .packages

5 participants