Skip to content

Commit

Permalink
chore(precompiling): use PyCompile as mnemonic to match Google mnem…
Browse files Browse the repository at this point in the history
…onic (#1911)

This is just to make the two implementations a bit closer; the mnemonic
is a psuedo-public API as it shows up in flags, actions, queries, etc.
  • Loading branch information
rickeylev authored May 22, 2024
1 parent 730a2e3 commit 66550ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/sphinx/precompiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ mechanisms are available:
* The execution requirements can be customized using
`--@rules_python//tools/precompiler:execution_requirements`. This is a list
flag that can be repeated. Each entry is a key=value that is added to the
execution requirements of the `PyPrecompile` action. Note that this flag
execution requirements of the `PyCompile` action. Note that this flag
is specific to the rules_python precompiler. If a custom binary is used,
this flag will have to be propagated from the custom binary using the
`testing.ExecutionInfo` provider; refer to the `py_interpreter_program` an

The default precompiler implementation is an asynchronous/concurrent
implementation. If you find it has bugs or hangs, please report them. In the
meantime, the flag `--worker_extra_flag=PyPrecompile=--worker_impl=serial` can
meantime, the flag `--worker_extra_flag=PyCompile=--worker_impl=serial` can
be used to switch to a synchronous/serial implementation that may not perform
as well, but is less likely to have issues.

Expand Down
2 changes: 1 addition & 1 deletion python/private/common/common_bazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def _precompile(ctx, src, *, use_pycache):
arguments = [precompiler_startup_args, precompile_request_args],
inputs = [src],
outputs = [pyc],
mnemonic = "PyPrecompile",
mnemonic = "PyCompile",
progress_message = "Python precompiling %{input} into %{output}",
tools = tools,
env = env | {
Expand Down
2 changes: 1 addition & 1 deletion tests/base_rules/precompile/precompile_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ _tests.append(_test_precompiler_action)

def _test_precompiler_action_impl(env, target):
#env.expect.that_target(target).runfiles().contains_exactly([])
action = env.expect.that_target(target).action_named("PyPrecompile")
action = env.expect.that_target(target).action_named("PyCompile")
action.contains_flag_values([
("--optimize", "2"),
("--python_version", "4.5"),
Expand Down

0 comments on commit 66550ec

Please sign in to comment.