fast-nail-55400
02/23/2022, 6:48 PMsubject for the engine execution request. I am getting this error:
ValueError: Encountered 4 rule graph errors:
No installed rules return the type BSPContext, and it was not provided by potential callers of @rule(pants.backend.scala.bsp.rules:67:bsp_resolve_all_scala_build_targets(ScalaBSPBuildTargetsRequest, AllScalaTargets, BSPContext) -> BSPBuildTargets, gets=[Get(BuildTarget, ResolveScalaBSPBuildTargetRequest)]).
And adding QueryRule(BSPContext, ()) did not help (same error). Thoughts?fast-nail-55400
02/23/2022, 7:41 PMwitty-crayon-22786
02/23/2022, 7:51 PMwitty-crayon-22786
02/23/2022, 7:51 PMscheduler.request(A, [Params(B, C)]) is QueryRule(A, [B, C])fast-nail-55400
02/23/2022, 7:52 PMQueryRule registered for BSP handler mappings?witty-crayon-22786
02/23/2022, 7:52 PMQueryRule(BSPContext, ()) is “BSPContext must be a singleton which can be computed with no arguments”witty-crayon-22786
02/23/2022, 7:52 PMwitty-crayon-22786
02/23/2022, 7:52 PMwitty-crayon-22786
02/23/2022, 7:52 PMwitty-crayon-22786
02/23/2022, 7:52 PMwitty-crayon-22786
02/23/2022, 7:53 PMParams at the top… could do the same for handlersfast-nail-55400
02/23/2022, 7:54 PMgoal_params_types is there thenwitty-crayon-22786
02/23/2022, 7:54 PMwitty-crayon-22786
02/23/2022, 7:54 PMwitty-crayon-22786
02/23/2022, 7:55 PMwitty-crayon-22786
02/23/2022, 7:55 PMfast-nail-55400
02/23/2022, 7:58 PMwitty-crayon-22786
02/23/2022, 7:59 PMscheduler.request(A, [Params(B, C)])witty-crayon-22786
02/23/2022, 7:59 PMfast-nail-55400
02/23/2022, 8:00 PMwitty-crayon-22786
02/23/2022, 8:00 PMwitty-crayon-22786
02/23/2022, 8:01 PMfast-nail-55400
02/23/2022, 8:02 PMexecution_request = self._scheduler_session.execution_request(
products=[method_mapping.response_type], subjects=[Params(request, self._client_context)]
)fast-nail-55400
02/23/2022, 8:02 PMpants.engine.internals.selectors.Paramswitty-crayon-22786
02/23/2022, 8:02 PMfast-nail-55400
02/23/2022, 8:03 PMNo installed rules return the type BSPContext, and it was not provided by potential callers of @rule(pants.backend.scala.bsp.rules:67:bsp_resolve_all_scala_build_targets(ScalaBSPBuildTargetsRequest, AllScalaTargets, BSPContext) -> BSPBuildTargets, gets=[Get(BuildTarget, ResolveScalaBSPBuildTargetRequest)]).
If that type should be computed by a rule, ensure that that rule is installed.
If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
No installed rules return the type ScalaBSPBuildTargetsRequest, and it was not provided by potential callers of @rule(pants.backend.scala.bsp.rules:67:bsp_resolve_all_scala_build_targets(ScalaBSPBuildTargetsRequest, AllScalaTargets, BSPContext) -> BSPBuildTargets, gets=[Get(BuildTarget, ResolveScalaBSPBuildTargetRequest)]).
If that type should be computed by a rule, ensure that that rule is installed.
If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
No source of dependency AllScalaTargets for @rule(pants.backend.scala.bsp.rules:67:bsp_resolve_all_scala_build_targets(ScalaBSPBuildTargetsRequest, AllScalaTargets, BSPContext) -> BSPBuildTargets, gets=[Get(BuildTarget, ResolveScalaBSPBuildTargetRequest)]). All potential sources were eliminated: []
No source of dependency Get(BuildTarget, ResolveScalaBSPBuildTargetRequest) for @rule(pants.backend.scala.bsp.rules:67:bsp_resolve_all_scala_build_targets(ScalaBSPBuildTargetsRequest, AllScalaTargets, BSPContext) -> BSPBuildTargets, gets=[Get(BuildTarget, ResolveScalaBSPBuildTargetRequest)]). All potential sources were eliminated: []witty-crayon-22786
02/23/2022, 8:03 PMwitty-crayon-22786
02/23/2022, 8:05 PMwitty-crayon-22786
02/23/2022, 8:05 PMfast-nail-55400
02/23/2022, 8:05 PMBSPContext as a parameter to the rule where it was added in the PR linked abovewitty-crayon-22786
02/23/2022, 8:05 PMfast-nail-55400
02/23/2022, 8:05 PM./pants fmt on this PRfast-nail-55400
02/23/2022, 8:06 PMfast-nail-55400
02/23/2022, 8:06 PMwitty-crayon-22786
02/23/2022, 8:07 PM@rules actually consuming the BSPContext yet, right?witty-crayon-22786
02/23/2022, 8:08 PMwitty-crayon-22786
02/23/2022, 8:08 PMBSPContext in bsp_resolve_all_scala_build_targets then things work, yea?fast-nail-55400
02/23/2022, 8:09 PMwitty-crayon-22786
02/23/2022, 8:09 PM@rules to use less than the full query. so would start by getting things green with the new QueryRule and callsite before editing anything to consume it.witty-crayon-22786
02/23/2022, 8:10 PMQueryRule installed in a backend somewhere without the new param?fast-nail-55400
02/23/2022, 8:11 PMfast-nail-55400
02/23/2022, 8:11 PM*(
QueryRule(impl.response_type, (impl.request_type, BSPContext))
for impl in union_membership.get(BSPHandlerMapping)
),witty-crayon-22786
02/23/2022, 8:12 PMwitty-crayon-22786
02/23/2022, 8:17 PMGet , we limit what can be consumed by the Get to exactly the specified type and nothing else.witty-crayon-22786
02/23/2022, 8:18 PMUnionRule(BSPBuildTargetsRequest, ScalaBSPBuildTargetsRequest), is gaining a dependency on the BSPContext, which will not be provided by that Get … and because of https://github.com/pantsbuild/pants/issues/12934 we have no way to declare additional parameters which should be provided to the implementationfast-nail-55400
02/23/2022, 8:23 PMBSPContext to be a session value?fast-nail-55400
02/23/2022, 8:24 PMwitty-crayon-22786
02/23/2022, 8:25 PMScalaBSPBuildTargetsRequest to have a BSPContext fieldfast-nail-55400
02/23/2022, 8:26 PMfast-nail-55400
02/23/2022, 8:27 PM.new_session and provide the session values like UnionMembership as wellwitty-crayon-22786
02/23/2022, 8:27 PMwitty-crayon-22786
02/23/2022, 8:27 PMwitty-crayon-22786
02/23/2022, 8:28 PMcan session values be replaced in an existing scheduler?if not, a method for that would be fine
fast-nail-55400
02/23/2022, 8:28 PMsession_values=SessionValues(
{
OptionsBootstrapper: options_bootstrapper,
CompleteEnvironment: env,
}
),witty-crayon-22786
02/23/2022, 8:31 PMwitty-crayon-22786
02/23/2022, 8:31 PMwitty-crayon-22786
02/23/2022, 8:33 PM@rule like: https://github.com/pantsbuild/pants/blob/75c6ab0435b584120abbe82d06778ea9f97e679a/src/python/pants/engine/environment.py#L100-L102fast-nail-55400
02/23/2022, 8:34 PMfast-nail-55400
02/23/2022, 8:35 PMBSPContext mutable (to allow updating it when the client connects and then remains immutable), will that play nicely with the engine?fast-nail-55400
02/23/2022, 8:36 PMwitty-crayon-22786
02/23/2022, 8:37 PMfast-nail-55400
02/23/2022, 8:38 PMwitty-crayon-22786
02/23/2022, 8:38 PMfast-nail-55400
02/23/2022, 8:38 PMwitty-crayon-22786
02/23/2022, 8:38 PMfast-nail-55400
02/23/2022, 8:39 PMfast-nail-55400
02/23/2022, 8:39 PMfast-nail-55400
02/23/2022, 8:41 PMwitty-crayon-22786
02/23/2022, 8:44 PMwitty-crayon-22786
02/23/2022, 8:50 PM