pana
pana copied to clipboard
Flutter detection fails when Flutter running for the first time
Hi to everyone!
I prepared a GitHub action to check the PANA result, but it failed when Flutter runs for the first time because Flutter prints the welcome text.
I fixed it by adding another command: https://github.com/frknkrc44/easy_utils/actions/runs/7342286251/job/19991318753
Check the "Run analyzer" for more details: https://github.com/frknkrc44/easy_utils/actions/runs/7342195786/job/19991095416
{"logName":"pana","level":"INFO","message":"Running `flutter --no-version-check --version --machine`..."}
{"logName":"pana","level":"WARNING","message":"Unable to detect Flutter version.","error":"Exception: Unable to parse output as JSON:\n\n```\nOUT:\n{\n \"frameworkVersion\": \"3.16.5\",\n \"channel\": \"stable\",\n \"repositoryUrl\": \"[https://github.com/flutter/flutter.git\](https://github.com/flutter/flutter.git/)",\n \"frameworkRevision\": \"78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9\",\n \"frameworkCommitDate\": \"2023-12-19 16:14:14 -0800\",\n \"engineRevision\": \"3f3e560236539b7e2702f5ac790b2a4691b32d49\",\n \"dartSdkVersion\": \"3.2.3\",\n \"devToolsVersion\": \"2.28.4\",\n \"flutterVersion\": \"3.16.5\",\n[45 more lines]\n```\n"}
I think we may expect this in the logs, but I'm not sure: does it affect the analysis too? At one point we were retrying after the version check.
@isoos It just causes "Found no Flutter in your PATH. Could not determine the current Flutter version." error and reduces the project's total point (you can see it on summary).
Full output:
{"logName":"pana","level":"INFO","message":"Running `/opt/flutter/bin/cache/dart-sdk/bin/dart --version`..."}
{"logName":"pana","level":"INFO","message":"Running `flutter --no-version-check --version --machine`..."}
{"logName":"pana","level":"WARNING","message":"Unable to detect Flutter version.","error":"Exception: Unable to parse output as JSON:\n\n```\nOUT:\n{\n \"frameworkVersion\": \"3.16.5\",\n \"channel\": \"stable\",\n \"repositoryUrl\": \"https://github.com/flutter/flutter.git\",\n \"frameworkRevision\": \"78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9\",\n \"frameworkCommitDate\": \"2023-12-19 16:14:14 -0800\",\n \"engineRevision\": \"3f3e560236539b7e2702f5ac790b2a4691b32d49\",\n \"dartSdkVersion\": \"3.2.3\",\n \"devToolsVersion\": \"2.28.4\",\n \"flutterVersion\": \"3.16.5\",\n[45 more lines]\n```\n"}
{"logName":"pana","level":"INFO","message":"Running `git rev-parse --show-toplevel`..."}
{"logName":"pana","level":"INFO","message":"Running `flutter --no-version-check pub pub get --no-example`..."}
{"logName":"pana","level":"INFO","message":"Running `flutter --no-version-check pub pub get --no-example`..."}
{"logName":"pana","level":"INFO","message":"Running `flutter --no-version-check pub pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides`..."}
{"logName":"pana","level":"INFO","message":"Analyzing package..."}
{"logName":"pana","level":"INFO","message":"Running `dart analyze --format machine lib`..."}
{"logName":"pana","level":"INFO","message":"Running `git init`..."}
{"logName":"pana","level":"INFO","message":"Running `git remote add origin https://github.com/frknkrc44/easy_utils`..."}
{"logName":"pana","level":"INFO","message":"Running `git remote show origin`..."}
{"logName":"pana","level":"INFO","message":"Running `git fetch --depth 1 --no-recurse-submodules origin main`..."}
{"logName":"pana","level":"INFO","message":"Running `git ls-tree -r --name-only --full-tree origin/main`..."}
{"logName":"pana","level":"INFO","message":"Running `git show origin/main:example/pubspec.yaml`..."}
{"logName":"pana","level":"INFO","message":"Running `git show origin/main:pubspec.yaml`..."}
{"logName":"pana","level":"INFO","message":"Running `/opt/flutter/bin/cache/dart-sdk/bin/dart pub global activate dartdoc`..."}
{"logName":"pana","level":"INFO","message":"Running `/opt/flutter/bin/cache/dart-sdk/bin/dart pub global run dartdoc --output /tmp/pana.1703714468814.OUXHZM/doc --sanitize-html --max-file-count 10000000 --max-total-size 2147483648 --no-validate-links`..."}
{"logName":"pana","level":"INFO","message":"Running `/opt/flutter/bin/cache/dart-sdk/bin/dart format --output=none --set-exit-if-changed /tmp/pana_TIBJCY/./lib`..."}
This is related to https://github.com/flutter/flutter/issues/139737
We should probably implement christopherfujino's fix, and pass CI=true from pana
This was a pub.dev environment handling issue, which has been fixed. Closing this now.