dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 228 forks source link

pub outdated provides results inconsistent with pub upgrade #2612

Closed bsutton closed 2 years ago

bsutton commented 4 years ago

Environment

2.9.0 OS Version Linux 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020

Problem

pub upgrade is reporting a different no. of 'newer versions' than pub outdated.

pub upgrade outputs:

21 packages have newer versions incompatible with dependency constraints.
Try `pub outdated` for more information.

pub outdate outputs:

Dependencies are all constrained to the latest resolvable versions.
Newer versions, while available, are not mutually compatible.

name: squarephone
description: SquarePhone is your business in your hand.

# don't allow our app to be made public!
publish_to: none

# 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: 1.0.0+1

environment:
  sdk: ">=2.8.0 <3.0.0"
  flutter: ">=1.17.0 <2.0.0"

dependencies:
  flutter:
    sdk: flutter

  audio: ^0.0.5
  badges: ^1.1.0
  cloud_firestore: ^0.13.5
  debounce_throttle: ^1.1.0
  dcache: 0.3.0
  effective_dart: ^1.2.1
  email_validator: ^1.0.0
  equatable: ^1.0.1
  faker: ^1.1.1
  file: ^5.0.10
  # for the list of firebase plugins and the current version numbers visit:
  # https://firebaseopensource.com/projects/firebaseextended/flutterfire/
  # firebase_core: ^0.4.3+1
  # firebase_auth: ^0.15.3
  # firebase_messaging: ^6.0.9
  firebase_core: ^0.4.4+3
  firebase_auth: ^0.16.0
  firebase_messaging: ^6.0.13
  flip: ^1.0.0
  flushbar:  1.10.4
  flutter_local_notifications: ^1.0.0
  flutter_sms: 2.0.1+2 
  flip_card: ^0.4.4
  flutter_offline: ^0.3.0
  sounds:
    git: 
      url: https://github.com/bsutton/sounds
      ref: dev

  flutter_spinkit: ^4.0.0
  flutter_svg: ^0.17.4
  font_awesome_flutter: ^8.5.0
  get_it: ^4.0.2
  intl: ^0.16.0
  json_annotation:
    ^3.0.0
    #path: ../json_serializable/json_annotation
  logger: ">=0.7.0+2 <1.0.0"
  material_design_icons_flutter: 4.0.5345 
  money2: ^1.2.0
  overlay_container: ^0.0.3+1
  page_transition: ^1.1.5
  path: ^1.6.4
  pedantic: ^1.9.0
  permission_handler: ^5.0.0
  provider: ^4.1.0
  quiver: ^2.1.3
  shared_preferences: ^0.5.0
  shimmer: ^1.0.1
  sliding_up_panel: ^1.0.2
  sip_ua: #0.0.2
    git:
      url: https://github.com/cloudwebrtc/dart-sip-ua.git
  table_calendar: ^2.0.2
  timezone: ^0.5.5
  url_launcher: ^5.1.4
  uuid: 2.2.0
  webview_flutter: ^0.3.15+1
  http2_client: ^1.0.0

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

dependency_overrides:
  sounds:
    path: /home/bsutton/git/sounds
   # git: 
    #  url: https://github.com/bsutton/sounds
          #ref: android-x

  #   path: 
  #     ../sounds
  #json_annotation:
  # path: ../json_serializable/json_annotation

  sip_ua:
    git:
      url: https://github.com/cloudwebrtc/dart-sip-ua.git
      #ref: with_configs

  #money2:
  #git:
  # url: git@github.com:noojee/money.dart.git
  #path: /home/bsutton/git/money.dart
  #  sounds:
  # git:
  #  url: git@github.com:noojee/sounds.git
  #path: ../sounds
  #http2_client:
  #path: ../http2_client

dev_dependencies:
  flutter_test:
    sdk: flutter
  test: any #1.6.3
  build_runner: ^1.7.1
  #dshell: ^1.8.14-dev.2

  # JSON Serialization Buider:
  #
  # run from the project root:
  #      install build_runner with:
  #
  #      pub global activate build_runner
  #
  #      then run: the 'watch' verb will allow the builder to run and monitor edits
  #       each time you edit a file it will rebuild the files json serialisation.
  #
  #      flutter pub run build_runner watch --delete-conflicting-outputs
  #
  # this will generate json files for each source annotated
  # with @JsonSerializable(nullable: true)
  json_serializable:
    ^3.2.2
    #path: ../json_serializable/json_serializable

# 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:
  #  - images/a_dot_burr.jpeg
  #  - images/a_dot_ham.jpeg

  # 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

  assets:
    - assets/icons/AfterHours.svg
    - assets/icons/AboutUs.svg
    - assets/icons/Back.svg
    - assets/icons/BusinessHours.svg
    - assets/icons/Conference.svg
    - assets/icons/Contacts.svg
    - assets/icons/Dashboard.svg
    - assets/icons/Dialer.svg
    - assets/icons/DND.svg
    - assets/icons/Greetings.svg
    - assets/icons/Help.svg
    - assets/icons/Holidays.svg
    - assets/icons/Invite.svg
    - assets/icons/Limits.svg
    - assets/icons/New.svg
    - assets/icons/Nightswitch.svg
    - assets/icons/Office.svg
    - assets/icons/OfficeHours.svg
    - assets/icons/OverrideHours.svg
    - assets/icons/PhoneNoManagement.svg
    - assets/icons/Profile.svg
    - assets/icons/Support.svg
    - assets/icons/Settings.svg
    - assets/icons/TeamMembers.svg
    - assets/icons/TeamSettings.svg
    - assets/icons/Training.svg
    - assets/icons/Users.svg
    - assets/icons/Voicemail.svg
    - assets/vaadin-svg/clock.svg
    - assets/vaadin-svg/flip-v.svg
    - assets/vaadin-svg/microphone.svg
    - assets/vaadin-svg/mobile.svg
    - assets/vaadin-svg/moon.svg
    - assets/vaadin-svg/moon-o.svg
    - assets/vaadin-svg/phone-landline.svg
    - assets/vaadin-svg/select.svg
    - assets/vaadin-svg/sun-down.svg
    - assets/vaadin-svg/sun-o.svg
    - assets/vaadin-svg/sun-rise.svg
    - assets/vaadin-svg/volume.svg
    - assets/vaadin-svg/close-circle-o.svg
    - assets/vaadin-svg/question-circle-o.svg
    # hack for timezone package not finding its timezone db.
    # - packages/assets/timezone/data/2019b.tzf
    # use this form if 'assets' is under the lib directory
    # - packages/squarephone/assets/timezone/data/2019b.tzf
    - assets/timezone/data/2019b.tzf

    # html assets
    - assets/html/email_templates/recovery.html

    # 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

Expected behavior

I would expect that pub outdated would have listed the 21 packages or a least directly mention the count that pub get said were outdated.

e.g. 21 newer versions, while available, are not mutually compatible.

This provides a 'closing of the loop' mentally for a user when comparing these two outputs.

Actual behavior

pub outdated reported that all packages were up to date.

--trace output

pub upgrade trace

pub --trace upgrade
Resolving dependencies... (6.6s)
  _fe_analyzer_shared 6.0.0
  analyzer 0.39.16
  archive 2.0.13
  args 1.6.0
  async 2.4.1 (2.4.2 available)
  audio 0.0.5
  badges 1.1.1
  boolean_selector 2.0.0
  build 1.3.0
  build_config 0.4.2
  build_daemon 2.1.4
  build_resolvers 1.3.11
  build_runner 1.10.0 (1.10.2 available)
  build_runner_core 5.2.0 (6.0.1 available)
  built_collection 4.3.2
  built_value 7.1.0
  charcode 1.1.3
  checked_yaml 1.0.2
  cli_util 0.1.4 (0.2.0 available)
  cloud_firestore 0.13.7
  cloud_firestore_platform_interface 1.1.2
  cloud_firestore_web 0.1.1+2
  code_builder 3.4.0
  collection 1.14.12 (1.14.13 available)
  connectivity 0.4.9
  connectivity_for_web 0.3.1
  connectivity_macos 0.1.0+3
  connectivity_platform_interface 1.0.6
  convert 2.1.1
  coverage 0.13.11 (0.14.0 available)
  crypto 2.1.4 (2.1.5 available)
  csslib 0.16.2
  cupertino_icons 0.1.3
  dart_style 1.3.6
  dcache 0.3.0
  debounce_throttle 1.1.0
  device_info 0.4.2+4
  effective_dart 1.2.4
  email_validator 1.0.5
  equatable 1.2.3
  faker 1.2.1
  file 5.2.1
  firebase 7.3.0
  firebase_auth 0.16.1
  firebase_auth_platform_interface 1.1.8
  firebase_auth_web 0.1.3+1
  firebase_core 0.4.5
  firebase_core_platform_interface 1.0.4
  firebase_core_web 0.1.1+2
  firebase_messaging 6.0.16
  fixnum 0.10.11
  flip 1.0.0
  flip_card 0.4.4
  flushbar 1.10.4
  flutter 0.0.0 from sdk flutter
  flutter_local_notifications 1.4.4+2
  flutter_local_notifications_platform_interface 1.0.1
  flutter_offline 0.3.0
  flutter_sms 2.0.1+2
  flutter_spinkit 4.1.2+1
  flutter_svg 0.17.4 (0.18.0 available)
  flutter_test 0.0.0 from sdk flutter
  flutter_web_plugins 0.0.0 from sdk flutter
  flutter_webrtc 0.2.8
  font_awesome_flutter 8.8.1
  get_it 4.0.4
  glob 1.2.0
  graphs 0.2.0
  html 0.14.0+3
  http 0.12.2
  http2 1.0.0
  http2_client 1.0.2
  http_multi_server 2.2.0
  http_parser 3.1.4
  image 2.1.12 (2.1.14 available)
  intl 0.16.1
  io 0.3.4
  js 0.6.2
  json_annotation 3.0.1
  json_serializable 3.4.0
  lists 0.1.6
  logger 0.9.2
  logging 0.11.4
  matcher 0.12.6 (0.12.9 available)
  material_design_icons_flutter 4.0.5345
  meta 1.1.8 (1.2.2 available)
  mime 0.9.6+3
  money2 1.4.3
  multi_server_socket 1.0.2
  nested 0.0.4
  node_interop 1.1.1
  node_io 1.1.1
  node_preamble 1.4.12
  overlay_container 0.0.4+1
  package_config 1.9.3
  page_transition 1.1.6
  parser_error 0.1.1
  path 1.6.4 (1.7.0 available)
  path_drawing 0.4.1
  path_parsing 0.1.4
  path_provider 1.6.11
  path_provider_linux 0.0.1+2
  path_provider_macos 0.0.4+3
  path_provider_platform_interface 1.0.2
  pedantic 1.9.0 (1.9.2 available)
  permission_handler 5.0.1+1
  permission_handler_platform_interface 2.0.1
  petitparser 2.4.0 (3.1.0 available)
  platform 2.2.1
  platform_detect 1.4.0
  plugin_platform_interface 1.0.2
  pool 1.4.0
  process 3.0.13
  provider 4.3.2
  pub_semver 1.4.4
  pubspec_parse 0.1.5
  quiver 2.1.3
  random_string 1.1.0 (2.1.0 available)
  recase 3.0.0
  sdp_transform 0.2.0
  shared_preferences 0.5.8
  shared_preferences_linux 0.0.2+1
  shared_preferences_macos 0.0.1+10
  shared_preferences_platform_interface 1.0.4
  shared_preferences_web 0.1.2+7
  shelf 0.7.7
  shelf_packages_handler 2.0.0
  shelf_static 0.2.8
  shelf_web_socket 0.2.3
  shimmer 1.1.1
  simple_gesture_detector 0.1.4
  simple_observable 1.1.0+2
! sip_ua 0.2.2 from git https://github.com/cloudwebrtc/dart-sip-ua.git at 922910 (overridden)
  sky_engine 0.0.99 from sdk flutter
  sliding_up_panel 1.0.2
! sounds 0.9.3 from path /home/bsutton/git/sounds (overridden)
  sounds_common 1.0.7
  source_gen 0.9.6
  source_map_stack_trace 2.0.0
  source_maps 0.10.9
  source_span 1.7.0
  stack_trace 1.9.3 (1.9.5 available)
  stream_channel 2.0.0
  stream_transform 1.2.0
  string_scanner 1.0.5
  table_calendar 2.2.3
  term_glyph 1.1.0
  test 1.14.4 (1.15.3 available)
  test_api 0.2.15 (0.2.18 available)
  test_core 0.3.4 (0.3.11 available)
  text 0.1.1
  timezone 0.5.7
  timing 0.1.1+2
  tuple 1.0.3
  typed_data 1.1.6 (1.2.0 available)
  url_launcher 5.5.0
  url_launcher_linux 0.0.1+1
  url_launcher_macos 0.0.1+7
  url_launcher_platform_interface 1.0.7
  url_launcher_web 0.1.2
  uuid 2.2.0
  vector_math 2.0.8
  vm_service 4.2.0
  watcher 0.9.7+15
  web_socket_channel 1.1.0
  webkit_inspection_protocol 0.7.3
  webview_flutter 0.3.22+1
  xdg_directories 0.1.0
  xml 3.6.1 (4.3.0 available)
  yaml 2.2.1
Warning: You are using these overridden dependencies:
! sip_ua 0.2.2 from git https://github.com/cloudwebrtc/dart-sip-ua.git at 922910
! sounds 0.9.3 from path /home/bsutton/git/sounds
No dependencies changed.
21 packages have newer versions incompatible with dependency constraints.
Try `pub outdated` for more information.

pub outdated trace

pub --trace outdated
Dependencies       Current             Upgradable          Resolvable          Latest   
flutter_svg        0.17.4              0.17.4              0.17.4              0.18.0   
path               1.6.4               1.6.4               1.6.4               1.7.0    
pedantic           1.9.0               1.9.0               1.9.0               1.9.2    
sip_ua             0.2.2 (overridden)  0.2.2 (overridden)  0.2.2 (overridden)  0.2.2    
sounds             0.9.3 (overridden)  0.9.3 (overridden)  0.9.3 (overridden)  0.8.1    

dev_dependencies  
build_runner       1.10.0              1.10.0              1.10.0              1.10.2   
test               1.14.4              1.14.4              1.14.4              1.15.3   

transitive dependencies
async              2.4.1               2.4.1               2.4.1               2.4.2    
collection         1.14.12             1.14.12             1.14.12             1.14.13  
crypto             2.1.4               2.1.4               2.1.4               2.1.5    
matcher            0.12.6              0.12.6              0.12.6              0.12.9   
meta               1.1.8               1.1.8               1.1.8               1.2.2    
petitparser        2.4.0               2.4.0               2.4.0               3.1.0    
random_string      1.1.0               1.1.0               1.1.0               2.1.0    
stack_trace        1.9.3               1.9.3               1.9.3               1.9.5    
typed_data         1.1.6               1.1.6               1.1.6               1.2.0    
xml                3.6.1               3.6.1               3.6.1               4.3.0    

transitive dev_dependencies
build_runner_core  5.2.0               5.2.0               5.2.0               6.0.1    
cli_util           0.1.4               0.1.4               0.1.4               0.2.0    
coverage           0.13.11             0.13.11             0.13.11             0.14.0   
image              2.1.12              2.1.12              2.1.12              2.1.14   
test_api           0.2.15              0.2.15              0.2.15              0.2.18   
test_core          0.3.4               0.3.4               0.3.4               0.3.11   

Dependencies are all constrained to the latest resolvable versions.
Newer versions, while available, are not mutually compatible.
sigurdm commented 4 years ago

Hmm i can see how this is confusing.

upgrade counts packages where the current version differs from the latest. outdated has two counts:

The 21 packages pub upgrade mentions are exactly the 21 packages listed by pub outdated (plus the two overridden), and the ones implied in "Newer versions, while available, are not mutually compatible."

@jonasfj wdyt? should we add the count of "packages not at latest" to the outdated output?

jonasfj commented 4 years ago

Newer versions, while available, are not mutually compatible.

Hmm, yeah, maybe we write something like:

While 21 newer versions is available, they are not mutually compatible.

I do like the "Newer versions" phrasing. I'm probably not the best to come up with a better message.

bsutton commented 4 years ago

You suggest of 'while 21...' seems fine.

The main idea is to close the loop so a user can see that the two pieces align.

mpoirier101 commented 3 years ago

I have the same message when using pub upgrade/outdated (async, device_info, package_info)... But it creates a real problem in my code !

Example: Target of URI doesn't exist: 'package:device_info/device_info.dart'. Try creating the file referenced by the URI, or Try using a URI for a file that does exist.

Any idea how can I fix this ?

Thanks!

sigurdm commented 3 years ago

@mpoirier101 can. you give more details of what you are trying to do, and what happens? (pubspec.yaml, commands run, dart pub --version etc)

mpoirier101 commented 3 years ago

It's been a while. I moved to a new project since... Sorry!

Michel Poirier Développeur WEB/Mobile Sainte-Agathe-des-Monts, QC [image: LinkedIn] http://ca.linkedin.com/in/michelpoirier101

On Fri, Aug 6, 2021 at 4:01 AM Sigurd Meldgaard @.***> wrote:

@mpoirier101 https://github.com/mpoirier101 can. you give more details of what you are trying to do, and what happens? (pubspec.yaml, commands run, dart pub --version etc)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/pub/issues/2612#issuecomment-894080316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFCG6G5C4L5AQCOTTFPXBXLT3OJGFANCNFSM4P2PIAXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .