Skip to content

Conversation

@tomerd
Copy link
Contributor

@tomerd tomerd commented May 14, 2022

motivation: long running host processes (ie IDEs) need this in case other SwiftPM processes (ie CLI) made changes to the state

changes:

  • call reload state before reloading the graph
  • add test
motivation: long running host processes (ie IDEs) need this in case other SwiftPM processes (ie CLI) made changes to the state changes: * call reload state before reloading the graph * add test
@tomerd tomerd changed the title reload workspace state before reloading package graph [alternative 2] reload workspace state before reloading package graph May 14, 2022
@tomerd
Copy link
Contributor Author

tomerd commented May 14, 2022

@ahoppen this is a second alternative to #4333

it is more minimal and less risky, and I suspect it solves the issue just as well. could you give it a try?

@ahoppen
Copy link
Member

ahoppen commented May 16, 2022

Just tried it and it also resolves the issue 👍 I’m fine with either this alternative or the other.

@tomerd
Copy link
Contributor Author

tomerd commented May 16, 2022

@swift-ci smoke test

@tomerd tomerd merged commit a3b5774 into swiftlang:main May 16, 2022
Copy link
Contributor

@abertelrud abertelrud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, not only given how IDEs currently interact with libSwiftPM (watching file system themselves and reloading the package graph) but also to make sure state is loaded on first load.

tomerd added a commit to tomerd/swift-package-manager that referenced this pull request May 16, 2022
motivation: long running host processes (ie IDEs) need this in case other SwiftPM processes (ie CLI) made changes to the state changes: * call reload state before reloading the graph * add test
return self.storage.fileExists()
}

/// Returns true if the state file exists on the filesystem.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you missed updating the doc comment.

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

Labels

None yet

5 participants