Replies: 1 comment 2 replies
-
How much of this information is provided by
? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm a owner of rules_python, which is a framework for building Python programs using Bazel.
I suspect that some of our users would be interested in this, so I wanted to give a quick brain dump on the sort of functionality that would make that easier with the constraints Bazel imposes.
The main constraint comes from cross-platform building. The net implication is that you can't run Python itself to get information about Python because the Python runtime to query is for another platform. This, in turn, means that running things like
python-config
orpython -c "import sysconfig; ..."
etc to get information about where Python headers are, C ABI settings, etc can't be done.Instead, with Bazel, this information has to be provided in a platform-neutral format so that Bazel's "setup phase"[1] can transform it into appropriate Bazel configuration information. This setup phase can run arbitrary local programs and Starlark code (Bazel's platform-agnostic DSL).
All of this is to say: if the archive of the runtime includes e.g. a JSON file with information, e.g. where headers are, path to the interpreter binary, python version, abi settings, etc etc), then it can read that and generate the appropriate internal configuration. (I mention JSON because Starlark has builtin support for parsing that, but most any machine readable format can suffice)
What information needs to be provided? The more, the better; it's easy to ignore extra info, harder to reconstruct it after the fact. But a lower bound looks something like:
Hope this was helpful / informative!
Beta Was this translation helpful? Give feedback.
All reactions