Workiva / dependency_validator

A tool to help you find missing, under-promoted, over-promoted, and unused dependencies.
Other
59 stars 18 forks source link

Can't find path to build config on Windows, version 2.0.0 #68

Closed TNorbury closed 3 years ago

TNorbury commented 3 years ago

I updated to version 2.0.0 and I'm running into an error where the path to the build config is unable to be found. I get the following error message:

Unhandled exception: FileSystemException: No file found, path = 'D:\D:/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.0/pubspec.yaml'

0 _fromPackageDir (package:build_config/src/build_config.dart:198:3)

#1 BuildConfig.fromPackageDir (package:build_config/src/build_config.dart:32:27) #2 dependencyDefinesAutoAppliedBuilder (package:dependency_validator/dependency_validator.dart:316:24) #3 run (package:dependency_validator/dependency_validator.dart:263:15) #4 main (file:///D:/tools/flutter/.pub-cache/hosted/pub.dartlang.org/dependency_validator-2.0.0/bin/dependency_validator.dart:79:9) #5 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32) #6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

At first glance it looks like an additional drive label is being appended, however, I printed out the pubspec variable inside of _fromPackageDir and that returned /D:/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.0/pubspec.yaml. So perhaps it's just windows paths being formatted incorrectly. I tested this out on my mac and everything works fine.

Flutter Doctor

[✓] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.19041.630], locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Android Studio (version 3.6) [✓] VS Code (version 1.51.1)

evanweible-wf commented 3 years ago

Hi @TNorbury! Thanks for the report. I don't have a Windows machine to try this out on, but I think this may fix it: https://github.com/Workiva/dependency_validator/pull/69

Would you be able to give that branch a try?

TNorbury commented 3 years ago

@evanweible-wf Tried out that branch and got this error messsage instead:

Unhandled exception: FileSystemException: Exists failed, path = '/D:/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.0/bin' (OS Error: The filename, directory name, or volume label syntax is incorrect. , errno = 123)

0 _Directory.existsSync (dart:io/directory_impl.dart:94:7)

1 run (package:dependency_validator/dependency_validator.dart:281:16)

#2 main (file:///D:/tools/flutter/.pub-cache/git/dependency_validator-327ffc6c75f7edd7efe7c1dcb643271ce09bdadd/bin/dependency_validator.dart:79:9) #3 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32) #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
TNorbury commented 3 years ago

Hey @evanweible-wf, I found the other place that needed to be changed and submitted a PR to your branch with the relevant change

evanweible-wf commented 3 years ago

Thanks again for the help @TNorbury! That fix should be published as 2.0.1 now.