-
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
Replace subpar
with a cross-platform solution
#436
Comments
If this is possible, would it solve for the outstanding issue on #344 |
is the generated zip (zipapp? PEP-0441) cross platform? Does anyone know it's limitations there? I'm pretty surprised this is not a more advertised feature. |
The .zip won't be cross-platform. Any rules_python pip dependencies are fetched only for the local platform. In some cases with universal wheels they could be cross-platform, but it isn't a guarantee. Having said that and without in depth knowledge I don't think subpar's are truly cross-platform either. |
Is there currently a cross platform implementation for self contained Python apps? |
I agree, subpar and Since pip and wheel are both pure-python, I think both subpar and |
Except in that the zips are producible on windows and the pars are not, right? |
FWIW if cross-platform support is a necessity, which it may not be here, https://github.com/pantsbuild/pex has cross-platform support. |
Nice! Are there Bazel rules for that? Also, do all Python rules currently work on all platforms? I thought the par files were a bottleneck for windows |
I need to build .par files on windows. is there a workaround for it apart from using --build_python_zip? |
For what it's worth, I found @apache_incubator_heron//tools/rules/pex which seems to be a fork of https://github.com/benley/bazel_rules_pex at first glance but perhaps those rules can be used to finally address #2 ? |
subpar
with build_python_zip
subpar
with a cross-platform solution
I also came across https://github.com/arrdem/rules_zapp which seems like it might solve for some of the needs here. |
The two Maybe @brandjon or other maintainers can confirm if this can be dropped in the next release and then the need for the If not, the The If I recall correctly, the shebang in a zip from This does of course require Python to be installed on the PATH of the host and is not hermetic / toolchain aware, but this is true of the current situation with This is why I think the easiest path forward is to remove the legacy |
@thundergolfer @hrfuller feels to me like we are nearly two years past EOL for Python 2 and dropping some tech debt from rules_python would benefit us, so I'd like to adopt @groodt proposal here to remove the legacy |
If it helps any, dropping the legacy code would make investigations and feature development easier. I've gotten myself confused as to why I don't see the behavior or code I expect only to find i'm looking at the wrong file but didn't notice because it's so similar. |
@alexeagle I agree its time to ditch them. We should work on some rudimentary pex rules to replace par in the future. |
Thanks Andre! |
🚀 feature request
Description
A clear and concise description of the problem or missing capability...I opened this as a feature request because I otherwise didn't know how to raise open the issue
Right now the rules use subpar to generate some executable which are then committed back and reused for other rules:
rules_python/packaging/BUILD
Lines 45 to 62 in c37ba22
Is there a reason these couldn't be converted to using Bazel's
python_zip_file
functionality to accomplish the same thing? (introduced in bazelbuild/bazel#9453)The text was updated successfully, but these errors were encountered: