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

PathNotFoundException when running dart run custom_lint #271

Closed
Rexios80 opened this issue Sep 12, 2024 · 7 comments · Fixed by #272
Closed

PathNotFoundException when running dart run custom_lint #271

Rexios80 opened this issue Sep 12, 2024 · 7 comments · Fixed by #272
Assignees
Labels
bug Something isn't working

Comments

@Rexios80
Copy link
Contributor

% dart run custom_lint
Building package executable... (1.7s)
Built custom_lint:custom_lint.
Failed to decode .dart_tool/package_config.json at /Users/rexios/repos/firebase_js_interop/example/fji_example/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux/example. Make sure to run `pub get` first.
PathNotFoundException: Cannot open file, path = '/Users/rexios/repos/firebase_js_interop/example/fji_example/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux/example/.dart_tool/package_config.json' (OS Error: No such file or directory, errno = 2)
#0      _checkForErrorResponse (dart:io/common.dart:56:9)
#1      _File.open.<anonymous closure> (dart:io/file_impl.dart:381:7)
#2      _rootRunUnary (dart:async/zone.dart:1422:47)
#3      _CustomZone.runUnary (dart:async/zone.dart:1324: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:937:34)
<asynchronous suspension>
#7      Future.wait.<anonymous closure> (dart:async/future.dart:520:21)
<asynchronous suspension>
#8      CustomLintWorkspace.fromContextRoots (package:custom_lint/src/workspace.dart:526: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:82: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:///Users/rexios/.pub-cache/hosted/pub.dev/custom_lint-0.6.7/bin/custom_lint.dart:68:3)
<asynchronous suspension>
#15     main (file:///Users/rexios/.pub-cache/hosted/pub.dev/custom_lint-0.6.7/bin/custom_lint.dart:80:5)
<asynchronous suspension>

#0      CustomLintProject.parse.<anonymous closure> (package:custom_lint/src/workspace.dart:940:7)
#1      _rootRunBinary (dart:async/zone.dart:1438:47)
#2      _CustomZone.runBinary (dart:async/zone.dart:1331:19)
#3      _FutureListener.handleError (dart:async/future_impl.dart:219:22)
#4      Future._propagateToListeners.handleError (dart:async/future_impl.dart:914:47)
#5      Future._propagateToListeners (dart:async/future_impl.dart:935:13)
#6      Future._completeError (dart:async/future_impl.dart:715:5)
<asynchronous suspension>
@Rexios80 Rexios80 added the bug Something isn't working label Sep 12, 2024
@rrousselGit
Copy link
Collaborator

Are you sure you're up-to-date? 0.6.6 should've fixed this (using a different solution)

@Rexios80
Copy link
Contributor Author

This is happening on 0.6.7

@rrousselGit
Copy link
Collaborator

I see that now.
I think the fix incorrectly only tested cases within .dart_tool. A slight tweak to the logic should be good

@DGoiana
Copy link

DGoiana commented Oct 8, 2024

I am still experiencing this issue, can you try and look at it?

@rrousselGit
Copy link
Collaborator

Should be fixed in 0.6.8

@DGoiana
Copy link

DGoiana commented Oct 8, 2024

Thanks! I guess that the problem was that you were iterating recursively through all directories, including packages that have pubspec.yaml. However, not all packages, like sentry_flutter, have a .dart-tool directory and therefore a package_config.json. Isn't there a better way to do it?

@rrousselGit
Copy link
Collaborator

If the fix caused a different problem, please raise an issue detailing the issue. As it is, I'm not sure what that is referring to. And the issue in the OP is fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants