pub
pub copied to clipboard
Better error message when path dependencies cannot be found
It looks like pub somehow refuses to find pubspec.yaml in the temp folder.
Temp folder:
PS C:\Users\dacoharkes\AppData\Local\Temp\pkg_dartdev_test72e16586\dart_app> cat .\pubspec.yaml
name: dart_app
environment:
sdk: ">=2.18.0 <3.0.0"
dependencies:
my_native_library:
path: ../my_native_library
my_native_library2:
path: ../my_native_library2
PS C:\Users\dacoharkes\AppData\Local\Temp\pkg_dartdev_test72e16586\dart_app> dart pub get
Resolving dependencies...
Could not find a file named "pubspec.yaml" in "C:\Users\dacoharkes\AppData\Local".
Identical project not in temp folder:
PS C:\src\dart-sdk\sdk\pkg\native\test\test_projects\dart_app> dart pub get
Resolving dependencies...
Got dependencies!
PS C:\src\dart-sdk\sdk\pkg\native\test\test_projects\dart_app> cat .\pubspec.yaml
name: dart_app
environment:
sdk: ">=2.18.0 <3.0.0"
dependencies:
my_native_library:
path: ../my_native_library
my_native_library2:
path: ../my_native_library2
Ah, the referred pubspec.yaml contains a path dependency that was not properly string-replaced on Windows by my tests...
So could we have given a more precise error message?
Yes, mentioning not just the path that was being searched for, but also what caused us to search for that:
- path not found (currently in error message)
- pubspec.yaml path that caused us to search there, which might not be the one of the root package. (add to error message)
- contents of pubspec.yaml that caused us to search there, just for convenience so that you don't have to browse to the
dependencies-><package_name>->pathyourself to realize why this is happening. [You'll still have got go there to rectify the issue.] (add to error message)