-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
make_deb.py does not seem to be Python3-compatible #8443
Comments
This is hitting us as well. I think this was fixed in #6818 and then regressed by #7370. Note that there are many python3-broken lines the new revision, not just the one posted above. I worked around it by editing my |
Same problem with release 0.25.3, Edit: apparently |
Our entire project is Python3 so using |
This is a workaround for bazelbuild/bazel#8443
* Use --host_force_python=PY2 when building the Linux release This is a workaround for bazelbuild/bazel#8443 * Add comment explaining the flag.
* Use --host_force_python=PY2 when building the Linux release This is a workaround for bazelbuild/bazel#8443 * Add comment explaining the flag.
If this tool is meant to run under either Python 2 or Python 3, there ought to be If this tool is used in a non-host config, it'll only ever be analyzed for whichever version is declared in its own With Python toolchains not enabled (Bazel < 0.27), it may still run as whatever version the system has installed for the If the source code truly is compatible with both PY2 and PY3, and we add tests to enforce this, and we don't include any analysis-time logic that is sensitive to the Python version ( |
Let's take this over to the new place for these rules. @c4urself Would you like to place the issue (or more) there, or are you happy with me copying them over. But, to answer one question here.
For the Apple users who have to struggle to use Python3. |
$ bazel build runsc:runsc-debian File ".../bazel_tools/tools/build_defs/pkg/make_deb.py", line 311, in GetFlagValue: flagvalue = flagvalue.decode('utf-8') AttributeError: 'str' object has no attribute 'decode' make_deb.py is incompatible with Python3. bazelbuild/bazel#8443 PiperOrigin-RevId: 253640180
$ bazel build runsc:runsc-debian File ".../bazel_tools/tools/build_defs/pkg/make_deb.py", line 311, in GetFlagValue: flagvalue = flagvalue.decode('utf-8') AttributeError: 'str' object has no attribute 'decode' make_deb.py is incompatible with Python3. bazelbuild/bazel#8443 PiperOrigin-RevId: 253691923
…ld#696) * Use --host_force_python=PY2 when building the Linux release This is a workaround for bazelbuild/bazel#8443 * Add comment explaining the flag.
Fixed in rules_pkg: |
Description of the problem / feature request:
sys.argv is assumed to be bytes but is actually unicode in Python3
Feature requests: what underlying problem are you trying to solve with this feature?
using make_deb.py with Python3 like I did before this commit: (70e3c33#diff-687105bbda36ddcad584169fe214e7e1)
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
MacOS 10.13
What's the output of
bazel info release
?release 0.25.2
If
bazel info release
returns "development version" or "(@Non-Git)", tell us how you built Bazel.N/A
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?N/A
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: