Skip to content

swift package show-dependencies will modify workspace-state.json every time #5693

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
aelam opened this issue Jul 28, 2022 · 0 comments
Open
Labels

Comments

@aelam
Copy link

aelam commented Jul 28, 2022

Description

swift package show-dependencies will modify workspace-state.json every time but the content could be exactly the same as before.
As far as I understand, it should be a read action that should not trigger any write action.

And if I modified package.resolved then run swift package show-dependencies, package.resolved will be updated twice (one deletion and one creation?) but the content could be exactly the same as before.
if some extension is watching the file event of package.resolved, it would be a dead loop
Could you check if these are issues?

Expected behavior

swift package show-dependencies don't trigger file changes even the content is same

I've read the code, it seems save() action is performed every time even if there is no change. package.resolved is the same case. maybe it's better to avoid these

Actual behavior

swift package show-dependencies update the file everytime even the content is same

Steps to reproduce

No response

Swift Package Manager version/commit hash

Xcode13.4

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 LF02X81220140AM 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