Skip to content

"Waiting for another flutter command to release the Swift Package Manager lock..." on SMB share on MacOS #192802

Description

@MarcinWad

Steps to reproduce

  1. Mount in MacOS SMB share with Flutter project for XCode
  2. Run on mounted share 'flutter pub get'
  3. It will stay forever on "Waiting for another flutter command to release the Swift Package Manager lock..."

Expected results

Should get all plugins.

Actual results

Stays forever on lock check.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output

Flutter 3.47.4

Activity

  1. vashworth commented on Sep 15, 2026

    @vashworth
    Contributor
  2. added
    team-toolOwned by Flutter Tool team
    P2Important issues not at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    on Sep 15, 2026
  3. self-assigned this
    on Sep 15, 2026
  4. bkonyi commented on Sep 15, 2026

    @bkonyi
    Contributor

    It looks like file locking isn't supported via SMB, which would explain why we're failing to acquire the lock. #192821 should allow for progress to be made when working with file systems that don't support file locking, but won't prevent any possible collisions due to concurrent writes during Xcode build steps.

  5. MarcinWad commented on Sep 16, 2026

    @MarcinWad
    Author

    Hi, Thanks for fix. I found another problem with lockfile in same situation:

    Command:
    flutter build ios

    Building will fail after 300 seconds with timeout. Error corresponds to lockfile not being freed:

    Could not acquire the lock to /Volumes/APP/.dart_tool/hooks_runner/shared/objective_c/.lock.
    Target build_hooks failed: TimeoutException after 0:05:00.000000: Could not acquire the lock to /Volumes/APP/.dart_tool/hooks_runner/shared/objective_c/.lock.
    Failed to package /Volumes/APP.
    Command PhaseScriptExecution failed with a nonzero exit code
    
    Could not acquire the lock to /Volumes/APP/.dart_tool/hooks_runner/shared/objective_c/.lock.
    
    Target build_hooks failed: TimeoutException after 0:05:00.000000: Could not acquire the lock to /Volumes/APP/.dart_tool/hooks_runner/shared/objective_c/.lock.
    
    Failed to package /Volumes/APP.
    
    Command PhaseScriptExecution failed with a nonzero exit code
    

    Temporary fix: Make symbolic link to .dart_tool directory on MacOS local filesystem (/smb/project/.dart_tool => /tmp/.dart_tool) to bypass this eror.

  6. bkonyi commented on Sep 16, 2026

    @bkonyi
    Contributor

    Hi @MarcinWad,

    Thanks for reporting this!

    While this stems from the same underlying issue (advisory file locking failing on SMB network shares), this failure occurs in a separate component. The lock here is managed by package:hooks_runner (used during build_hooks for native assets like package:objective_c) rather than the Flutter tool's Swift Package Manager integration fixed in #192821.

    I have filed an upstream issue in dart-lang/native to track and resolve this: dart-lang/native#3651. Once the fix lands upstream in hooks_runner, we will roll the updated package into Flutter.

    In the meantime, symlinking .dart_tool to a local APFS/HFS+ volume is an effective temporary solution, as local macOS filesystems support advisory file locking.

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions