Open mengdouer opened 2 years ago
@jonasfj At first glance, this sounds more like a pub issue.
In case it helps, the invocation of pub
is here: https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/lib/src/plugin/plugin_manager.dart#L636.
@bwilkerson: do you feel we could do better error-reporting here?
I don't know because I don't understand the cause of the problem well enough to know whether we could have prevented it and or caught it early.
Sounds like someone is modifying PUB_HOSTED_URL
(to override the default pub server), and that this might not be propagated to the analysis_server.
This is not necessarily surprising, since the analysis_server might be started by an IDE and thus the PUB_HOSTED_URL
might not be set. Or maybe it's that the invocation doesn't propagate PUB_HOSTED_URL
(this is probably easy to fix).
A workaround might be to use the hosted: <url>
syntax in pubspec.yaml
:
https://dart.dev/tools/pub/custom-package-repositories#using-multiple-package-repositories
@mengdouer, I'm not 100% sure I actually understand what it is you're trying to do.
@jonasfj Yes, you are right. Thans for your help. this error can be solved by this method. But ask if there is a follow-up plan to fix this or need me to submit a PR to fix this bug?
But ask if there is a follow-up plan to fix this or need me to submit a PR to fix this bug?
We should probably fix the analyzer plugin stuff to forward the PUB_HOSTED_URL
.
I don't review analyzer patches, but I think you'd be welcome to contribute a patch, see CONTRIBUTING.md.
when i customize the analyze-plugin,bootstrap package.The yaml file in the bootstrap package needs to contain the host package.The company maintains a pub internally. The PUB_HOSTED_URL environment variable is modified, but it is found that bootstrap still only reads dependencies from the outside.The error stack is below, I want to know if there is something wrong with my usage
Failed to run pub upgrade pluginFolder = /Users/zzm/.dartServer/.plugin_manager/31278c5bbbb86f9fef098954e641b96f/analyzer_plugin exitCode = 69 stdout = Resolving dependencies...
stderr = Because test_plugin_bootstrap depends on bd_test_plugin any which doesn't exist (could not find package bd_test_plugin at https://pub.dartlang.org), version solving failed.