Skip to content

Conversation

@Jasguerrero
Copy link
Contributor

@Jasguerrero Jasguerrero commented Jul 19, 2022

Fixes: #107957

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.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 19, 2022
@christopherfujino
Copy link
Contributor

From the analyze-linux failure:

Unhandled exception:
FormatException: Unexpected character (at character 1)
Running "flutter pub get" in flutter_tools...                    2,609ms
^
#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
#2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
#3      _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4      JsonDecoder.convert (dart:convert/json.dart:612:36)
#5      JsonCodec.decode (dart:convert/json.dart:216:41)
#6      _checkConsumerDependencies (file:///tmp/flutter%20sdk/dev/bots/analyze.dart:1676:47)
<asynchronous suspension>
#7      run (file:///tmp/flutter%20sdk/dev/bots/analyze.dart:153:3)
<asynchronous suspension>
#8      main (file:///tmp/flutter%20sdk/dev/bots/analyze.dart:50:5)
<asynchronous suspension>

https://github.com/flutter/flutter/blob/master/dev/bots/analyze.dart#L1664

So with this change, it must be failing the cache check even when the package is already present (note we already run flutter update-packages before running tests.

@Jasguerrero
Copy link
Contributor Author

Jasguerrero commented Jul 20, 2022

So with this change, it must be failing the cache check even when the package is already present (note we already run flutter update-packages before running tests.

After a couple of logs I found that https://github.com/flutter/flutter/blob/master/dev/bots/analyze.dart#L1676 result.stdout starts with a Running "flutter pub get" in flutter_tools... which makes the json.decode to fail; apparently just making sure the pubspec.yaml is present is not enough (at least with our current setup in the flutter package) a work around could be to check if at least one option between lib/ and pubspec.yaml is present. Let me know what you think

@Jasguerrero Jasguerrero changed the title check for pubspec instead of lib/ check for pubspec and of lib/ Jul 20, 2022
@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Jul 20, 2022
@Jasguerrero Jasguerrero removed the c: contributor-productivity Team-specific productivity, code health, technical debt. label Jul 20, 2022
@Jasguerrero Jasguerrero marked this pull request as ready for review July 20, 2022 18:20
@christopherfujino
Copy link
Contributor

So with this change, it must be failing the cache check even when the package is already present (note we already run flutter update-packages before running tests.

After a couple of logs I found that https://github.com/flutter/flutter/blob/master/dev/bots/analyze.dart#L1676 result.stdout starts with a Running "flutter pub get" in flutter_tools... which makes the json.decode to fail; apparently just making sure the pubspec.yaml is present is not enough (at least with our current setup in the flutter package) a work around could be to check if at least one option between lib/ and pubspec.yaml is present. Let me know what you think

Which package is it that's causing this to fail?

@Jasguerrero
Copy link
Contributor Author

Which package is it that's causing this to fail?

flutter

@christopherfujino
Copy link
Contributor

Which package is it that's causing this to fail?

flutter

Hmm, are you sure? flutter_tools doesn't depend on package:flutter.

@Jasguerrero
Copy link
Contributor Author

Jasguerrero commented Jul 20, 2022

Hmm, are you sure? flutter_tools doesn't depend on package:flutter.

Yes. Here is an output of bots/analyze.dart In which I added a print with Package name: $package and the the stdout of pub deps --json
https://cirrus-ci.com/task/4622469666439168?logs=main#L31

@Jasguerrero
Copy link
Contributor Author

Hmm, are you sure? flutter_tools doesn't depend on package:flutter.

Or do you mean what package inside the tool does not have the pubspec on the bot and that is why the Running "flutter pub get"... log is spawned?

@christopherfujino
Copy link
Contributor

Hmm, are you sure? flutter_tools doesn't depend on package:flutter.

Or do you mean what package inside the tool does not have the pubspec on the bot and that is why the Running "flutter pub get"... log is spawned?

Yes

@Jasguerrero
Copy link
Contributor Author

Jasguerrero commented Jul 20, 2022

Yes

It is flutter_tools so apparently https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/flutter_cache.dart#L100 packageConfig.packages contains flutter_tools and that does not have a pubspec.yaml. I added some logs in a different PR to verify it, here are some logs to test this https://cirrus-ci.com/task/4762793864855552?logs=main#L26

@christopherfujino
Copy link
Contributor

Yes

It is flutter_tools so apparently https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/flutter_cache.dart#L100 packageConfig.packages contains flutter_tools and that does not have a pubspec.yaml. I added some logs in a different PR to verify it, here are some logs to test this https://cirrus-ci.com/task/4762793864855552?logs=main#L26

I mean, we know flutter_tools has a pubspec.yaml https://github.com/flutter/flutter/blob/master/packages/flutter_tools/pubspec.yaml, so i think this is a bug in your code.

@Jasguerrero Jasguerrero changed the title check for pubspec and of lib/ check for pubspec instead of lib/ Jul 20, 2022
Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 21, 2022
@auto-submit auto-submit bot merged commit fc3471f into flutter:master Jul 21, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 21, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 22, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 22, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jul 22, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tool thinks pub packages without a lib directory are always out of date

2 participants