Skip to content

Removing a dependency from the Package.swift does not remove it from workspace-state.json #5727

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

Open
adam-fowler opened this issue Aug 15, 2022 · 0 comments
Labels

Comments

@adam-fowler
Copy link

Description

workspace-state.json does not provide an up to date list of the dependencies a package requires.

Expected behavior

If I delete a package dependency from Package.swift and then run swift package resolve it will remove that package from workspace-state.json.

Actual behavior

Instead the package remains in the workspace-state.json.

Steps to reproduce

  1. Create package swift package init
  2. Add dependency to dependencies array in Package.swift
  3. Resolve package swift package resolve
  4. Remove dependency from dependencies array in Package.swift
  5. Resolve package swift package resolve
  6. Look at contents of .build/workspace-state.json

Swift Package Manager version/commit hash

Swift 5.6.1

Swift & OS version (output of swift --version && uname -a)

swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: arm64-apple-macosx12.0
Darwin Adams-MBP-M1-Max.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64

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

No branches or pull requests

1 participant