@@ -30,7 +30,8 @@ ARG TARGET_LIST
30
30
RUN apt-get -qq update
31
31
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $(cat /tmp/build_dep.txt | grep -o '^[^#]*' ) && \
32
32
apt-get clean && \
33
- python3 -m pip install --upgrade --no-cache-dir pip && \
33
+ wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && \
34
+ python3 -m pip install --upgrade --no-cache-dir "packaging>22.0" && \
34
35
python3 -m pip install --upgrade --no-cache-dir "cffi>1.14.3" && \
35
36
python3 -m pip install --upgrade --no-cache-dir "capstone" && \
36
37
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
@@ -53,24 +54,27 @@ RUN cd /tmp && \
53
54
cmake -GNinja .. && ninja && ninja package && dpkg -i libosi*.deb && \
54
55
cd /tmp && rm -rf libosi/ && ldconfig
55
56
56
- # Build and install panda
57
57
# Note we diable NUMA for docker builds because it causes make check to fail in docker
58
58
RUN git -C /panda submodule update --init dtc && \
59
59
git -C /panda rev-parse HEAD > /usr/local/panda_commit_hash && \
60
60
mkdir /panda/build && cd /panda/build && \
61
+ python3 -m pip install setuptools_scm && \
62
+ python3 -m pip install build && \
63
+ python3 -m setuptools_scm -r .. --strip-dev 2>/dev/null >/tmp/savedversion && \
61
64
/panda/configure \
62
65
--target-list="${TARGET_LIST}" \
63
66
--prefix=/usr/local \
64
67
--disable-numa \
65
- --enable-llvm \
66
- --extra-cflags= "-Wno-error=deprecated-declarations"
68
+ --enable-llvm && \
69
+ rm -rf /panda/.git
67
70
68
- RUN make -C /panda/build -j "$(nproc)"
71
+ RUN PRETEND_VERSION=$(cat /tmp/savedversion) make -C /panda/build -j "$(nproc)"
69
72
70
73
# ### Develop setup: panda built + pypanda installed (in develop mode) - Stage 3
71
74
FROM builder as developer
72
75
RUN cd /panda/panda/python/core && \
73
- python3 setup.py develop && \
76
+ python3 create_panda_datatypes.py && \
77
+ PRETEND_VERSION=$(cat /tmp/savedversion) pip install -e . && \
74
78
ldconfig && \
75
79
update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
76
80
cd /panda && \
@@ -90,8 +94,15 @@ RUN make -C /panda/build install && \
90
94
91
95
# Install pypanda
92
96
RUN cd /panda/panda/python/core && \
93
- python3 setup.py install
97
+ python3 create_panda_datatypes.py --install && \
98
+ PRETEND_VERSION=$(cat /tmp/savedversion) pip install .
94
99
RUN python3 -m pip install --ignore-install pycparser && python3 -m pip install --force-reinstall --no-binary :all: cffi
100
+ # Build a whl too
101
+ RUN cd /panda/panda/python/core && \
102
+ python3 create_panda_datatypes.py --install && \
103
+ PRETEND_VERSION=$(cat /tmp/savedversion) python3 -m build --wheel .
104
+
105
+ RUN python3 -m pip show pandare
95
106
96
107
# BUG: PANDA sometimes fails to generate all the necessary files for PyPANDA. This is a temporary fix to detect and fail when this occurs
97
108
RUN ls -alt $(pip show pandare | grep Location: | awk '{print $2}' )/pandare/autogen/
@@ -126,9 +137,9 @@ COPY --from=cleanup /usr/lib/libcapstone* /usr/lib/
126
137
COPY --from=cleanup /lib/libosi.so /lib/libiohal.so /lib/liboffset.so /lib/
127
138
128
139
# Workaround issue #901 - ensure LD_LIBRARY_PATH contains the panda plugins directories
129
- ENV LD_LIBRARY_PATH /usr/local/lib/python3.8 /dist-packages/pandare/data/x86_64-softmmu/panda/plugins/:/usr/local/lib/python3.8 /dist-packages/pandare/data/i386-softmmu/panda/plugins/:/usr/local/lib/python3.8 /dist-packages/pandare/data/arm-softmmu/panda/plugins/:/usr/local/lib/python3.8 /dist-packages/pandare/data/ppc-softmmu/panda/plugins/:/usr/local/lib/python3.8 /dist-packages/pandare/data/mips-softmmu/panda/plugins/:/usr/local/lib/python3.8 /dist-packages/pandare/data/mipsel-softmmu/panda/plugins/
140
+ ENV LD_LIBRARY_PATH /usr/local/lib/python3.10 /dist-packages/pandare/data/x86_64-softmmu/panda/plugins/:/usr/local/lib/python3.10 /dist-packages/pandare/data/i386-softmmu/panda/plugins/:/usr/local/lib/python3.10 /dist-packages/pandare/data/arm-softmmu/panda/plugins/:/usr/local/lib/python3.10 /dist-packages/pandare/data/ppc-softmmu/panda/plugins/:/usr/local/lib/python3.10 /dist-packages/pandare/data/mips-softmmu/panda/plugins/:/usr/local/lib/python3.10 /dist-packages/pandare/data/mipsel-softmmu/panda/plugins/
130
141
# PANDA_PATH is used by rust plugins
131
- ENV PANDA_PATH /usr/local/lib/python3.8 /dist-packages/pandare/data
142
+ ENV PANDA_PATH /usr/local/lib/python3.10 /dist-packages/pandare/data
132
143
133
144
# Ensure runtime dependencies are installed for our libpanda objects and panda plugins
134
145
RUN ldconfig && \
@@ -144,7 +155,7 @@ RUN apt-get -qq update
144
155
RUN apt-get -qq install -y gcc libguestfs-tools make flex bison libelf-dev bc linux-image-generic pahole gdb
145
156
146
157
# Compile and install bpftool
147
- RUN cd /tmp && git clone --branch v7.4 .0 --recurse-submodules https://github.com/libbpf/bpftool.git
158
+ RUN cd /tmp && git clone --branch v7.5 .0 --recurse-submodules https://github.com/libbpf/bpftool.git
148
159
RUN cd /tmp/bpftool/src && make && make install
149
160
150
161
# Install python dependencies
0 commit comments