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

[windows][macOS][git] Calling flutter pub get fails on CI with multiple projects with same dependency #103981

Closed
Gustl22 opened this issue May 17, 2022 · 9 comments
Labels
P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@Gustl22
Copy link
Contributor

Gustl22 commented May 17, 2022

See: invertase/melos#289
See: dart-lang/pub#3404

Steps to Reproduce

  1. Execute flutter pub cache clean on each of at least two projects with the same (git) dependency, for example this one.
  2. Execute flutter pub get --verbose at around the same time in both projects (e.g. via two terminals)

Expected results:

Not to fail the second command

Actual results:

One command fails with exit code (66; errno = 183)

Firtst terminal:

 flutter pub get
Waiting for another flutter command to release the startup lock...
Running "flutter pub get" in flutter_platform_test_second...       115.6s

Second terminal:

 flutter pub get
Running "flutter pub get" in flutter_tools...                      25.0s
Rename failed, path = 'C:\src\flutter\.pub-cache\_temp\dirb894bfc2' (OS Error: Cannot create a file when that file already exists.
, errno = 183)
Running "flutter pub get" in flutter_platform_test...                   
pub get failed (66; , errno = 183))
Logs

complete log file here: pub_log.txt

Information about the latest pub run.

If you believe something is not working right, you can go to 
https://github.com/dart-lang/pub/issues/new to post a new issue and attach this file.

Before making this file public, make sure to remove any sensitive information!

Pub version: 2.17.0
Created: 2022-05-17T14:48:18.014433
FLUTTER_ROOT: C:\src\flutter
PUB_HOSTED_URL: <not set>
PUB_CACHE: "C:\src\flutter\.pub-cache"
Command: dart pub --no-precompile
Platform: windows

---- D:\Coding\git\gustl22\flutter_platform_test\packages\flutter_platform_test_second\pubspec.yaml ----
name: flutter_platform_test_second
description: A new Flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.14.0 <3.0.0"
  flutter: ">=2.5.0"

dependencies:
  cupertino_icons: ^1.0.2
  flutter:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  dartdoc:
    git: 'https://github.com/dart-lang/dartdoc.git'

flutter:
  uses-material-design: true

---- End pubspec.yaml ----
---- D:\Coding\git\gustl22\flutter_platform_test\packages\flutter_platform_test_second\pubspec.lock ----
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
  _fe_analyzer_shared:
    dependency: transitive
    description:
      name: _fe_analyzer_shared
      url: "https://pub.dartlang.org"
    source: hosted
    version: "38.0.0"
  analyzer:
    dependency: transitive
    description:
      name: analyzer
      url: "https://pub.dartlang.org"
    source: hosted
    version: "3.4.1"
  args:
    dependency: transitive
    description:
      name: args
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.3.1"
  async:
    dependency: transitive
    description:
      name: async
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.8.2"
  boolean_selector:
    dependency: transitive
    description:
      name: boolean_selector
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.0"
  characters:
    dependency: transitive
    description:
      name: characters
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"
  charcode:
    dependency: transitive
    description:
      name: charcode
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.3.1"
  cli_util:
    dependency: transitive
    description:
      name: cli_util
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.3.5"
  clock:
    dependency: transitive
    description:
      name: clock
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.0"
  collection:
    dependency: transitive
    description:
      name: collection
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.16.0"
  convert:
    dependency: transitive
    description:
      name: convert
      url: "https://pub.dartlang.org"
    source: hosted
    version: "3.0.1"
  crypto:
    dependency: transitive
    description:
      name: crypto
      url: "https://pub.dartlang.org"
    source: hosted
    version: "3.0.2"
  csslib:
    dependency: transitive
    description:
      name: csslib
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.17.1"
  cupertino_icons:
    dependency: "direct main"
    description:
      name: cupertino_icons
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.0.4"
  dartdoc:
    dependency: "direct dev"
    description:
      path: "."
      ref: HEAD
      resolved-ref: aca373a2d9c64ddb55c54d5c2241e2175effa582
      url: "https://github.com/dart-lang/dartdoc.git"
    s[...]: sdk
    version: "0.0.99"
  source_span:
    dependency: transitive
    description:
      name: source_span
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.8.2"
  stack_trace:
    dependency: transitive
    description:
      name: stack_trace
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.10.0"
  stream_channel:
    dependency: transitive
    description:
      name: stream_channel
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.0"
  string_scanner:
    dependency: transitive
    description:
      name: string_scanner
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.0"
  term_glyph:
    dependency: transitive
    description:
      name: term_glyph
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"
  test_api:
    dependency: transitive
    description:
      name: test_api
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.4.9"
  typed_data:
    dependency: transitive
    description:
      name: typed_data
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.3.1"
  vector_math:
    dependency: transitive
    description:
      name: vector_math
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.2"
  watcher:
    dependency: transitive
    description:
      name: watcher
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.0.1"
  yaml:
    dependency: transitive
    description:
      name: yaml
      url: "https://pub.dartlang.org"
    source: hosted
    version: "3.1.1"
sdks:
  dart: ">=2.17.0-206.0.dev <3.0.0"
  flutter: ">=2.5.0"

---- End pubspec.lock ----
---- Log transcript ----
FINE: Pub 2.17.0
MSG : Resolving dependencies...
SLVR: fact: flutter_platform_test_second is 1.0.0+1
SLVR: derived: flutter_platform_test_second
SLVR: fact: flutter_platform_test_second depends on cupertino_icons ^1.0.2
SLVR: fact: flutter_platform_test_second depends on flutter from sdk
SLVR: fact: flutter_platform_test_second depends on flutter_test from sdk
SLVR: fact: flutter_platform_test_second depends on flutter_lints ^2.0.0
SLVR: fact: flutter_platform_test_second depends on dartdoc from git
SLVR:   selecting flutter_platform_test_second
SLVR:   derived: dartdoc from git
SLVR:   derived: flutter_lints ^2.0.0
SLVR:   derived: flutter_test from sdk
SLVR:   derived: flutter from sdk
SLVR:   derived: cupertino_icons ^1.0.2
IO  : Spawning "cmd /c git --version" in D:\Coding\git\gustl22\flutter_platform_test\packages\flutter_platform_test_second\.
IO  : Finished git. Exit code 0.
    | stdout:
    | | git version 2.34.1.windows.1
    | Nothing output on stderr.
FINE: Determined git command git.
IO  : Spawning "cmd /c git rev-parse --is-inside-git-dir" in C:\src\flutter\.pub-cache\git\cache\dartdoc-41bada436b1841a3d1e0eaff0c4683b7ef2d74e4
IO  : Finished git. Exit code 0.
    | stdout:
    | | true
    | Nothing output on stderr.
IO  : Spawning "cmd /c git rev-list --max-count=1 aca373a2d9c64ddb55c54d5c2241e2175effa582" in C:\src\flutter\.pub-cache\git\cache\dartdoc-41bada436b1841a3d1e0eaff0c4683b7ef2d74e4
IO  : Finished git. Exit code 128.
    | Nothing output on stdout.
    | stderr:
    | | fatal: bad object aca373a2d9c64ddb55c54d5c2241e2175effa582
IO  : Spawning "cmd /c git fetch" in C:\src\flutter\.pub-cache\git\cache\dartdoc-41bada436b1841a3d1e0eaff0c4683b7ef2d74e4
IO  : Finished git. Exit code 0.
    | Nothing output on stdout.
    | stderr:
    | | From https://github.com/dart-lang/dartdoc
    | |  * branch              HEAD       -> FETCH_HEAD
IO  : Spawning "cmd /c git show aca373a2d9c64ddb55c54d5c2241e2175effa582:pubspec.yaml" in C:\src\flutter\.pub-cache\git\cache\dartdoc-41bada436b1841a3d1e0eaff0c4683b7ef2d74e4
IO  : Finished git. Exit code 0.
    | stdout:
    | | name: dartdoc
    | | # Run `dart run grinder build` after updating.
    | | version: 5.1.0
    | | description: A non-interactive HTML documentation generator for Dart source code.
    | | repository: https://github.com/dart-lang/dartdoc
    | | 
    | | environment:
    | |   sdk: '>=2.14.0 <3.0.0'
    | | 
    | | dependencies:
    | |   analyzer: ^3.4.0
    | |   args: ^2.3.0
    | |   charcode: ^1.3.1
    | |   cli_util: ^0.3.5
    | |   collection: ^1.15.0
    | |   crypto: ^3.0.1
    | |   glob: ^2.0.1
    | |   html: ^0.15.0
    | |   logging: ^1.0.2
    | |   markdown: ">=4.0.0 <6.0.0"
    | |   meta: ^1.7.0
    | |   package_config: ^2.0.2
    | |   path: ^1.8.0
    | |   pub_semver: ^2.1.0
    | |   source_span: ^1.8.1
    | |   yaml: ^3.1.0
    | | 
    | | dev_dependencies:
    | |   async: ^2.8.2
    | |   build: ^2.1.0
    | |   build_runner: ^2.1.2
    | |   build_test: ^2.1.3
    | |   build_version: ^2.1.0
    | |   code_builder: ^4.1.0
    | |   coverage: ^1.0.3
    | |   dart_style: ^2.2.0
    | |   grinder: ^0.9.0
    | |   http: ^0.13.3
    | |   lints: ^1.0.1
    | |   test: ^1.19.0
    | |   test_descriptor: ^2.0.0
    | |   test_process: ^2.0.2
    | | 
    | | executables:
    | |   dartdoc: null
    | Nothing output on stderr.
SLVR:   fact: dartdoc 5.1.0 from git depends on analyzer ^3.4.0
SLVR:   fact: dartdoc 5.1.0 from git depends on args ^2.3.0
SLVR:   fact: dartdoc 5.1.0 from git depends on charcode ^1.3.1
SLVR:   fact: dartdoc 5.1.0 from git depends on cli_util ^0.3.5
SLVR:   fact: dartdoc 5.1.0 from git depends on collection ^1.15.0
SLVR:   fact: dartdoc 5.1.0 from git depends on crypto ^3.0.1
SLVR:   fact: dartdoc 5.1.0 from git depends on glob ^2.0.1
SLVR:   fact: dartdoc 5.1.0 from git depends on html ^0.15.0
SLVR:   fact: dartdoc 5.1.0 from git depends on logging ^1.0.2
SLVR:   fact: dartdoc 5.1.0 from git depends on markdown >=4.0.0 <6.0.0
SLVR:   fact: dartdoc 5.1.0 from git depends on meta ^1.7.0
SLVR:   fact: dartdoc 5.1.0 from git depends on package_config ^2.0.2
SLVR:   fact: dartdoc 5.1.0 from git depends on path ^1.8.0
SLVR:   fact: dartdoc 5.1.0 from git depends on pub_semver ^2.1.0
SLVR:   fact: dartdoc 5.1.0 from git depends on source_span ^1.8.1
SLVR:   fact: dartdoc 5.1.0 from git depends on yaml ^3.1.0
SLVR:     selecting dartdoc 5.1.0 from git
SLVR:     derived: yaml ^3.1.0
SLVR:     derived: source_span ^1.8.1
SLVR:     derived: pub_semver ^2.1.0
SLVR:     derived: path ^1.8.0
SLVR:     derived: package_config ^2.0.2
SLVR:     derived: meta ^1.7.0
SLVR:     derived: markdown >=4.0.0 <6.0.0
SLVR:     derived: logging ^1.0.2
SLVR:     derived: html ^0.15.0
SLVR:     derived: glob ^2.0.1
SLVR:     derived: crypto ^3.0.1
SLVR:     derived: collection ^1.15.0
SLVR:     derived: cli_util ^0.3.5
SLVR:     derived: charcode ^1.3.1
SLVR:     derived: args ^2.3.0
SLVR:     derived: analyzer ^3.4.0
IO  : Get versions from https://pub.dartlang.org/api/packages/flutter_lints.
IO  : HTTP GET https://pub.dartlang.org/api/packages/flutter_lints
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: windows
    | X-Pub-Command: get
    | X-Pub-Session-ID: A7759D1F-1BF0-43A9-9198-3FC56B0D6174
    | X-Pub-Environment: flutter_cli:get
    | X-Pub-Reason: dev
    | user-agent: Dart pub 2.17.0
IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/flutter_lints
    | took 0:00:00.900314
    | transfer-encoding: chunked
    | date: Tue, 17 May 2022 12:47:23 GMT
    | content-encoding: gzip
    | strict-transport-security: max-age=31536000; preload
    | via: 1.1 google
    | content-type: application/json; charset="utf-8"
    | x-frame-options: SAMEORIGIN
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
IO  : Writing 5170 characters to text file C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\.cache\flutter_lints-versions.json.
FINE: Contents:
    | {"name":"flutter_lints","latest":{"version":"2.0.1","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","repository":"https://github.com/flutter/packages/tree/main/packages/flutter_lints","issue_tracker":"https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_lints%22","version":"2.0.1","environment":{"sdk":">=2.17.0-0 <3.0.0"},"dependencies":{"lints":"^2.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/2.0.1.tar.gz","published":"2022-04-20T00:02:11.294475Z"},"versions":[{"version":"0.0.0","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins.","version":"0.0.0","homepage":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","environment":{"sdk":">=2.12.0 <3.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/0.0.0.tar.gz","published":"2021-05-05T19:49:34.839383Z"},{"version":"1.0.0-dev.0","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins.","version":"1.0.0-dev.0","homepage":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","environment":{"sdk":">=2.12.0 <3.0.0"},"dependencies":{"lints":"^1.0.0-dev.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/1.0.0-dev.0.tar.gz","published":"2021-05-05T23:57:43.122279Z"},{"version":"1.0.0","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","version":"1.0.0","homepage":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","environment":{"sdk":">=2.12.0 <3.0.0"},"dependencies":{"lints":"^1.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/1.0.0.tar.gz","published":"2021-05-12T17:22:57.364065Z"},{"version":"1.0.1","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","version":"1.0.1","homepage":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","environment":{"sdk":">=2.12.0 <3.0.0"},"dependencies":{"lints":"^1.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/1.0.1.tar.gz","published":"2021-05-13T19:55:08.677550Z"},{"version":"1.0.2","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","version":"1.0.2","homepage":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","environment":{"sdk":">=2.12.0 <3.0.0"},"dependencies":{"lints":"^1.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/1.0.2.tar.gz","published":"2021-05-18T16:25:27.239072Z"},{"version":"1.0.3","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","version":"1.0.3","homepage":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","environment":{"sdk":">=2.12.0 <3.0.0"},"dependencies":{"lints":"^1.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/1.0.3.tar.gz","published":"2021-06-01T22:04:33.837320Z"},{"version":"1.0.4","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","repository":"https://github.com/flutter/packages/tree/master/packages/flutter_lints","issue_tracker":"https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_lints%22","version":"1.0.4","environment":{"sdk":">=2.12.0 <3.0.0"},"dependencies":{"lints":"^1.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/1.0.4.tar.gz","published":"2021-07-07T18:24:18.658642Z"},{"version":"2.0.0","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","repository":"https://github.com/flutter/packages/tree/main/packages/flutter_lints","issue_tracker":"https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_lints%22","version":"2.0.0","environment":{"sdk":">=2.17.0-0 <3.0.0"},"dependencies":{"lints":"^2.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/2.0.0.tar.gz","published":"2022-03-18T20:02:01.232637Z"},{"version":"2.0.1","pubspec":{"name":"flutter_lints","description":"Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.","repository":"https://github.com/flutter/packages/tree/main/packages/flutter_lints","issue_tracker":"https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_lints%22","version":"2.0.1","environment":{"sdk":">=2.17.0-0 <3.0.0"},"dependencies":{"lints":"^2.0.0"}},"archive_url":"https://pub.dartlang.org/packages/flutter_lints/versions/2.0.1.tar.gz","published":"2022-04-20T00:02:11.294475Z"}],"_fetchedAt":"2022-05-17T14:47:25.232110"}
SLVR:     fact: flutter_lints 2.0.1 depends on lints ^2.0.0
SLVR:       selecting flutter_lints 2.0.1
SLVR:       derived: lints ^2.0.0
IO  : Get versions from https://pub.dartlang.org/api/packages/lints.
IO  : HTTP GET https://pub.dartlang.org/api/packages/lints
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: windows
    | X-Pub-Command: get
    | X-Pub-Session-ID: A7759D1F-1BF0-43A9-9198-3FC56B0D6174
    | X-Pub-Environment: flutter_cli:get
    | user-agent: Dart pub 2.17.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on flutter from sdk
SLVR:       fact: flutter_test 0.0.0 from sdk depends on test_api 0.4.9
SLVR:       fact: flutter_test 0.0.0 from sdk depends on path 1.8.1
SLVR:       fact: flutter_test 0.0.0 from sdk depends on fake_async 1.3.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on clock 1.1.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on stack_trace 1.10.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on vector_math 2.1.2
SLVR:       fact: flutter_test 0.0.0 from sdk depends on async 2.8.2
SLVR:       fact: flutter_test 0.0.0 from sdk depends on boolean_selector 2.1.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on characters 1.2.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on charcode 1.3.1
SLVR:       fact: flutter_test 0.0.0 from sdk depends on collection 1.16.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on matcher 0.12.11
SLVR:       fact: flutter_test 0.0.0 from sdk depends on material_color_utilities 0.1.4
SLVR:       fact: flutter_test 0.0.0 from sdk depends on meta 1.7.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on source_span 1.8.2
SLVR:       fact: flutter_test 0.0.0 from sdk depends on stream_channel 2.1.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on string_scanner 1.1.0
SLVR:       fact: flutter_test 0.0.0 from sdk depends on term_glyph 1.2.0
SLVR:         selecting flutter_test 0.0.0 from sdk
SLVR:         derived: term_glyph 1.2.0
SLVR:         derived: string_scanner 1.1.0
SLVR:         derived: stream_channel 2.1.0
SLVR:         derived: source_span 1.8.2
SLVR:         derived: meta 1.7.0
SLVR:         derived: material_color_utilities 0.1.4
SLVR:         derived: matcher 0.12.11
SLVR:         derived: collection 1.16.0
SLVR:         derived: charcode 1.3.1
SLVR:         derived: characters 1.2.0
SLVR:         derived: boolean_selector 2.1.0
SLVR:         derived: async 2.8.2
SLVR:         derived: vector_math 2.1.2
SLVR:         derived: stack_trace 1.10.0
SLVR:         derived: clock 1.1.0
SLVR:         derived: fake_async 1.3.0
SLVR:         derived: path 1.8.1
SLVR:         derived: test_api 0.4.9
SLVR:         fact: flutter 0.0.0 from sdk depends on characters 1.2.0
SLVR:         fact: flutter 0.0.0 from sdk depends on collection 1.16.0
SLVR:         fact: flutter 0.0.0 from sdk depends on material_color_utilities 0.1.4
SLVR:         fact: flutter 0.0.0 from sdk depends on meta 1.7.0
SLVR:         fact: flutter 0.0.0 from sdk depends on vector_math 2.1.2
SLVR:         fact: flutter 0.0.0 from sdk depends on sky_engine from sdk
SLVR:           selecting flutter 0.0.0 from sdk
SLVR:           derived: sky_engine from sdk
IO  : Get versions from https://pub.dartlang.org/api/packages/cupertino_icons.
IO  : HTTP GET https://pub.dartlang.org/api/packages/cupertino_icons
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: windows
    | X-Pub-Command: get
    | X-Pub-Session-ID: A7759D1F-1BF0-43A9-9198-3FC56B0D6174
    | X-Pub-Environment: flutter_cli:get
    | X-Pub-Reason: direct
    | user-agent: Dart pub 2.17.0

...
...
...

IO  : Renaming directory C:\src\flutter\.pub-cache\_temp\dirf00913ae to C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\analyzer-3.4.1.
IO  : Deleting directory C:\src\flutter\.pub-cache\_temp\dirf00913ae.
IO  : Deleting directory C:\Users\Gustl\AppData\Local\Temp\pub_401a3871.
ERR : Rename failed, path = 'C:\src\flutter\.pub-cache\_temp\dir9f9b4ec8' (OS Error: Cannot create a file when that file already exists.
    | , errno = 183)
FINE: Exception type: FileSystemException
FINE: dart:io                                                          _Directory.renameSync
    | package:pub/src/io.dart 456:21                                   renameDir.<fn>
    | package:pub/src/io.dart 395:16                                   _attempt
    | package:pub/src/io.dart 454:3                                    renameDir
    | package:pub/src/io.dart 466:5                                    tryRenameDir
    | package:pub/src/source/hosted.dart 882:7                         HostedSource._download.<fn>
    | ===== asynchronous gap ===========================
    | dart:async                                                       Future.catchError
    | package:pub/src/utils.dart 109:52                                captureErrors.wrappedCallback
    | package:stack_trace                                              Chain.capture
    | package:pub/src/utils.dart 122:11                                captureErrors
    | package:pub/src/command.dart 183:13                              PubCommand.run
    | package:args/command_runner.dart 209:27                          CommandRunner.runCommand
    | package:pub/src/command_runner.dart 174:24                       PubCommandRunner.runCommand
    | package:pub/src/command_runner.dart 159:20                       PubCommandRunner.run
    | package:dartdev/dartdev.dart 45:56                               runDartdev
    | C:\b\s\w\ir\cache\builder\sdk\pkg\dartdev\bin\dartdev.dart 11:9  main
---- End log transcript ----

 flutter doctor -v
[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.22616.100], locale en-US)
    • Flutter version 3.0.0 at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (8 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\src\android\Sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_SDK_ROOT = C:\src\android\Sdk
    • Java binary at: C:\Program Files\Java\jdk-15.0.2\bin\java
    • Java version OpenJDK Runtime Environment (build 15.0.2+7-27)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2022 17.0.6)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.0.32126.317
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2022.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2021.2
    • Flutter plugin version 67.1.4
    • Dart plugin version 221.5591.58

[√] VS Code (version 1.66.2)
    • VS Code at C:\Users\Gustl\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22616.100]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 101.0.4951.67
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 98.0.1108.43

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

This does not happen with dart command executed simultaneously:

dart pub cache clean
dart pub get --verbose

Also note this bug plays a big role in CI via melos when executing melos boostrap, as then flutter pub get is called on every specified subproject in the repository. Therefore some CI workflows break on e.g. windows flutter drive tests.

@Gustl22 Gustl22 changed the title [windows][git] Calling flutter pub get fails on CI with multiple projects with same dependency [windows][macOS][git] Calling flutter pub get fails on CI with multiple projects with same dependency May 17, 2022
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 18, 2022
@darshankawar
Copy link
Member

Thanks @Gustl22 for the detailed report. Would like to know if this only happens on CI or locally too ?

I tried locally per your steps to replicate by cloning the example you shared and then ran the commands for flutter_platform_test and flutter_platform_test_second in two separate terminals for which I observed below:

  1. Ran flutter pub cache clean:

Screenshot 2022-05-18 at 12 13 33 PM

I did get pub 66 exit code but the error seems to be different than you posted.

  1. Ran flutter pub get:

Screenshot 2022-05-18 at 12 16 58 PM

Running dart pub cache clean pretty much gave me similar results, so wondering if this is specific to running concurrently on CI or effects local run too.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 18, 2022
@Gustl22
Copy link
Contributor Author

Gustl22 commented May 18, 2022

Hey @darshankawar, and thank you for testing.
I only could test locally with Windows (11), which could reproduce the error pretty consistent, (but only had one machine to test). Did not test with macOS though. But of course in CI the error occurs more obviously / reliably and on macOS too.

You DO NOT want to execute flutter pub cache clean SIMULTANEOUSLY (but this may has the same reason to fail). Otherwise the next step may not fail. The reason for this command is to simulate the clean pub cache, when running in a VM / CI / new project.
You DO want to execute flutter pub get --verbose SIMULTANEOUSLY. (Search for ERR : to get the actual reason)

Also be aware of dart-lang/pub#3404. The error message may vary from time to time as the concurrency may fails at a different spot.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 18, 2022
@darshankawar
Copy link
Member

Thanks for the feedback. Although I didn't try to Windows, but performing the same steps based on above input on macOS did run flutter pub get --verbose commands properly simultaneously.

Screenshot 2022-05-18 at 5 11 45 PM

Based on the report and considering the fact that similar issue is open in dart-lang/pub repo, I'll keep this issue open for further insights from the team.

@darshankawar darshankawar added tool Affects the "flutter" command-line tool. See also t: labels. platform-mac Building on or for macOS specifically platform-windows Building on or for Windows specifically and removed in triage Presently being triaged by the triage team labels May 18, 2022
@christopherfujino christopherfujino added the P2 Important issues not at the top of the work list label May 31, 2022
@BautizarCodigo
Copy link

BautizarCodigo commented Jul 27, 2022

Same issue here, it appears in the messages

Produces the error when the Flutter inspector is launched

Package devtools is currently active at version 2.9.4.
Resolving dependencies...

  • args 2.3.1
  • async 2.9.0
  • browser_launcher 1.1.1
  • clock 1.1.1
  • collection 1.16.0
  • convert 3.0.2
  • devtools 2.9.4
  • devtools_server 2.9.4
  • devtools_shared 2.9.4 (2.14.1 available)
  • http 0.13.4
  • http_multi_server 3.2.1
  • http_parser 4.0.1
  • intl 0.17.0
  • logging 1.0.2
  • meta 1.8.0
  • mime 1.0.2
  • path 1.8.2
  • pedantic 1.11.1
  • pool 1.5.1
  • shelf 1.3.1
  • shelf_proxy 1.0.2
  • shelf_static 1.1.1
  • source_span 1.9.1
  • sse 4.1.0
  • stack_trace 1.10.0
  • stream_channel 2.1.0
  • string_scanner 1.1.1
  • term_glyph 1.2.1
  • typed_data 1.3.1
  • usage 4.1.0
  • vm_service 8.3.0 (9.3.0 available)
  • webkit_inspection_protocol 1.1.0
    Building package executables...
    Built devtools:devtools.

Rename failed, path = 'path\flutter.pub-cache_temp\dir1ceea84b' (OS Error: Cannot create a file when that file already exists.
, errno = 183)
pub finished with exit code 66

platform, windows 10.

@flutter-triage-bot flutter-triage-bot bot added team-tool Owned by Flutter Tool team triaged-tool Triaged by Flutter Tool team labels Jul 8, 2023
@christopherfujino christopherfujino self-assigned this Jul 11, 2023
@flutter-triage-bot flutter-triage-bot bot added the Bot is counting down the days until it unassigns the issue label Nov 28, 2023
@flutter-triage-bot
Copy link

This issue is assigned to @christopherfujino but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

@Gustl22
Copy link
Contributor Author

Gustl22 commented Feb 8, 2024

FYI: This may be fixed in dart-lang/pub@7ce2474 (not tested)

@flutter-triage-bot flutter-triage-bot bot removed the triaged-tool Triaged by Flutter Tool team label Feb 9, 2024
@flutter-triage-bot
Copy link

This issue was assigned to @christopherfujino but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

@flutter-triage-bot flutter-triage-bot bot removed the Bot is counting down the days until it unassigns the issue label Feb 9, 2024
@christopherfujino
Copy link
Member

FYI: This may be fixed in dart-lang/pub@7ce2474 (not tested)

Sounds good, optimistically closing this as fixed. Feel free to re-open if you verify it is not fixed on the master channel with dart-lang/pub#4120.

@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Feb 14, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

4 participants