-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
goal: switch analyzer to use --use-fasta-parser by default #33543
Comments
CL in progress here: https://dart-review.googlesource.com/c/sdk/+/67090 |
@danrubel, it looks like we're not able to build the SDK with this flag on by default (I assume mostly the change to the The build is failing when DDC tries to build the summary of the Dart SDK libraries. It doesn't proceed if it finds any compilation errors (warnings are OK). W/ this flag flip, we're now reporting lots of errors in places we hadn't before. I assume these were things that are special cased by the analyzer's parser? This must be handled by DDC already in some fashion, in order to build DDK. |
and, /cc'ing @jmesserly, for the DDC / DDK question |
Actually, to see the repro, you need to switch the default for |
I can take a look, thanks for letting me know! Those errors look like the imports/part-of are not working in the SDK. In particular:
this means we fail to resolve How does URI resolution work when Analyzer is configured to Another question: does Analyzer support |
fyi -- I will be out for 3 weeks starting Monday. So I'll see if I can figure this out today. :) |
I don't know for sure, but would suspect that the uri resolution is the same (that switching the parser doesn't change how we do resolution).
@danrubel, do you know? |
I haven't been able to reproduce this by setting the flag on AnalysisOptionsImpl (and cleaning my build output) ... is it possible I need to patch in the full CL? Is there somewhere in Analyzer that I can add a |
spoke too soon ... I was able to repro by pulling in part of that CL:
|
Awesome! I did find that I also had to delete my cached build of the SDK as well. |
yeah I'd cleaned my output already. It needs clean output plus that It looks like the I'll see if I can figure out why some part files are not getting copied. |
parseDirectives fails to parse any directives for https://github.com/dart-lang/sdk/blob/master/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart ... does that give y'all enough info to investigate? |
Woohoo, thanks! A parser smoking gun :) I'll open a separate issue for that; thanks for the investigation. |
this appears to be the fix to CFE: diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index 93c34fc709..499e652899 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -381,6 +381,7 @@ class Parser {
token = parseScript(token);
} else {
token = parseMetadataStar(token);
+ final String value = token.next.stringValue;
if (identical(value, 'import')) {
directiveState?.checkImport(this, token);
token = parseImport(token); I'll leave this to someone more familiar with CFE to land. Basically, even though it parsed the metadata, it was still using the |
I'm guessing library metadata isn't all that common, so this hasn't been hit. Also IDK if the |
@jmesserly Yes, that was the problem. Thank you! |
@jcollins-g just landed a CL to do this. |
No description provided.
The text was updated successfully, but these errors were encountered: