-
Notifications
You must be signed in to change notification settings - Fork 314
Update BSP connection build server config lookup path #1728
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://build-server-protocol.github.io/docs/overview/server-discovery#default-locations-for-bsp-connection-files specifies a number of other search locations that we should also adopt.
Also, I don’t see any mention of the buildServer.json
file so we shouldn’t hardcode that. For the lack of a better idea, I think we should pick the lexicographically first file in one of the search directories that is a valid BSP configuration file.
d9cd7ea
to
ccae1c6
Compare
Let me know about the updated logic. Regarding picking the file, did you mean to say that if we had multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding picking the file, did you mean to say that if we had multiple
.json
files in different valid directories, we should pick the lexicographically first one?
Kind of. I’m saying that if in a single search location there are multiple .json
files, we should pick the lexicographically first one. But we should still always prefer a build server config in the workspace .bsp
folder over one in a system location.
Also, you need to update the logic that actually loads the build server config in createConnectionToBspServer
. Could you also add test cases to make sure that we find BSP server config files in the <workspace folder>/.bsp
location to BuildServerBuildSystemTests
?
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
ccae1c6
to
8e8b9a9
Compare
I am not quite sure about the testing part, which path should be considered as the project workspace root for testing? Also, what do you recommend to invoke |
I would create a sourcekit-lsp/Sources/SKTestSupport/BuildServerTestProject.swift Lines 61 to 86 in 01640ee
.bsp folder inside the workspace root.
|
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
8e8b9a9
to
98d37cf
Compare
5286343
to
b9cfe07
Compare
@ahoppen |
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift
Outdated
Show resolved
Hide resolved
Tests/BuildSystemIntegrationTests/BuildServerBuildSystemTests.swift
Outdated
Show resolved
Hide resolved
b9cfe07
to
f228a41
Compare
Resolves swiftlang#1695 Adopt `<workspace_root>/.bsp` search locations in addition to `<workspace_root>/`.
f228a41
to
7b1f59e
Compare
I have updated your test case to make it pass, made a few more adjustments and pushed the changes to your branch. |
@swift-ci Please test |
@swift-ci Please test Windows |
Thanks @ahoppen! |
Resolves #1695
Adopt
<workspace_root>/.bsp
search locations in addition to<workspace_root>/
.