fast-nail-55400
02/07/2022, 8:35 PMSchedulerSession.execute
. I am getting this error:
E ValueError: Encountered 2 rule graph errors:
E No installed rules return the type UnionMembership, and it was not provided by potential callers of @rule(pants.bsp.rules:54:bsp_workspace_build_targets(WorkspaceBuildTargetsParams, UnionMembership) -> WorkspaceBuildTargetsResult).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E No installed rules return the type WorkspaceBuildTargetsParams, and it was not provided by potential callers of @rule(pants.bsp.rules:54:bsp_workspace_build_targets(WorkspaceBuildTargetsParams, UnionMembership) -> WorkspaceBuildTargetsResult).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
does the call to execute
need to provide a UnionMembership
as an additional “subject” parameter?fast-nail-55400
02/07/2022, 8:36 PMQueryRule
?curved-television-6568
02/07/2022, 8:40 PMwitty-crayon-22786
02/07/2022, 8:42 PMQueryRule
the declares that the UnionMembership
comes inwitty-crayon-22786
02/07/2022, 8:42 PMUnionMembership
.witty-crayon-22786
02/07/2022, 8:43 PMQueryRule
is: “expect calls to scheduler.execute
with these input types for this output type”witty-crayon-22786
02/07/2022, 8:45 PMwitty-crayon-22786
02/07/2022, 8:45 PM@goal_rule
installs a query that takes https://github.com/pantsbuild/pants/blob/b3b7e3ed1cd40df158fbbd86de64f4dac29481ef/src/python/pants/init/engine_initializer.py#L82-L83 as the argumentswitty-crayon-22786
02/07/2022, 8:45 PMfast-nail-55400
02/07/2022, 8:46 PMfast-nail-55400
02/07/2022, 8:47 PMUnionMembership
first, I still get rule graph error:
E ValueError: Encountered 3 rule graph errors:
E No installed rules return the type UnionMembership, and it was not provided by potential callers of @rule(pants.bsp.rules:54:bsp_workspace_build_targets(WorkspaceBuildTargetsParams, UnionMembership) -> WorkspaceBuildTargetsResult).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E No installed rules return the type UnionMembership, and it was not provided by potential callers of Query(UnionMembership for ()).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E No installed rules return the type WorkspaceBuildTargetsParams, and it was not provided by potential callers of @rule(pants.bsp.rules:54:bsp_workspace_build_targets(WorkspaceBuildTargetsParams, UnionMembership) -> WorkspaceBuildTargetsResult).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
witty-crayon-22786
02/07/2022, 8:47 PMfast-nail-55400
02/07/2022, 8:47 PMSchedulerSession
allocated via new_session
.fast-nail-55400
02/07/2022, 8:48 PMwitty-crayon-22786
02/07/2022, 8:49 PMwitty-crayon-22786
02/07/2022, 8:50 PMwitty-crayon-22786
02/07/2022, 8:51 PMValueError
fast-nail-55400
02/07/2022, 8:57 PMdef test_errors_for_uninitialized_connection(self, tmp_path: Path) -> None:
with setup_pipes() as pipes:
# TODO: This code should be moved to a context manager. For now, only the pipes are managed
# with a context manager.
> scheduler = self.mk_scheduler(tmp_path, [*bsp_rules()])
src/python/pants/bsp/protocol_test.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/python/pants/engine/internals/scheduler_test_base.py:48: in mk_scheduler
include_trace_on_error=include_trace_on_error,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pants.engine.internals.scheduler.Scheduler object at 0x1101ca390>
def __init__(
self,
*,
ignore_patterns: list[str],
use_gitignore: bool,
build_root: str,
local_execution_root_dir: str,
named_caches_dir: str,
ca_certs_path: str | None,
rules: Iterable[Rule],
union_membership: UnionMembership,
execution_options: ExecutionOptions,
local_store_options: LocalStoreOptions,
executor: PyExecutor,
include_trace_on_error: bool = True,
visualize_to_dir: str | None = None,
validate_reachability: bool = True,
watch_filesystem: bool = True,
) -> None:
"""
:param ignore_patterns: A list of gitignore-style file patterns for pants to ignore.
:param use_gitignore: If set, pay attention to .gitignore files.
:param build_root: The build root as a string.
:param local_execution_root_dir: The directory to use for local execution sandboxes.
:param named_caches_dir: The directory to use as the root for named mutable caches.
:param ca_certs_path: Path to pem file for custom CA, if needed.
:param rules: A set of Rules which is used to compute values in the graph.
:param union_membership: All the registered and normalized union rules.
:param execution_options: Execution options for (remote) processes.
:param local_store_options: Options for the engine's LMDB store(s).
:param include_trace_on_error: Include the trace through the graph upon encountering errors.
:param validate_reachability: True to assert that all rules in an otherwise successfully
constructed rule graph are reachable: if a graph cannot be successfully constructed, it
is always a fatal error.
:param watch_filesystem: False if filesystem watching should be disabled.
"""
self.include_trace_on_error = include_trace_on_error
self._visualize_to_dir = visualize_to_dir
self._visualize_run_count = 0
# Validate and register all provided and intrinsic tasks.
rule_index = RuleIndex.create(rules)
tasks = register_rules(rule_index, union_membership)
# Create the native Scheduler and Session.
types = PyTypes(
paths=Paths,
file_content=FileContent,
file_entry=FileEntry,
directory=Directory,
digest_contents=DigestContents,
digest_entries=DigestEntries,
path_globs=PathGlobs,
create_digest=CreateDigest,
digest_subset=DigestSubset,
download_file=DownloadFile,
platform=Platform,
process=Process,
process_result=FallibleProcessResult,
process_result_metadata=ProcessResultMetadata,
coroutine=CoroutineType,
session_values=SessionValues,
run_id=RunId,
interactive_process=InteractiveProcess,
interactive_process_result=InteractiveProcessResult,
engine_aware_parameter=EngineAwareParameter,
)
remoting_options = PyRemotingOptions(
execution_enable=execution_options.remote_execution,
store_address=execution_options.remote_store_address,
execution_address=execution_options.remote_execution_address,
execution_process_cache_namespace=execution_options.process_execution_cache_namespace,
instance_name=execution_options.remote_instance_name,
root_ca_certs_path=execution_options.remote_ca_certs_path,
store_headers=execution_options.remote_store_headers,
store_chunk_bytes=execution_options.remote_store_chunk_bytes,
store_chunk_upload_timeout=execution_options.remote_store_chunk_upload_timeout_seconds,
store_rpc_retries=execution_options.remote_store_rpc_retries,
store_rpc_concurrency=execution_options.remote_store_rpc_concurrency,
store_batch_api_size_limit=execution_options.remote_store_batch_api_size_limit,
cache_warnings_behavior=execution_options.remote_cache_warnings.value,
cache_eager_fetch=execution_options.remote_cache_eager_fetch,
cache_rpc_concurrency=execution_options.remote_cache_rpc_concurrency,
cache_read_timeout_millis=execution_options.remote_cache_read_timeout_millis,
execution_extra_platform_properties=tuple(
tuple(pair.split("=", 1))
for pair in execution_options.remote_execution_extra_platform_properties
),
execution_headers=execution_options.remote_execution_headers,
execution_overall_deadline_secs=execution_options.remote_execution_overall_deadline_secs,
execution_rpc_concurrency=execution_options.remote_execution_rpc_concurrency,
)
py_local_store_options = PyLocalStoreOptions(
store_dir=local_store_options.store_dir,
process_cache_max_size_bytes=local_store_options.processes_max_size_bytes,
files_max_size_bytes=local_store_options.files_max_size_bytes,
directories_max_size_bytes=local_store_options.directories_max_size_bytes,
lease_time_millis=LOCAL_STORE_LEASE_TIME_SECS * 1000,
shard_count=local_store_options.shard_count,
)
exec_stategy_opts = PyExecutionStrategyOptions(
local_cache=execution_options.local_cache,
remote_cache_read=execution_options.remote_cache_read,
remote_cache_write=execution_options.remote_cache_write,
local_cleanup=execution_options.process_cleanup,
local_parallelism=execution_options.process_execution_local_parallelism,
local_enable_nailgun=execution_options.process_execution_local_enable_nailgun,
remote_parallelism=execution_options.process_execution_remote_parallelism,
)
self._py_scheduler = native_engine.scheduler_create(
executor,
tasks,
types,
build_root,
local_execution_root_dir,
named_caches_dir,
ca_certs_path,
ignore_patterns,
use_gitignore,
watch_filesystem,
remoting_options,
py_local_store_options,
> exec_stategy_opts,
)
E ValueError: Encountered 3 rule graph errors:
E No installed rules return the type UnionMembership, and it was not provided by potential callers of @rule(pants.bsp.rules:54:bsp_workspace_build_targets(WorkspaceBuildTargetsParams, UnionMembership) -> WorkspaceBuildTargetsResult).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E No installed rules return the type UnionMembership, and it was not provided by potential callers of Query(UnionMembership for ()).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
E No installed rules return the type WorkspaceBuildTargetsParams, and it was not provided by potential callers of @rule(pants.bsp.rules:54:bsp_workspace_build_targets(WorkspaceBuildTargetsParams, UnionMembership) -> WorkspaceBuildTargetsResult).
E If that type should be computed by a rule, ensure that that rule is installed.
E If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
src/python/pants/engine/internals/scheduler.py:225: ValueError
fast-nail-55400
02/07/2022, 8:58 PMQueryRule
for UnionMembership
should be brought in by the *bsp_rules()
linefast-nail-55400
02/07/2022, 9:03 PMUnionMembership
?witty-crayon-22786
02/07/2022, 9:03 PMmk_scheduler
creates a Scheduler
with no rules installed at allwitty-crayon-22786
02/07/2022, 9:04 PMengine_initializer
is: https://github.com/pantsbuild/pants/blob/b3b7e3ed1cd40df158fbbd86de64f4dac29481ef/src/python/pants/init/engine_initializer.py#L244-L246witty-crayon-22786
02/07/2022, 9:04 PMRuleRunner
instead.witty-crayon-22786
02/07/2022, 9:05 PMwitty-crayon-22786
02/07/2022, 9:06 PMRuleRunner
wraps engine_initializer
)fast-nail-55400
02/07/2022, 9:06 PMRuleRunner
only for tests?witty-crayon-22786
02/07/2022, 9:06 PMwitty-crayon-22786
02/07/2022, 9:07 PMengine_initializer
witty-crayon-22786
02/07/2022, 9:07 PMRuleRunner
in a test aligns with that.fast-nail-55400
02/07/2022, 9:07 PMBSPConnection
witty-crayon-22786
02/07/2022, 9:08 PMrule_runner.scheduler
, iirc.fast-nail-55400
02/07/2022, 9:08 PMwitty-crayon-22786
02/07/2022, 9:08 PMwitty-crayon-22786
02/07/2022, 9:09 PMmk_scheduler
, they’re pretty limited, and have shrunk over timefast-nail-55400
02/07/2022, 9:09 PMmk_scheduler
only because it seemed like SchedulerTestBase
was the way to gowitty-crayon-22786
02/07/2022, 9:11 PMRuleRunner
and pytest fixtures nowwitty-crayon-22786
02/07/2022, 9:11 PMSchedulerTestBase
doesn’t mention that though… whoops!witty-crayon-22786
02/07/2022, 9:12 PMfast-nail-55400
02/07/2022, 9:18 PMRuleRunner
fixed the rule graph issue. thanks!