Skip to content
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

re-enable pana baseline checking (pending build fixes) #2504

Closed
pq opened this issue Mar 11, 2021 · 7 comments · Fixed by #2518 or #2871
Closed

re-enable pana baseline checking (pending build fixes) #2504

pq opened this issue Mar 11, 2021 · 7 comments · Fixed by #2518 or #2871
Assignees
Labels
contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) type-enhancement A request for a change that isn't a bug

Comments

@pq
Copy link
Member

pq commented Mar 11, 2021

See, for example: https://github.com/dart-lang/linter/pull/2502/checks?check_run_id=2087774664

Chatting with @jonasfj, this will require a bit of local debugging. (Just haven't gotten to it yet...)

@pq pq added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) build labels Mar 11, 2021
@pq pq self-assigned this Mar 11, 2021
@pq
Copy link
Member Author

pq commented Mar 11, 2021

Interestingly, this runs w/o issues locally. 🤔

@pq
Copy link
Member Author

pq commented Mar 11, 2021

[~/src/repos/linter] (master) $ dart tool/pana_baseline.dart
...
   {
    "id": "null-safety",
    "title": "Support sound null-safety",
    "grantedPoints": 0,
    "maxPoints": 0,
    "status": "passed",
    "summary": "### [*] 0/0 points: Package and dependencies are fully migrated to null-safety, and will be awarded additional points in a planned future revision of the pub.dev points model.\n"
   }
  ]
 },
 "scores": {
  "grantedPoints": 90,
  "maxPoints": 100
 }
}

{grantedPoints: 90, maxPoints: 100}
Baseline check passed ✅
... you have a new baseline! 🎉 Consider updating tool/baseline/pana.json to match.

@pq
Copy link
Member Author

pq commented Mar 11, 2021

Here's the CI error:

{"logName":"pana","level":"INFO","message":"Running `/opt/hostedtoolcache/dart-sdk/bin/dartanalyzer --options /home/runner/work/linter/linter/pana_analysis_options_1615478856916256.g.yaml --format machine bin lib`..."}
{"level":"SHOUT","message":"Problem analyzing /home/runner/work/linter/linter","error":"Invalid argument(s): Provided content does not align with expectations.\n`No dart files found at: /home/runner/work/linter/linter/lib`","stackTrace":"#0      parseCodeProblem (package:pana/src/code_problem.dart:52:5)\n#1      PackageContext.staticAnalysis.<anonymous closure> (package:pana/src/package_context.dart:121:23)\n#2      MappedIterator.moveNext (dart:_internal/iterable.dart:390:20)\n#3      WhereIterator.moveNext (dart:_internal/iterable.dart:436:22)\n#4      SetMixin.addAll (dart:collection/set.dart:57:23)\n#5      new LinkedHashSet.of (dart:collection/linked_hash_set.dart:111:27)\n#6      Iterable.toSet (dart:core/iterable.dart:376:21)\n#7      PackageContext.staticAnalysis (package:pana/src/package_context.dart:123:12)\n<asynchronous suspension>\n#8      PackageAnalyzer._inspect (package:pana/src/package_analyzer.dart:145:25)\n<asynchronous suspension>\n#9      main (file:///home/runner/.pub-cache/hosted/pub.dartlang.org/pana-0.15.3/bin/pana.dart:163:19)\n<asynchronous suspension>\n"}

@jonasfj : any thoughts?

@jonasfj
Copy link
Member

jonasfj commented Mar 12, 2021

Are the sources located in /home/runner/work/linter/linter/lib or /home/runner/work/linter/lib ?

Maybe an extra linter folder was given?

Just a qualified guess from seeing:

Invalid argument(s): Provided content does not align with expectations.
No dart files found at: /home/runner/work/linter/linter/lib`"

@pq
Copy link
Member Author

pq commented Mar 16, 2021

Right. The path is definitely wrong. Here's where it's set:

  var output = await Process.run('pub', [
    'global',
    'run',
    'pana',
    '-s',
    'path',
    Directory.current.path,
    '-j',
  ]);

This used to work? 🤔

@pq pq closed this as completed in #2518 Mar 16, 2021
@pq pq reopened this Mar 16, 2021
@pq pq changed the title pana baseline check is crashing build re-enable pana baseline checking (pending build fixes) Mar 16, 2021
@pq
Copy link
Member Author

pq commented Mar 16, 2021

Disabled w/ #2518 pending some investigation.

@pq pq added type-enhancement A request for a change that isn't a bug contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Mar 16, 2021
@pq
Copy link
Member Author

pq commented Aug 13, 2021

Running this again (locally), I'm seeing this error:

{"logName":"pana","level":"INFO","message":"Running `/Applications/Tools/dart-sdk/bin/dart --version`..."}
Unhandled exception:
Null check operator used on a null value
#0      new DartSdkInfo.parse (package:pana/src/sdk_env.dart:505:38)
#1      ToolEnvironment._init (package:pana/src/sdk_env.dart:87:37)
<asynchronous suspension>
#2      ToolEnvironment.create (package:pana/src/sdk_env.dart:160:5)
<asynchronous suspension>
#3      PackageAnalyzer.create (package:pana/src/package_analyzer.dart:60:28)
<asynchronous suspension>
#4      main (file:///Users/pquitslund/.pub-cache/hosted/pub.dartlang.org/pana-0.19.1/bin/pana.dart:134:22)
<asynchronous suspension>

It looks like maybe an issue parsing the Dart SDK version?

☁  linter [master] dart --version
Dart SDK version: 2.15.0-edge.e8ddc0219f1e8f1ad784143fec693890e2b81954 (be) (Fri Aug 13 13:27:41 2021 +0000) on "macos_x64"

Invocation details are here, for reference:

var output = await Process.run('pub', [
'global',
'run',
'pana',
'-s',
'path',
Directory.current.path,
'-j',
]);

/fyi @sigurdm @jonasfj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants