-
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
0.27.0 build failure on fedora: python3 not detected #8665
Comments
From the log:
|
bazelbuild/bazel#8665 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
it ignored the --python3_path flag, so i had dropped that argument. And it says it assumes [root@f2f16cce4a3b copr-build-bazel]# python3^T^t
python3 python3.7 python3.7m There is python3 present, but it is not being detected. |
So previously you passed The failure comes from the stub script's shebang, before Python 2 vs Python 3 differences come into play (the stub script is compatible with both). This part of how Python programs are launched shouldn't have changed in 0.27. Is
I see this recent change in the spec file. I suspect you need the |
It worked up to 0.26.0 to manually point to
This is something in rpm dependency magic of what provides that name (or string), which use to be python 2.7, but Fedora is pushing everything to be python 3 now. |
@brandjon I just found that if I also install python 2.7, such that there is a |
I strongly suspect it wasn't doing anything and could've been removed prior to 0.27 without affecting the build.
Nope, it's working as intended. The My recommendation is to ensure that |
See also #8446. |
sorry, this is not making sense. |
Sorry for not being clear -- there definitely must be a Python interpreter available on From the point of view of the Bazel 0.27 release, the important changes are:
But Bazel 0.27 doesn't change what versions of Python are actually needed on the system. If you needed Python 2 before, that's still true, and same for if you needed Python 3. So I'm not sure why that part of the spec file was changed for 0.27. |
Unless you fix the shebang line, which is a standard step in many packaging frameworks. For the FreeBSD ports, the (For 0.27.0 I also had to patch in the path of the python 3 interpreter to avoid having to depend on the generic Thanks @vbatts for maintaining a bazel package and good luck porting. |
@aehlig good pointers. I've just tried several permutations of that to no avail. find . -type f -regextype posix-extended -iregex '.*(sh|txt|py|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)' -exec %{__sed} -i -e '1s|^#!/usr/bin/env python$|#!/usr/bin/env python3|' "{}" \;
export EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS} --python_path=/usr/bin/python3" but still |
It looks like the hacki'est winner is simply forcing a # horrible of horribles, just to have `python` in the PATH
mkdir -p ./bin-hack
ln -sf /usr/bin/python3 ./bin-hack/python
export PATH=$(pwd)/bin-hack:$PATH |
I've worked around this issue for now, but requiring |
@aehlig, it looks like you patched the wrapper script that invokes Python on the payload code in order to locate a Python 3 interpreter for the payload. That shouldn't be necessary -- you can define a Python toolchain that knows the exact path to the Python 2 and Python 3 interpreters, and use that in place of the autodetecting toolchain (so the wrapper script isn't called at all). The issue with shebang is trickier because we don't support injecting a custom shebang via a toolchain, and it's not clear that we want to add support for that (as opposed to just rewriting the stub in C++). |
That script is also embedded into bazel, so it has to work also in the installed bazel, not just when boostrapping bazel. And here, Python 3 is special in that I know the path of a good Python 3 interpreter—the one that is a |
Symbolic link method seems to have worked for me ...
|
symbolic link also worked for me |
Attempting to build the fedora release rpms for v0.27.0 (https://copr.fedorainfracloud.org/coprs/vbatts/bazel) using the spec file at https://github.com/vbatts/copr-build-bazel
Description of the problem / feature request:
full build log bazel-f30.log
relevant snip:
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
building the fedora-30-x86_64 rpm on copr
What operating system are you running Bazel on?
Fedora 30 x86_64
What's the output of
bazel info release
?n/a
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?n/a
The text was updated successfully, but these errors were encountered: