Skip to content

Dart package analysis fails on pub.dev, work locally #7521

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

Closed
chenasraf opened this issue Feb 23, 2024 · 2 comments
Closed

Dart package analysis fails on pub.dev, work locally #7521

chenasraf opened this issue Feb 23, 2024 · 2 comments

Comments

@chenasraf
Copy link

Environment

  • Dart version (run dart --version): Dart SDK version: 3.3.0 (stable) (Tue Feb 13 10:25:19 2024 +0000) on "macos_arm64"
  • OS kind and version (e.g. "Windows 10, version 1809" or "macOS 12.4"): macOS Sonoma 14.3.1 (23D60)
  • Are you using the Chinese community mirror or a corporate firewall? no

Problem

Dart Analysis works and passes on my machine, but fails with errors on Dart.pub.

This causes the score to drop significantly (it is currently at 70).

pubspec.yaml
name: script_runner
description: Run all your project-related scripts in a portable, simple config.
version: 0.7.2
homepage: https://casraf.dev/
repository: https://github.com/chenasraf/dart_script_runner
license: MIT
environment:
  sdk: '>=3.2.2 <4.0.0'

dependencies:
  file: ^7.0.0
  path: '>=1.8.0 <2.0.0'
  unaconfig: ^0.3.1
  # unaconfig:
  #   path: ../unaconfig

dev_dependencies:
  lints: any
  test: any
  btool: any

script_runner:
  # line_length: 100
  scripts:
    # Real
    - auto-fix: dart fix --apply
    - publish: dart format .; dart pub publish; format
    - publish:dry: dart pub publish --dry-run
    - doc: dart doc
    - name: version
      cmd: dart run btool get packageVersion
      display_cmd: false
    - name: 'version:set'
      cmd: dart run btool set packageVersion
      display_cmd: false
    - format: dart format --line-length 120 .

    # Examples
    - name: echo1
      cmd: echo "Hello World" $SHELL
      description: Interdum a scelerisque arcu felis taciti ligula pellentesque curabitur, suspendisse adipiscing quisque sed luctus elementum in imperdiet id, praesent enim sem justo sapien diam nec. Quisque erat risus sagittis penatibus per, vehicula sociosqu cubilia convallis, sollicitudin scelerisque cras aptent. Natoque ornare dictumst netus litora mollis suspendisse cubilia proin morbi primis consequat eu massa, cursus non urna ridiculus dolor duis tempus ut nam velit lacus viverra. A interdum senectus eu mus leo aptent facilisi augue tristique ante purus condimentum pulvinar porta viverra morbi, et tellus gravida porttitor non euismod suscipit neque egestas praesent arcu luctus pharetra fusce. Luctus mauris a venenatis tempus cras ante efficitur massa ultricies mollis lacus, volutpat nisi lacinia himenaeos facilisi in aliquet sodales purus integer vitae quisque, libero torquent enim mattis placerat tortor mi dignissim viverra sem.
    - name: echo2
      cmd: echo
      args:
        - 'Hello World'
      description: test script foobar
      display_cmd: false
    - name: activate-local
      cmd: dart pub global activate --source path ./
    - name: activate-global
      cmd: dart pub global activate script_runner
    - name: combined
      cmd: echo 'test' && echo1 && echo2
    - short: echo 'this is a short script'
    - name: error
      cmd: |
        _fn() {
          return 1
        }
        _fn
      description: imitate error

executables:
  scr: script_runner

Expected behavior

Static analysis should pass, I expect score to be full 140.

Actual behavior

image

Analysis Log (on dart.pub)

## Running analysis for "script_runner" version "0.7.0"
STARTED: 2024-02-23T21:38:12.668156Z

### Starting pana
2024-02-23 21:38:26.792494 INFO: Running `/home/worker/dart/preview/bin/dart --version`...
2024-02-23 21:38:26.840739 INFO: Running `/home/worker/flutter/preview/bin/flutter --no-version-check --version --machine`...
2024-02-23 21:38:27.054611 INFO: Downloading package script_runner 0.7.0 from https://pub.dartlang.org/packages/script_runner/versions/0.7.0.tar.gz
2024-02-23 21:38:27.377136 INFO: Running `/home/worker/dart/preview/bin/dart pub get --no-example`...
2024-02-23 21:38:28.714445 INFO: Running `/home/worker/dart/preview/bin/dart pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides`...
2024-02-23 21:38:29.813480 SEVERE: `dart pub outdated` failed.
2024-02-23 21:38:29.813480 SEVERE: Unable to parse output as JSON:
2024-02-23 21:38:29.813480 SEVERE: ```
2024-02-23 21:38:32.466839 INFO: Running `git init`...
2024-02-23 21:38:32.488577 INFO: Running `git remote add origin https://github.com/chenasraf/dart_script_runner`...
2024-02-23 21:38:32.510565 INFO: Running `git remote show origin`...
2024-02-23 21:38:32.751856 INFO: Running `git fetch --depth 1 --no-recurse-submodules origin master`...
2024-02-23 21:38:33.135091 INFO: Running `git ls-tree -r --name-only --full-tree origin/master`...
2024-02-23 21:38:33.157519 INFO: Running `git show origin/master:pubspec.yaml`...
2024-02-23 21:38:38.188735 INFO: Running post-processing
2024-02-23 21:38:38.195200 INFO: Finished post-processing
2024-02-23 21:38:38.195287 INFO: Creating .tar.gz archive
2024-02-23 21:38:38.204192 INFO: Finished .tar.gz archive
2024-02-23 21:38:38.209021 INFO: Writing summary.json
### Execution of pana exited 0
STOPPED: 2024-02-23T21:38:38.293235Z

Same commands locally

dart analyze
Analyzing script_runner...             1.8s
No issues found!
dart pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides
The Dart CLI developer tool uses Google Analytics to report usage and diagnostic
data along with package dependencies, and crash reporting to send basic crash
reports. This data is used to help improve the Dart platform, Flutter framework,
and related tools.

Telemetry is not sent on the very first run. To disable reporting of telemetry,
run this terminal command:

    dart --disable-analytics

If you opt out of telemetry, an opt-out event will be sent, and then no further
information will be sent. This data is collected in accordance with the Google
Privacy Policy (https://policies.google.com/privacy).

{
  "packages": [
    {
      "package": "collection",
      "kind": "transitive",
      "isDiscontinued": false,
      "current": {
        "version": "1.18.0"
      },
      "upgradable": {
        "version": "1.18.0"
      },
      "resolvable": {
        "version": "1.18.0"
      },
      "latest": {
        "version": "1.18.0"
      }
    },
    {
      "package": "file",
      "kind": "direct",
      "isDiscontinued": false,
      "current": {
        "version": "7.0.0"
      },
      "upgradable": {
        "version": "7.0.0"
      },
      "resolvable": {
        "version": "7.0.0"
      },
      "latest": {
        "version": "7.0.0"
      }
    },
    {
      "package": "meta",
      "kind": "transitive",
      "isDiscontinued": false,
      "current": {
        "version": "1.12.0"
      },
      "upgradable": {
        "version": "1.12.0"
      },
      "resolvable": {
        "version": "1.12.0"
      },
      "latest": {
        "version": "1.12.0"
      }
    },
    {
      "package": "path",
      "kind": "direct",
      "isDiscontinued": false,
      "current": {
        "version": "1.9.0"
      },
      "upgradable": {
        "version": "1.9.0"
      },
      "resolvable": {
        "version": "1.9.0"
      },
      "latest": {
        "version": "1.9.0"
      }
    },
    {
      "package": "source_span",
      "kind": "transitive",
      "isDiscontinued": false,
      "current": {
        "version": "1.10.0"
      },
      "upgradable": {
        "version": "1.10.0"
      },
      "resolvable": {
        "version": "1.10.0"
      },
      "latest": {
        "version": "1.10.0"
      }
    },
    {
      "package": "string_scanner",
      "kind": "transitive",
      "isDiscontinued": false,
      "current": {
        "version": "1.2.0"
      },
      "upgradable": {
        "version": "1.2.0"
      },
      "resolvable": {
        "version": "1.2.0"
      },
      "latest": {
        "version": "1.2.0"
      }
    },
    {
      "package": "term_glyph",
      "kind": "transitive",
      "isDiscontinued": false,
      "current": {
        "version": "1.2.1"
      },
      "upgradable": {
        "version": "1.2.1"
      },
      "resolvable": {
        "version": "1.2.1"
      },
      "latest": {
        "version": "1.2.1"
      }
    },
    {
      "package": "unaconfig",
      "kind": "direct",
      "isDiscontinued": false,
      "current": {
        "version": "0.3.1"
      },
      "upgradable": {
        "version": "0.3.1"
      },
      "resolvable": {
        "version": "0.3.1"
      },
      "latest": {
        "version": "0.3.1"
      }
    },
    {
      "package": "yaml",
      "kind": "transitive",
      "isDiscontinued": false,
      "current": {
        "version": "3.1.2"
      },
      "upgradable": {
        "version": "3.1.2"
      },
      "resolvable": {
        "version": "3.1.2"
      },
      "latest": {
        "version": "3.1.2"
      }
    }
  ]
}
dart doc
Documenting script_runner...
Discovering libraries...
[--------------------------------------------------------------------------------------------------------------------------------------------------] (100.00%)

Linking elements...
[--------------------------------------------------------------------------------------------------------------------------------------------------] (100.00%)

Precaching local docs for 153223 elements...
[--------------------------------------------------------------------------------------------------------------------------------------------------] (100.00%)

Initialized dartdoc with 181 libraries
Generating docs for library script_runner.dart from package:script_runner/script_runner.dart...
Found 0 warnings and 0 errors.
Documented 1 public library in 38.5 seconds
Success! Docs generated into /Users/chen/Dev/script_runner/doc/api
@sigurdm sigurdm transferred this issue from dart-lang/pub Feb 29, 2024
@isoos
Copy link
Collaborator

isoos commented Feb 29, 2024

This was one of the bugs in SDK selection from last week. It has been fixed in the code, and also the latest deployment produced a clear package analysis.

@isoos isoos closed this as completed Feb 29, 2024
@chenasraf
Copy link
Author

Awesome, thank you 🙏🏼 sorry for misplacing the issue

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

No branches or pull requests

3 participants