-
Notifications
You must be signed in to change notification settings - Fork 65
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
Resilience of the buildTarget/*
requests
#204
Comments
Your suggestion sounds reasonable. What should |
Probably we don't need it. |
The request of the form buildTarget/* often take a sequence of build targets as parameter. So far if there is an error on a single build target, the entire request fails. This is not the best because the client wants the result of the other build targets anyway: For example: - workspace/buildTargets: if one build target has an invalid Scala version we still want to import the other ones - buildTarget/scalacOptions: if a dependency cannot be resolved we still want to import the build targets that do not depend on it - buildTarget/scalaMainClasses: if buildTarget does not compile we still want the main classes of the other targets ... The change is to respond to BSP requests with the successful build targets and to ignore the failed ones. This is implemented the same in Bloop since before BSP in sbt. In build-server-protocol/build-server-protocol#204, I made a proposal to also add the failed build targets in the response.
This comment has been minimized.
This comment has been minimized.
What would IDEs do with the failures? Would they show a message saying that some build targets could not be resolved? |
I believe on the Metals side we more or less swallow it. In the |
Yes of course. I am just saying that export interface FailedBuildTarget {
target: BuildTargetIdentifier;
message: string;
data?: string | number | boolean | array | object | null;
}
It's up to them. Also I agree with @ckipp01 that it's not a good idea to swallow a failure. In general I think if one of the In Metals, the build target error messages could be displayed in the
|
Ach, I totally misread the first post and missed that you already had it all defined 😆. Sorry! |
The request of the form buildTarget/* often take a sequence of build targets as parameter. So far if there is an error on a single build target, the entire request fails. This is not the best because the client wants the result of the other build targets anyway: For example: - workspace/buildTargets: if one build target has an invalid Scala version we still want to import the other ones - buildTarget/scalacOptions: if a dependency cannot be resolved we still want to import the build targets that do not depend on it - buildTarget/scalaMainClasses: if buildTarget does not compile we still want the main classes of the other targets ... The change is to respond to BSP requests with the successful build targets and to ignore the failed ones. This is implemented the same in Bloop since before BSP in sbt. In build-server-protocol/build-server-protocol#204, I made a proposal to also add the failed build targets in the response.
The request of the form buildTarget/* often take a sequence of build targets as parameter. So far if there is an error on a single build target, the entire request fails. This is not the best because the client wants the result of the other build targets anyway: For example: - workspace/buildTargets: if one build target has an invalid Scala version we still want to import the other ones - buildTarget/scalacOptions: if a dependency cannot be resolved we still want to import the build targets that do not depend on it - buildTarget/scalaMainClasses: if buildTarget does not compile we still want the main classes of the other targets ... The change is to respond to BSP requests with the successful build targets and to ignore the failed ones. This is implemented the same in Bloop since before BSP in sbt. In build-server-protocol/build-server-protocol#204, I made a proposal to also add the failed build targets in the response.
The request of the form buildTarget/* often take a sequence of build targets as parameter. So far if there is an error on a single build target, the entire request fails. This is not the best because the client wants the result of the other build targets anyway: For example: - workspace/buildTargets: if one build target has an invalid Scala version we still want to import the other ones - buildTarget/scalacOptions: if a dependency cannot be resolved we still want to import the build targets that do not depend on it - buildTarget/scalaMainClasses: if buildTarget does not compile we still want the main classes of the other targets ... The change is to respond to BSP requests with the successful build targets and to ignore the failed ones. This is implemented the same in Bloop since before BSP in sbt. In build-server-protocol/build-server-protocol#204, I made a proposal to also add the failed build targets in the response.
This approach makes it necessary to extends each response type with failure information. Wouldn't it be easier to just wrap the specific result type in some generic |
The requests of the form
buildTarget/*
take a sequence of build target identifiers as paramater and expect a sequence of result items as response, each item corresponding to one of the build target identifier.For example, the
buildTarget/source
params areand result is:
But what if the request fails on a single build target:
sbt does 1 which is probably not a good idea because we don't want the entire build import to fail if one build target fails.
Bloop does 2 but that's not fully satisfying either because the build client doesn't really know why some build targets are missing.
So I propose to augment every
buildTarget/*
response with a newfailedTargets
field which must contain the build target failures.Do you think this is the correct approach for this problem?
The text was updated successfully, but these errors were encountered: