-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Can py_runtime use a label cc_binary target as the interpreter? #4286
Description
Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
Description of the problem / feature request / question:
I want to
- build the cpython project with Bazel, and
- use the Bazel-built target to create my own py_runtime.
I have completely built the python binary target (a cc_binary target defined in a BUILD file) from the cpython source tree using Bazel. Check.
Now I am trying to reference the python binary target from the py_runtime rule.
I want to define py_runtime as the follows:
py_runtime(
name = 'py-3.7',
visibility = [
'//visibility:public',
],
files = glob([
'//third_party/cpython:runtime',
]),
interpreter = '//third_party/cpython:python',
)
The //third_party/cpython:python is the cc_binary.
The //third_party/cpython:runtime is the standard python runtime library. This is irrelevant to this issue.
If possible, provide a minimal example to reproduce the problem:
The snippet shown above is good enough for this purpose.
Environment info
-
Operating System:
Ubuntu 16.04 -
Bazel version (output of
bazel info release):
release 0.7.0 -
If
bazel info releasereturns "development version" or "(@Non-Git)", please tell us what source tree you compiled Bazel from; git commit hash is appreciated (git rev-parse HEAD):
Have you found anything relevant by searching the web?
Not really. I looked at the py_runtime doc (https://docs.bazel.build/versions/master/be/python.html#py_runtime).
Looks like the interpreter argument must point to an actual binary file. But I do not want to check in the python binary, yet. Instead, I want to build the python binary from my source tree.
Anything else, information or logs or outputs that would be helpful?
(If they are large, please upload as attachment or provide link).