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

Error: The setter 'useSummary' isn't defined for the class 'FolderBasedDartSdk'. #2745

Closed
alextekartik opened this issue Jul 6, 2020 · 14 comments · Fixed by #2746
Closed

Comments

@alextekartik
Copy link

Failure on travis: https://travis-ci.org/github/tekartik/sembast.dart/jobs/705520892

  • Dart SDK Version (dart --version)

2.8.4

  • What package(s) from this repo you are using, and the version (i.e. build_runner 0.7.12)

build_runner (no constraint)

  • What builder(s) you are using (or writing yourself). Try to give a short summary of what they do.

pub run build_runner test -- -p chrome

Failed to precompile build_runner:build_runner:
../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-1.3.9/lib/src/resolver.dart:329:7: Error: The setter 'useSummary' isn't defined for the class 'FolderBasedDartSdk'.
 - 'FolderBasedDartSdk' is from 'package:analyzer/src/dart/sdk/sdk.dart' ('../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.12/lib/src/dart/sdk/sdk.dart').
Try correcting the name to the name of an existing setter, or defining a setter or field named 'useSummary'.
    ..useSummary = false
      ^^^^^^^^^^
  • Whether you are using Windows, MacOSX, or Linux (if applicable)

Linux

  • Whether you are using Chrome, Safari, Firefox, Edge (if applicable)

Chrome

  • Any other packages or constraints we should know about

test: 1.15.2 just updated

@natebosch
Copy link
Member

cc @scheglov

Is there a replacement for this?

var sdk = FolderBasedDartSdk(resourceProvider, dartSdkFolder)
..useSummary = false
..analysisOptions = AnalysisOptionsImpl();

What is the migration path? Should we remove the assignment? Is there a min version we should use where it is safe to not assign this field?

@PlugFox
Copy link

PlugFox commented Jul 6, 2020

The same thing, killed the assembly CI/CD

@machinescream
Copy link

For now, it helps

dependency_overrides:
  analyzer: 0.39.11

@scheglov
Copy link
Contributor

scheglov commented Jul 6, 2020

  1. Yes, remove the assignment.

  2. More importantly, you should not do this at all. Analyzer now has buildSdkSummary, which you should use instead. It is available in 0.39.12.

@PlugFox
Copy link

PlugFox commented Jul 6, 2020

hot fix

dependencies:
  ...
  meta: '>=0.9.0 <1.2.0'
 
dev_dependencies:
  ...
  test: '<=1.15.2'
  build_runner: '>=1.0.0 <2.0.0'
  analyzer: '<=0.39.11' # https://github.com/dart-lang/build/issues/2745

@natebosch
Copy link
Member

2. Analyzer now has buildSdkSummary, which you should use instead. It is available in 0.39.12.

Do you have a plan to move this into the public API so we don't get broken again the next time it's changed?

natebosch added a commit that referenced this issue Jul 6, 2020
Fixes #2745

This remains behind a `src/` import, but it is the new approach to
building the summary.
@scheglov
Copy link
Contributor

scheglov commented Jul 6, 2020

Its result is probably not very useful unless you use some other non-API things like SummaryDataStore, but I guess you have to start with something while building API surface. This function seems quite isolated and does not expose anything non-API itself, so yes, I will do this. Later you will able to switch once we publish a new analyzer version.

natebosch added a commit that referenced this issue Jul 6, 2020
Fixes #2745

This leaves behind a `src/` import, but it is the new approach to
building the summary.
@natebosch
Copy link
Member

This should be resolved with a pub upgrade - you should pick up build_resolvers version 1.3.10 which has a fix.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jul 6, 2020
R=brianwilkerson@google.com

Bug: dart-lang/build#2745 (comment)
Change-Id: I144dd99be5e5a210e27f3b5b5b54951659479511
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@alextekartik
Copy link
Author

It's all good now. Thanks @natebosch for the fast fix

@Max-Might
Copy link

Max-Might commented Jul 8, 2020

I get this error too.

Exception: Error generating build_script snapshot: Failed to precompile build_runner:build_runner:
../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-1.3.7/lib/src/resolver.dart:332:7: Error: The setter 'useSummary' isn't defined for the class 'FolderBasedDartSdk'.

I do not have a direct dependency on build_resolvers and do not know which dependency pulls 1.3.7.
How can I force version 1.3.10?

Edit: my pubspec.lock file contains the following:

build_resolvers:
    dependency: transitive
    description:
      name: build_resolvers
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.3.10"

@natebosch do you have any idea what makes is use 1.3.7?

@jakemac53
Copy link
Contributor

jakemac53 commented Jul 8, 2020

@Max-Might You can add build_resolvers: ^1.3.10 as a dependency to your pubspec. That should either fix your problem or tell you why you can't solve for that version. If it fails and you need help understanding the message you can comment with it here.

Edit: Actually it looks like your pubspec.lock is updated to the latest, so I am not totally sure what is happening. Is this a flutter project?

@Max-Might
Copy link

Yep, it is a Flutter 1.17.5 project.

Here is the pubspec file:

name: <redacted>
description: <redacted>

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.3.0+54

environment:
  sdk: ">=2.8.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flutter_cupertino_localizations: ^1.0.1
  intl: ^0.16.1
  rxdart: ^0.24.1
  moor_flutter: ^3.0.0
  get_it: ^4.0.2
  dio: ^3.0.9
  encrypt: ^4.0.2
  flutter_secure_storage: ^3.3.3
  toast: ^0.1.5
  battery: ^1.0.1
  rx_shared_preferences: ^1.3.1
  tuple: ^1.0.3
  flutter_date_pickers: ^0.1.0
  badges: ^1.1.1
  sprintf: ^4.0.2
  auto_size_text: ^2.1.0
  device_info: ^0.4.2+4
  location:
    git:
      url: git://github.com/PrimeSwiftArt/flutterlocation.git
      ref: background-mode
  app_settings: ^3.0.1
  timezone: ^0.5.7
  get_version: ^0.2.2
  url_launcher: ^5.4.10
  image_picker: ^0.6.7+1
  file_picker: ^1.11.0+2
  path_provider: ^1.6.10
  open_file: ^3.0.1
  path: ^1.6.4
  crypto: ^2.1.3
  flutter_typeahead: ^1.8.3
  flutter_dialogs: 1.0.4
  flutter_slidable: ^0.5.4
  move_to_background: ^1.0.1
  uuid: 2.1.0

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  moor_generator: ^3.1.0
  r_flutter: ^0.6.0


# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - lib/assets/images/
    - lib/assets/i18n/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

builders:
  moor_generator: ^3.1.0
  r_flutter: ^0.6.0

r_flutter:
  intl: lib/assets/i18n/en.arb

@Max-Might
Copy link

I removed the builders section from the pubspeck file and now it seems to be working fine.

@jakemac53
Copy link
Contributor

Oh, if you were using the builders section that probably indicates the problem, cc @jonahwilliams not sure if you want to do anything there or know more. I think that ends up creating a separate nested package and might be setting some old dependency constraints on build_* packages.

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

Successfully merging a pull request may close this issue.

7 participants