-
Notifications
You must be signed in to change notification settings - Fork 323
Error message when failing to resolve package:pedantic include in analysis_options.yaml is not descriptive enough #3259
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
Comments
I don't seem to be able to repro - though I have some questions:
|
For unrelated reasons, I ran pub upgrade and discovered that I had an old
analyzer package associated with this work. Could that perhaps be a factor,
I wonder? Will see if I can get it to repro.
…On Tue, Apr 6, 2021 at 10:49 AM Danny Tuppeny ***@***.***> wrote:
I don't seem to be able to repro - though I have some questions:
- Do you know if the file might not have existed when you opened the
project (eg. you later ran Pub Get and we didn't clear the error), or do
you think the was there from the start?
- Ca.n you reproduce it reliably?
- Is your pubspec.yaml that references pedantic in the same folder as
the analysis_options.yaml?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3259 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARWL6Y33ASSYP4XP5NNU4LTHNCTDANCNFSM42PFNNCQ>
.
|
In theory, any analyzer referenced by the project shouldn't impact the analyzer being used by the editor (we always run the snapshot from the SDK), so I suspect not related. Let me know if you can repro though (if you can share a project that is triggering it when you open it, that would be particularly useful). I'll have a go on Windows too, in case that was a factor (though I suspect not). |
This issue has been marked stale because it is tagged awaiting-info for 30 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days. |
@timsneath have you seen this since? I tried to repro on Windows without any luck. |
This continues to repro upon occasion, yes.
…On Mon, May 17, 2021 at 3:50 AM Danny Tuppeny ***@***.***> wrote:
@timsneath <https://github.com/timsneath> have you seen this since? I
tried to repro on Windows without any luck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3259 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARWL65UX4FDYYNKX2P44XDTODYIXANCNFSM42PFNNCQ>
.
|
Do you happen to know if it's when you're missing the packages locally (eg. fresh clone and haven't run I can't see any obvious causes in the code. If the file exists on disk during analysis ofcourse the error should never be generated. If it doesn't, when when the It might be useful to run with the analysis_server log and/or analysis_server instrumentation log enabled, and when you next see it grab a copy of those files so we can see if there are any clues in there. |
Sorry -- I know I'm a bit intermittent at replying here. This is the kind
of thing that only happens when I'm deep in the middle of solving an
unrelated problem, and it's hard to step out of the zone to reproduce. I
suspect it might have to do with changing branches of my codebase, perhaps
where the pub package versions are invalidated. I'll try and capture it if
I can.
…On Tue, May 18, 2021 at 6:15 AM Danny Tuppeny ***@***.***> wrote:
Do you happen to know if it's when you're missing the packages locally
(eg. fresh clone and haven't run pub get yet)? What version(s) of the
SDKs do you tend to use?
I can't see any obvious causes in the code. If the file exists on disk
during analysis ofcourse the error should never be generated. If it
doesn't, when when the .packages or .dart_tool/package_config.json files
are written it re-creates the analysis contexts which re-triggers analysis
of this.
It might be useful to run with the analysis_server log
<https://dartcode.org/docs/logging/#analyzer> and/or analysis_server
instrumentation log
<https://dartcode.org/docs/logging/#analyzer-instrumentation> enabled,
and when you next see it grab a copy of those files so we can see if there
are any clues in there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3259 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARWL63S27ELBICVCVGYSY3TOJR6XANCNFSM42PFNNCQ>
.
|
I just hit what seems like this problem myself, although what triggered it was a little weird so I'm not sure if it's the same for you. I opened I found that I had a I'm able to reproduce this with a nested project like this:
If I fetch packages for both projects, I see the warning above because the analysis server seems to use the Whilst this initially seemed like a bug, I think actually it may be working as intended (although it's confusing). I don't believe it's using the wrong package file to analyze the analys_options file, I think it's analysing the file twice. Once in the context of the root project (which works, because it uses the package paths from the root project) and then again in the context of the nested project (since it walks up the tree and finds that anlaysis_options file, then tries to pare is using the nested projects package paths). So although the way the error is reported looks like it's for the root project, it's actually for the context of a nested project. @bwilkerson assuming this is working as expected, perhaps there's something we could tag onto the error message to make it clearer? Currently it says:
Perhaps we could tag something onto the end when the analysis_options file is not inside the context? For example:
|
Yes, it's working as intended. At each directory for which either the package mapping ( I agree that the message could be more helpful, and I like your suggestion. |
May fix Dart-Code/Dart-Code#3259. Change-Id: I4a81acd9186efacc90584c756fc9aef224378c65 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202964 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@timsneath let me know if you see this again once you're using an SDK that includes dart-lang/sdk@6d763b4. The error message will hopefully be clearer. My guess is that either it's something similar to the above (like a nested project), or you've somehow ended up with a path to the pedantic library in |
Is there a |
There's a I should note in passing that I'm not sure how that |
The image shows you including When analyzing files in |
Doh! That's stupid of me. Lint vs. Lints -- gah!
I don't know how this project got into this state. Will keep monitoring for
other examples.
…On Fri, Jun 11, 2021 at 12:46 PM Brian Wilkerson ***@***.***> wrote:
The image shows you including package:lints/recommended.yaml, not lint
(note the lack of an s), and I'm guessing that the file runner/.packages
doesn't have an entry for lints.
When analyzing files in runner, the analyzer uses both the file
runner/.packages and the file analysis_options.yaml. The analysis options
file contains a URI for package:lints, but the .packages file doesn't
contain a mapping for that package, which is what caused the error.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3259 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARWL63TFX2UYHJQO7663UDTSJR27ANCNFSM42PFNNCQ>
.
|
@timsneath are you happy for me to close this as addressed by dart-lang/sdk@6d763b4 (including the folder in the error message), and if it comes up again and isn't explained by something like the above, we can re-open or file another issue? |
Yeah, totally fine. The error message will now make it much easier to diagnose (modulo confusion over lint vs. lints). |
See screenshot.
This used to occur regularly, but had gone away for some months. Now it's back again. Could this be a regression?
The include file package:pedantic/analysis_options.yaml in c:\src\win32\analysis_options.yaml cannot be found.
The text was updated successfully, but these errors were encountered: