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

Failures on [co19] Roll co19_2 to 1c2e425f461bfae7de6db7014fc44a58fc72b4a8 #1090

Closed
athomas opened this issue May 20, 2021 · 7 comments
Closed
Assignees

Comments

@athomas
Copy link
Member

athomas commented May 20, 2021

There are new test failures on [co19] Roll co19_2 to 1c2e425f461bfae7de6db7014fc44a58fc72b4a8.

The tests

co19_2/Language/Libraries_and_Scripts/Scripts/syntax_t11 CompileTimeError (expected Pass)

are failing on configurations

analyzer-asserts-linux
@eernstg
Copy link
Member

eernstg commented May 20, 2021

It looks like this failure is caused by running the analyzer with --default-language-version=2.7, which is considered to override the language version in the test library, but not in the associated part.

So, presumably, we should just stop passing that option to dartanalyzer when the co19_2 tests all have a language version tag?

@sgrekhov
Copy link
Contributor

Seems that explanation to the failure siggested by @eernstg is the right one. I don't see anything else that could broke this test. @athomas why do you think about Erik's suggestion?

@athomas
Copy link
Member Author

athomas commented May 27, 2021

Makes sense, I'll give it a try here:
https://dart-review.googlesource.com/c/sdk/+/201564/

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jun 2, 2021
dart-lang/co19#1090

TEST=Standard tryjobs, all changes are in test code only.

Change-Id: Ie73174447ab165827335652cf035f85b7510ab55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201564
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
@sgrekhov
Copy link
Contributor

sgrekhov commented Jun 7, 2021

@athomas @eernstg With the change above in the SDK the test is still failing. On the fresh build of the SDK it produces

sgrekhov@SGREKHOV-HP:~/Google/dart-sdk/sdk$ python3 tools/test.py -n analyzer-asserts-linux co19_2/Language/Libraries_and_Scripts/Scripts/syntax_t11
Test configuration:
    analyzer-asserts-linux(architecture: x64, compiler: dart2analyzer, mode: release, runtime: none, system: linux, enable-asserts, use-sdk)
Suites tested: co19_2

FAILED: dart2analyzer-none release_x64 co19_2/Language/Libraries_and_Scripts/Scripts/syntax_t11
Expected: Pass
Actual: CompileTimeError

--- Command "dart2analyzer" (took 02.000611s):
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dartanalyzer --ignore-unrecognized-flags --packages=/home/sgrekhov/Google/dart-sdk/sdk/.packages --format=json --no-hints /home/sgrekhov/Google/dart-sdk/sdk/tests/co19_2/src/Language/Libraries_and_Scripts/Scripts/syntax_t11.dart

unexpected analysis errors in syntax_t11.dart:
- Line 26, column 8: HINT.UNUSED_IMPORT
  Unused import: 'library1.dart'.

- Line 27, column 8: HINT.UNUSED_IMPORT
  Unused import: 'library2.dart'.

- Line 31, column 6: COMPILE_TIME_ERROR.INCONSISTENT_LANGUAGE_VERSION_OVERRIDE
  Parts must have exactly the same language version override as the library.

--- Re-run this test:
python3 tools/test.py -n analyzer-asserts-linux co19_2/Language/Libraries_and_Scripts/Scripts/syntax_t11
[00:02 | 100% | +    0 | -    1]

=== 0 tests passed, 1 failed ===

As you can see there is no --default-language-version in a Dart configuration any longer and all of the files and libraries contain // @dart = 2.9 flag.

The problem is that this test contains #! scripts tag in the very first line. If to remove this string then the test starts passing. Is this an infra issue that script tag breaks version overriding?

@sgrekhov sgrekhov self-assigned this Jun 7, 2021
@eernstg
Copy link
Member

eernstg commented Jun 7, 2021

It's the analyzer, and we should have an SDK issue about this behavior, with area-analyzer. The language version feature spec explicitly indicates that a script tag can occur before the language version comment:

The syntax for choosing a different language version than the default is a single source
line consisting only of a single-line comment of the form // @dart = 2.0 (exactly two slashes,
the string @dart, an =, and a version string which is two decimal numerals separated by .)
in the initial part of the file, prior to any language declarations. It can be preceded by a #! line
or by other comments, but not by a library declaration or any other declaration.

@eernstg
Copy link
Member

eernstg commented Jun 7, 2021

I created this one: dart-lang/sdk#46273.

@sgrekhov
Copy link
Contributor

sgrekhov commented Jun 8, 2021

With the dart-lang/sdk#46273 fixed there is no more this failure any longer on the fresh SDK build. Thank you

@sgrekhov sgrekhov closed this as completed Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants