nank1ro / solidart

Signals in Dart and Flutter, inspired by SolidJS
https://docs.page/nank1ro/solidart
MIT License
155 stars 5 forks source link

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

Open manuel-plavsic opened 3 weeks ago

manuel-plavsic commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 πŸ‘