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

unable to run pana locally (failing to parse Dart SDK info) #941

Closed
pq opened this issue Aug 13, 2021 · 15 comments
Closed

unable to run pana locally (failing to parse Dart SDK info) #941

pq opened this issue Aug 13, 2021 · 15 comments

Comments

@pq
Copy link
Member

pq commented Aug 13, 2021

☁  pana [master] pub global run pana
INFO       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>

Here's my SDK info:

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

See also: dart-lang/linter#2504

@isoos
Copy link
Collaborator

isoos commented Aug 16, 2021

@pq Can you also include the output of /Applications/Tools/dart-sdk/bin/dart --version? I've added the version you've provided in the test in #942, but it was parsed correctly already. I suspect it is a very different string that the code gets.

@pq
Copy link
Member Author

pq commented Aug 16, 2021

Sure thing.

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

Also note this is failing on CI builds too:

https://github.com/dart-lang/linter/pull/2871/checks?check_run_id=3326046782

@isoos
Copy link
Collaborator

isoos commented Aug 16, 2021

@pq: could you do a quick check for me: is this stdout or stderr? Current stable is stderr, and pana is checking for that, but maybe newer SDKs switch to stdout?

@pq
Copy link
Member Author

pq commented Aug 16, 2021

It looks like stdout to me.

/fyi @bkonyi

@pq
Copy link
Member Author

pq commented Aug 16, 2021

Thanks for taking a look @isoos!

@isoos
Copy link
Collaborator

isoos commented Aug 17, 2021

@pq: 0.20.0 has been published with the fix that should unblock you

@pq
Copy link
Member Author

pq commented Aug 17, 2021

Awesome, progress!

I'm seeing a new issue now...

https://github.com/dart-lang/linter/pull/2871/checks?check_run_id=3351244534

And locally:

☁  linter [master] ⚡  pub global run pana
INFO       Running `/Applications/Tools/dart-sdk/bin/dart --version`...
INFO       Running `flutter --no-version-check --version --machine`...
WARNING    pana might update or modify files in `.`.
           Analysis will begin in 15 seconds, hit CTRL+C to abort it.
           To remove this message, use `--no-warning`.
INFO       Running `git rev-parse --show-toplevel`...
SHOUT      Problem analyzing
           FileSystemException: Directory listing failed, path = '/Users/pquitslund/src/repos/linter
           /' (OS Error: No such file or directory, errno = 2)
☁  linter [master] ⚡  pwd
/Users/pquitslund/src/repos/linter

(I'm guessing this should repro easily?)

@isoos
Copy link
Collaborator

isoos commented Aug 17, 2021

@pq: I have a fix for this in #945, could you please test it?

Also: is this a regression compared to an older version? I fail to see what recent change broke it..

@pq
Copy link
Member Author

pq commented Aug 17, 2021

It's likely this issue has been there for a while and is the cause of the issue that lead to disabling the bot in dart-lang/linter#2504.

@pq
Copy link
Member Author

pq commented Aug 17, 2021

@isoos: tested locally and works. Thanks!

@felangel
Copy link

I just stumbled upon #941 (comment) as well and I was previously using v0.19.1 so it must've been introduced in v0.20.0.

@isoos
Copy link
Collaborator

isoos commented Aug 18, 2021

I think the #936 change in runProc could be the culprit in this case.
I'll add a few more tests to #945 and review other parts of the uses of runProc.

@isoos
Copy link
Collaborator

isoos commented Aug 19, 2021

FYI: 0.20.1 has been released.

@pq
Copy link
Member Author

pq commented Aug 19, 2021

Thanks @isoos !

@isoos
Copy link
Collaborator

isoos commented Sep 17, 2021

This has been fixed.

@isoos isoos closed this as completed Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants