Skip to content
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

Code generation causes InconsistentAnalysisException with multiple targets #198

Closed
eernstg opened this issue Feb 27, 2020 · 2 comments
Closed
Labels

Comments

@eernstg
Copy link
Collaborator

eernstg commented Feb 27, 2020

The following commands show that reflectable currently fails to generate code when dependencies have been fully updated (pub upgrade):

> git clone 'https://github.com/dart-lang/test_reflectable.git'
> cd test_reflectable
> cd tool
> make

This causes a number of failures like this:

[SEVERE] reflectable:reflectable on test/invoke_test.dart.vm_test.dart:

InconsistentAnalysisException: Requested result might be inconsistent with previously returned results

However, it only seems to affect code generation in the case where there are multiple targets, that is, when code generation occurs for multiple separate entry points ("programs").

We do not yet know why this happens, but it may be caused by some changes in the way the build related packages give notifications to the analyzer about changed files, cf. dart-lang/build#2634.

@eernstg
Copy link
Collaborator Author

eernstg commented Sep 11, 2020

This PR uses the workaround from dart-lang/build#2634 to eliminate the inconsistency.

eernstg added a commit that referenced this issue Sep 28, 2020
This PR changes reflectable to to obtain a fresh resolved library at each invocation of `getResolvedLibraryByElement`, thus eliminating the `InconsistentAnalysisException` which was reported in #198 and dart-lang/build#2634.
@eernstg
Copy link
Collaborator Author

eernstg commented Sep 28, 2020

Finally closing this one: Resolved by #220!

@eernstg eernstg closed this as completed Sep 28, 2020
eernstg added a commit that referenced this issue Dec 1, 2020
eernstg added a commit that referenced this issue Dec 3, 2020
Update analyzer dependency to allow all versions until 0.41.1. Issue #227 reports that 'lib/main.dart' is skipped during code generation; this PR fixes that. Issue #198 about InconsistentAnalysisException re-emerged with analyzer 0.40.5, workaround from google/built_value.dart#941 adopted.

This PR also adds // @Dart=2.9 to tests, because they do not get the language version from the pubspec.yaml.

Prepare for publishing as 2.2.9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant