-
Notifications
You must be signed in to change notification settings - Fork 69
Advantages over --build_python_zip
#44
Comments
I'd be quite happy if Bazel adds official support for Python Zip Applications that renders subpar obsolete, but so far the .zip support is incomplete, only available to Windows by default, and makes some interesting design choices. |
I'm using |
I actually find it useful to be able to specify the |
As per Bazel devs:
|
@duggelz Regarding (4), do you have a link to where that discussion is ongoing? |
To the point of @hwright, we have been using the zipped binaries as file dependencies in |
After spending some time reviewing subpar vs
From my point of view, the most compelling path forward is to add zips as implicit outputs in the standard rules and deprecate subpar. I do wonder if there's anyone really depending on features in subpar they can't otherwise get. |
@siddharthab Do you have an example where you use rules_docker and the output of @brandjon I agree, I feel like if py_binary had zipped output, then subpar would no longer need to be supported. |
@groodt Not sure how detailed an example you want because it's a simple point. But something like,
works just fine for us. Just the above is enough to package python binaries with their runfiles and our python toolchain (wrappers to ensure correct minor versions of python, etc.) into the docker image as a single zip file. Repeated invocations of the self-extracting zip however is slow (e.g. calling the binary in a loop), and I wish that there was some documentation that gave instructions or guidance on how to extract once and then call the stub multiple times. |
Thanks @siddharthab So to make sure I understand, do you push the image with: |
Yes. We have the option in our repo bazelrc. |
Interesting. Thanks! I'll have to try that. The only reason we're currently using subpar is because I couldn't get py_binary working reliably when added as files with rules_docker. |
The problem I have with this argument is that your comparing subpar to zip when subpar is shell of what it was suppose to be. Subpar does not support the features that are needed. Anything not full python breaks it. (psutil, netaddress). Its unfortunate that it looks like python is going to get the shaft on this one which of course will make bazel fall out of favor for serious python. |
Bazel has a
--build_python_zip
flag for build that also produces a self-contained executable binary. Could someone update theREADME.md
to clearly articulate the advantages the.par
files provide over that?Reference: https://bazel.build/designs/2016/09/05/build-python-on-windows.html
The text was updated successfully, but these errors were encountered: