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

dart run custom_lint causes failures when some packages are present in the pubspec.yaml #91

Open
manuel-plavsic opened this issue Sep 1, 2024 · 4 comments

Comments

@manuel-plavsic
Copy link
Collaborator

dart run custom_lint works for me only if I temporarily comment out some packages in my pubspec.yaml (in my case they are sqlite3_flutter_libs, path_provider, device_info_plus and shared_preferences). If I don't comment them out, I get failures similar to this one:

❯ dart run custom_lint
Building package executable... (2.9s)
Built custom_lint:custom_lint.
Failed to decode .dart_tool/package_config.json at /run/host/unsynced/manuel/Workspace/photos/code/app/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux. Make sure to run `pub get` first.
PathNotFoundException: Cannot open file, path = '/run/host/unsynced/manuel/Workspace/photos/code/app/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux/.dart_tool/package_config.json' (OS Error: No such file or directory, errno = 2)
#0      _checkForErrorResponse (dart:io/common.dart:55:9)
#1      _File.open.<anonymous closure> (dart:io/file_impl.dart:381:7)
#2      _rootRunUnary (dart:async/zone.dart:1407:47)
#3      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
<asynchronous suspension>
#4      _File.readAsBytes.<anonymous closure> (dart:io/file_impl.dart:562:24)
<asynchronous suspension>
#5      parsePackageConfig (package:custom_lint_core/src/package_utils.dart:161:5)
<asynchronous suspension>
#6      CustomLintProject.parse (package:custom_lint/src/workspace.dart:1025:34)
<asynchronous suspension>
#7      Future.wait.<anonymous closure> (dart:async/future.dart:534:21)
<asynchronous suspension>
#8      CustomLintWorkspace.fromContextRoots (package:custom_lint/src/workspace.dart:516:22)
<asynchronous suspension>
#9      _runServer.<anonymous closure> (package:custom_lint/custom_lint.dart:90:25)
<asynchronous suspension>
#10     _AsyncCompleter.complete (dart:async/future_impl.dart:41:3)
<asynchronous suspension>
#11     _runServer.<anonymous closure> (package:custom_lint/custom_lint.dart:126:19)
<asynchronous suspension>
#12     _runServer (package:custom_lint/custom_lint.dart:86:3)
<asynchronous suspension>
#13     customLint (package:custom_lint/custom_lint.dart:50:5)
<asynchronous suspension>
#14     entrypoint (file:///unsynced/manuel/.pub-cache/hosted/pub.dev/custom_lint-0.6.5/bin/custom_lint.dart:68:3)
<asynchronous suspension>
#15     main (file:///unsynced/manuel/.pub-cache/hosted/pub.dev/custom_lint-0.6.5/bin/custom_lint.dart:80:5)
<asynchronous suspension>

#0      CustomLintProject.parse.<anonymous closure> (package:custom_lint/src/workspace.dart:1028:7)
#1      _rootRunBinary (dart:async/zone.dart:1423:47)
#2      _CustomZone.runBinary (dart:async/zone.dart:1315:19)
#3      _FutureListener.handleError (dart:async/future_impl.dart:178:22)
#4      Future._propagateToListeners.handleError (dart:async/future_impl.dart:873:47)
#5      Future._propagateToListeners (dart:async/future_impl.dart:894:13)
#6      Future._completeError (dart:async/future_impl.dart:674:5)
<asynchronous suspension>

The /run/host/unsynced/manuel/Workspace/photos/code/app/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux/.dart_tool/ folder does not exist, although its parent folder is present on my machine. I didn't further debug this issue, so I don't know if it is a solidart_lint issue or something wrong with my setup. Maybe do you know what this is caused by? And can you test if you get the same kind of error?

@nank1ro
Copy link
Owner

nank1ro commented Sep 2, 2024

If it's .dart_tool you may delete it and get dependencies again.
I solved this issue with flutter packages update, you may find additional details in the custom_lint.log file

@nank1ro
Copy link
Owner

nank1ro commented Sep 2, 2024

Can you tell me which flutter version are you using?
With the flutter stable everything works to me, are you on the master channel?

I just have deployed the version 2.0.0-dev.2 of solidart_lint

@manuel-plavsic
Copy link
Collaborator Author

I am on the master channel, yes, due to macros. Since I switched some time ago and I have been working only on one side project, I didn't think about this at all.

Tomorrow I will test this with stable.

Thanks for deploying! It works now! Maybe that was due to me being on the master channel, or maybe not. Anyway, the score went from 110 to 150 on pub.dev 🚀

@nank1ro
Copy link
Owner

nank1ro commented Sep 2, 2024

I am on the master channel, yes, due to macros. Since I switched some time ago and I have been working only on one side project, I didn't think about this at all.

Tomorrow I will test this with stable.

Thanks for deploying! It works now! Maybe that was due to me being on the master channel, or maybe not. Anyway, the score went from 110 to 150 on pub.dev 🚀

It should be at 160, but seems like they run the tests using the latest master. Will fix it tomorrow 👍

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

2 participants