-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Action conflicts when new Python version transition semantics are enabled #7655
Comments
@hlopko I'm at an impasse trying to understand the command lines of the conflicting actions. Or rather, how the output artifacts differ when they have the same path (root relative, and I believe also exec path from when I tried dumping that with a custom build). Any ideas on how I can dump more useful debug information? Here's the output I get from bazel for the above repro:
|
The output "differences" are spurious; see #7658. I expect the problem is that c++ compile actions are generally unshareable. Information about the shareability is not included in that error message. See if this fixes it:
|
Here I thought shareable actions were the exception, not the rule, but AbstractAction#isShareable says otherwise. |
@lberki (since you're on 772fdfe) and @gregestren (for configurability): What is the intended plan for shareable / non-shareable actions? If even trivial differences in the configuration will produce action conflicts in the transitive closure (at least, without fragment pruning -- heck let's add @serynth to the thread too!), this seems problematic for defining any transition that doesn't produce its own output root. For my use case I can tell users to enable --incompatible_remove_old_python_api to disable this particular transition, but I worry about what this means down the line for other transitions. |
Confirmed that setting |
@brandjon and I talked about this offline for a bit today. Both the work @serynth and I are doing (trimming and output path rewriting) could provide long-term generic solutions. I think the "plan" for shareable actions depends on who you ask. :) My hope is we can eliminate shared action risk completely, although that might be optimistic. Include scanning (which is why I believe C++ compile actions are exempted) do make life more complicated. |
The conclusion from my POV as a native rule author is that it is generally incorrect to ever transition the configuration without changing the output root, no matter how trivial the config change is. This situation should hopefully not arise again in Python rules, since any significant future feature work should take place in Starlark code rather than native. The resolution for users affected by this particular action conflict is to enable |
These transitions were intended to bring --force_python in sync with the actual Python version to make select() less broken. This ended up causing more problems than it fixed (#7655). It's not really needed anyway since the select() issue becomes moot once --incompatible_remove_old_python_version_api is enabled. RELNOTES: None PiperOrigin-RevId: 238281325
There've been multiple reports of action conflicts when
--incompatible_allow_python_version_transitions
is enabled. Here's a minimal repro:Note that
:foo
is built in two configurations: the top-level configuration, and a config transitioned by thepy_binary
rule. The transition serves two purposes:It changes the Python version if necessary (not the case here).
It changes the value of the physical
--force_python
flag (above it'snull
since it's absent) to be consistent with the Python version, so thatselect()
s on"force_python"
will work. This is done to improve backward compatibility, but once code is migrated for--incompatible_remove_old_python_version
, selecting on"force_python"
is actually prohibited anyway and this is moot.The logic for whether or not the transition occurs is here. If I prevent the transition from happening, the action conflict goes away. This can be done by passing either an explicit (but semantically redundant)
--force_python=PY2
flag, or the--incompatible_remove_old_python_version_api
flag.The question is what are the exact conflicting actions, and why did the two nearly identical configurations produce different results? It can't be due to hidden
select()
s on"force_python"
(via implicit dependencies), because they would be errors under--incompatible_remove_old_python_version_api
.The text was updated successfully, but these errors were encountered: