Skip to content

Commit

Permalink
[bcc] fix installation
Browse files Browse the repository at this point in the history
The installation directory needs to be on PYTHONPATH, otherwise
installation will fail.
  • Loading branch information
michalgr committed Dec 21, 2023
1 parent 500d9e7 commit 8a5446f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion projects/bcc/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $(BCC_ANDROID_BUILD_DIR): $(HOST_OUT_DIR)/bin/flex
-DBPS_LINK_RT=OFF \
-DENABLE_TESTS=OFF \
-DCMAKE_USE_LIBBPF_PACKAGE=ON \
-DPYTHON_CMD=$(abspath $(HOST_OUT_DIR)/bin/python3.10-no--install-layout)
-DPYTHON_CMD=$(abspath $(HOST_OUT_DIR)/bin/python.xinstall)

BCC_COMMIT = eb8ede2d70b17350757f2570ef76ea4c2e1dbff8
BCC_REPO = https://github.com/iovisor/bcc
Expand Down
11 changes: 6 additions & 5 deletions projects/python/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ $(PYTHON_ANDROID):
cp $(PYTHON_SRCS)/LICENSE $(ANDROID_OUT_DIR)/licenses/python
touch $@

$(PYTHON_HOST): $(HOST_OUT_DIR)/bin/python3.10-no--install-layout
$(PYTHON_HOST): $(HOST_OUT_DIR)/bin/python.xinstall
cd $(PYTHON_HOST_BUILD_DIR) && make install -j $(THREADS)
touch $@

$(HOST_OUT_DIR)/bin/python3.10-no--install-layout: projects/python/no--install-layout.template
$(HOST_OUT_DIR)/bin/python3.10-no--install-layout: | $(HOST_OUT_DIR)
sed -e "s+<HOST_OUT_DIR>+$(abspath $(HOST_OUT_DIR))+" \
projects/python/no--install-layout.template > $@
$(HOST_OUT_DIR)/bin/python.xinstall: projects/python/python.xinstall.template
$(HOST_OUT_DIR)/bin/python.xinstall: | $(HOST_OUT_DIR)
cp $^ $@
sed -ibkp -e "s+<HOST_OUT_DIR>+$(abspath $(HOST_OUT_DIR))+g" $@
sed -ibkp -e "s+<ANDROID_OUT_DIR>+$(abspath $(ANDROID_OUT_DIR))+g" $@
chmod +x $@

$(PYTHON_ANDROID_BUILD_DIR): \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import typing


INTERPRETER = "<HOST_OUT_DIR>/bin/python3.10"
PYTHONPATH = "<ANDROID_OUT_DIR>/lib/python3.10/site-packages/"
INSTALL_LAYOUT = "--install-layout"


Expand Down Expand Up @@ -36,7 +37,7 @@ def main():
case _:
args = [INTERPRETER] + sys.argv[1:]

os.execv(INTERPRETER, args)
os.execve(INTERPRETER, args, {"PYTHONPATH": PYTHONPATH})


if __name__ == "__main__":
Expand Down

0 comments on commit 8a5446f

Please sign in to comment.