Skip to content

Only log build settings once unless they change #932

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

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 26, 2023

This makes the logs a lot less spammy.

This makes the logs a lot less spammy.
@ahoppen
Copy link
Member Author

ahoppen commented Oct 26, 2023

@swift-ci Please test

fileprivate actor BuildSettingsLogger {
static let shared = BuildSettingsLogger()

private var loggedSettings: [DocumentURI: FileBuildSettings] = [:]
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we likely already keep a document -> settings in memory for all the workspaces, but it would be nice to not (potentially) double it. Are you worried about some race if this was removed on close?

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK we don’t keep that mapping around anywhere. We used to but I removed the caches in SwiftLanguageServer and ClangLanguageServer.

SwiftPMWorkspace, for example, gets the build settings from the build graph and doesn’t have any file -> build settings cache.

Copy link
Member Author

Choose a reason for hiding this comment

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

I’m merging this now. If you think this should be implemented otherwise, I can address it in a follow-up PR.

@ahoppen ahoppen merged commit 182deb7 into swiftlang:main Oct 27, 2023
@ahoppen ahoppen deleted the ahoppen/log-build-settings-once branch October 27, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants