dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.25k stars 1.58k forks source link

inconsistent deprecated_member_use_from_same_package between two machines on same SDK version? #35750

Closed kevmoo closed 5 years ago

kevmoo commented 5 years ago

pubspec_parse at a specific commit: https://github.com/dart-lang/pubspec_parse/commit/5557745c2acbe757d7a6fd8740b0502e4cf83e50

Dart VM version: 2.1.1-dev.3.2

On my mac, dartanalyzer --fatal-infos --fatal-warnings . runs fine – zero errors/warnings/hints

On travis, with the same SDK version (but on linux)

https://travis-ci.org/dart-lang/pubspec_parse/jobs/484095285#L506-L515

$ dartanalyzer --fatal-infos --fatal-warnings .
Analyzing pubspec_parse...
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:19:18 • deprecated_member_use_from_same_package
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:52:18 • deprecated_member_use_from_same_package
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:128:20 • deprecated_member_use_from_same_package
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:138:20 • deprecated_member_use_from_same_package
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:148:20 • deprecated_member_use_from_same_package
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:159:20 • deprecated_member_use_from_same_package
  hint • 'author' is deprecated and shouldn't be used at test/parse_test.dart:170:20 • deprecated_member_use_from_same_package
7 hints found.

🤷‍♂️

kevmoo commented 5 years ago

Related commit? https://github.com/dart-lang/sdk/commit/c54bc11770fd35ee739c7abac247029a99536553 @srawlins

kevmoo commented 5 years ago

@scheglov @stereotype441 – ides?

srawlins commented 5 years ago

On your mac, what happens if you remove the // ignore: deprecated_member_use directive in test/parse_test.dart?

srawlins commented 5 years ago

And just to double-check, on your mac, what about dartanalyzer --version?

kevmoo commented 5 years ago

I get

info: 'author' is deprecated and shouldn't be used. (deprecated_member_use at [pubspec_parse] test/parse_test.dart:127)

also

$ dartanalyzer --version
dartanalyzer version 2.1.1-dev.3.2
srawlins commented 5 years ago

I suspect this is an issue with the Workspace concept; on travis, .dart_tool is never generated, so it thinks it is in a PubWorkspace; but on your Mac, I'll bet you do have a .dart_tool in this repo checkout, so it thinks its a PackageBuildWorkspace.

kevmoo commented 5 years ago

I suspect this is an issue with the Workspace concept;

Yup! Deleting .dart_tool on my mac gives me the same output! Feel free to rename this issue to track the "real" problem...