-
Notifications
You must be signed in to change notification settings - Fork 543
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
file '__pycache__/foo.cpython-311.pyc' is generated by these conflicting actions #2445
Comments
Just recapping what I said in slack. This particular issue is really annoying and frustrating. I ran into this within Google and spent about a week trying to find workarounds, but eventually gave up. Instead, I updated a few hundred targets to have them use the exec-group for exec properties instead of using general keys. e.g. using the key This is due to two targets with the same Unfortunately, there isn't much we can do in the rules because of a confluence of things. First: the generated file name has to be based on the source file, not the target, otherwise the pyc file won't end up in a location the interpreter can find it. The basic thing we have to do is ensure that the Unfortunately, we can't override this when This means we have to set the exec_properties during the loading phase, before the rule is invoked. Unfortunately, this has several issues and caveats, but the two big ones are:
(1) means, when given An alternative would be to always set the py_precompile keys to some default value, e.g. merge in Another complication is exec_properties is configurable, i.e. it might be select(), so we can't reliably inspect it during the loading phase (this complicates (1) above). The gtg now. A bit of a half-baked wild idea would be: perform compiling in a separate target. |
🐞 bug report
Affected Rule
With this BUILD file, where 2 python rules include the same file, building both of these targets results in:
Is this a regression?
I bisected to eb2225c, we hit it when updating from 0.36.0 to 0.40.0
🔬 Minimal Reproduction
Build in this repo: repro.zip
The text was updated successfully, but these errors were encountered: