Skip to content

Commit 20939c4

Browse files
committed
chore(cross): Install Python 3.11
enable shared
1 parent c41af63 commit 20939c4

File tree

6 files changed

+73
-15
lines changed

6 files changed

+73
-15
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
package_target_libc: glibc
8484
fail-fast: false
8585
container:
86-
image: cubejs/rust-cross:${{ matrix.target }}-03012023
86+
image: cubejs/rust-cross:${{ matrix.target }}-23052023
8787

8888
steps:
8989
- name: Checkout
@@ -166,6 +166,10 @@ jobs:
166166
toolchain: nightly-2022-03-08
167167
override: true
168168
components: rustfmt
169+
- name: Install Python
170+
uses: actions/setup-python@v4
171+
with:
172+
python-version: '3.11'
169173
- name: Install Node.js ${{ matrix.node-version }}
170174
uses: actions/setup-node@v3
171175
with:

.github/workflows/rust-cubesql.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
files: ./rust/cubesql/cobertura.xml
8989
verbose: true
9090
flags: cubesql
91-
fail_ci_if_error: true
91+
fail_ci_if_error: false
9292

9393
unit_legacy:
9494
runs-on: ubuntu-20.04
@@ -130,7 +130,7 @@ jobs:
130130
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
131131
fail-fast: false
132132
container:
133-
image: cubejs/rust-cross:${{ matrix.target }}-03012023
133+
image: cubejs/rust-cross:${{ matrix.target }}-23052023
134134

135135
steps:
136136
- name: Checkout
@@ -219,6 +219,10 @@ jobs:
219219
toolchain: nightly-2022-03-08
220220
override: true
221221
components: rustfmt
222+
- name: Install Python
223+
uses: actions/setup-python@v4
224+
with:
225+
python-version: '3.11'
222226
- name: Install Node.js ${{ matrix.node-version }}
223227
uses: actions/setup-node@v3
224228
with:

rust/cubestore/cross/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CROSS_VERSION=03012023
1+
CROSS_VERSION=23052023

rust/cubestore/cross/aarch64-unknown-linux-gnu.Dockerfile

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,33 @@ RUN apt-get update \
88
&& DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common pkg-config wget apt-transport-https ca-certificates \
99
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
1010
&& add-apt-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" \
11-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-multilib g++-multilib \
11+
&& add-apt-repository -y ppa:deadsnakes/ppa \
12+
&& apt-get update \
13+
# python3 on x86 is required for cross compiling python :D
14+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y python3.11 \
15+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y libffi-dev binutils-multiarch binutils-aarch64-linux-gnu gcc-multilib g++-multilib \
16+
# llvm14-dev will install python 3.8 as bin/python3
1217
&& DEBIAN_FRONTEND=noninteractive apt-get install -y llvm-14 clang-14 libclang-14-dev clang-14 \
1318
make cmake libsasl2-dev \
1419
libc6 libc6-dev libc6-arm64-cross libc6-dev-arm64-cross \
1520
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
1621
&& apt-get autoremove -y \
1722
&& rm -rf /var/lib/apt/lists/*;
1823

24+
# CLang
1925
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 100
2026
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
2127
RUN update-alternatives --install /usr/bin/clang-cpp clang-cpp /usr/bin/clang-cpp-14 100
2228
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-14 100
2329
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 100
30+
# Python
31+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
32+
RUN update-alternatives --install /usr/bin/python3 python /usr/bin/python3.11 1
2433

2534
# https://www.openssl.org/source/old/1.1.1/
2635
ENV OPENSSL_VERSION=1.1.1q
2736
ENV LIZB_VERSION=1.2.13
37+
ENV PYTHON_VERSION=3.11.3
2838

2939
ENV ARCH=arm \
3040
MACHINE=armv8 \
@@ -35,6 +45,27 @@ ENV ARCH=arm \
3545
CPP=aarch64-linux-gnu-cpp \
3646
LD=aarch64-linux-gnu-ld
3747

48+
ENV PYO3_CROSS_PYTHON_VERSION=3.11 \
49+
PYO3_CROSS_INCLUDE_DIR=/usr/aarch64-linux-gnu/include \
50+
PYO3_CROSS_LIB_DIR=/usr/aarch64-linux-gnu/lib
51+
52+
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -O - | tar -xz && \
53+
cd Python-${PYTHON_VERSION} && \
54+
touch config.site-aarch64 && \
55+
echo "ac_cv_buggy_getaddrinfo=no" >> config.site-aarch64 && \
56+
echo "ac_cv_file__dev_ptmx=no" >> config.site-aarch64 && \
57+
echo "ac_cv_file__dev_ptc=no" >> config.site-aarch64 && \
58+
CONFIG_SITE=config.site-aarch64 ./configure \
59+
--enable-optimizations \
60+
--disable-ipv6 \
61+
--prefix=/usr/aarch64-linux-gnu \
62+
--build=aarch64-unknown-linux-gnu \
63+
--host=x86_64-linux-gnu \
64+
--with-build-python=/usr/bin/python3.11 && \
65+
make -j $(nproc) && \
66+
make install && \
67+
cd .. && rm -rf Python-${PYTHON_VERSION};
68+
3869
RUN wget https://zlib.net/zlib-${LIZB_VERSION}.tar.gz -O - | tar -xz && \
3970
cd zlib-${LIZB_VERSION} && \
4071
./configure --prefix=/usr/aarch64-linux-gnu && \

rust/cubestore/cross/x86_64-unknown-linux-gnu.Dockerfile

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ RUN apt-get update && apt-get -y upgrade \
55
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
66
&& add-apt-repository "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-14 main" \
77
&& apt-get update \
8+
# llvm14-dev will install python 3.8 as bin/python3
89
&& DEBIAN_FRONTEND=noninteractive apt-get install -y llvm-14 clang-14 libclang-14-dev clang-14 make cmake \
10+
lzma-dev liblzma-dev \
911
&& rm -rf /var/lib/apt/lists/*;
1012

1113
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 100
@@ -16,20 +18,36 @@ RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 100
1618

1719
# https://www.openssl.org/source/old/1.1.1/
1820
ARG OPENSSL_VERSION=1.1.1q
19-
20-
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -O - | tar -xz &&\
21-
cd openssl-${OPENSSL_VERSION} && \
22-
./Configure no-shared no-async --prefix=/openssl --openssldir=/openssl/ssl linux-x86_64-clang && \
23-
make depend && \
24-
make -j $(nproc) && \
25-
make install_sw && \
26-
make install_ssldirs && \
27-
cd .. && rm -rf ${OPENSSL_VERSION}
21+
RUN cd tmp && wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -O - | tar -xz \
22+
&& cd openssl-${OPENSSL_VERSION} \
23+
&& ./Configure no-shared no-async --prefix=/openssl --openssldir=/openssl/ssl linux-x86_64-clang \
24+
&& make depend \
25+
&& make -j $(nproc) \
26+
&& make install_sw \
27+
&& make install_ssldirs \
28+
&& cd .. && rm -rf ${OPENSSL_VERSION}
2829

2930
ENV PKG_CONFIG_ALLOW_CROSS=1
3031
ENV OPENSSL_STATIC=true
3132
ENV OPENSSL_DIR=/openssl
3233
ENV OPENSSL_ROOT_DIR=/openssl
3334
ENV OPENSSL_LIBRARIES=/openssl/lib
3435

36+
ARG PYTHON_VERSION=3.11.3
37+
RUN cd tmp && wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -O - | tar -xz \
38+
&& cd Python-${PYTHON_VERSION} && \
39+
./configure \
40+
--enable-shared \
41+
--with-openssl=/openssl \
42+
--enable-optimizations \
43+
--disable-ipv6 \
44+
--prefix=/usr \
45+
&& make -j $(nproc) \
46+
&& make install \
47+
&& ln -f -s /usr/bin/python3.11 /usr/bin/python3 \
48+
&& cd .. && rm -rf Python-${PYTHON_VERSION};
49+
50+
# pyo3 uses python3 to detect version, but there is a bug and it uses python3.7 (system), this force it to use a new python
51+
ENV PYO3_PYTHON=python3.11
52+
3553
ENV PATH="/cargo/bin:$PATH"

rust/cubestore/cross/x86_64-unknown-linux-musl.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ RUN apt-get update \
77
&& DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common pkg-config wget musl-tools libc6-dev apt-transport-https ca-certificates \
88
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
99
&& add-apt-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" \
10+
&& add-apt-repository -y ppa:deadsnakes/ppa \
1011
&& apt-get update \
12+
# llvm14-dev will install python 3.8 as bin/python3
1113
&& DEBIAN_FRONTEND=noninteractive apt-get install -y llvm-14 clang-14 libclang-14-dev clang-14 make cmake \
1214
&& rm -rf /var/lib/apt/lists/*;
1315

@@ -20,7 +22,6 @@ RUN mkdir /musl
2022

2123
# https://www.openssl.org/source/old/1.1.1/
2224
ARG OPENSSL_VERSION=1.1.1q
23-
2425
RUN wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -O - | tar -xz &&\
2526
cd openssl-${OPENSSL_VERSION} && \
2627
CC="musl-gcc -fPIE -pie" ./Configure no-shared no-async --prefix=/musl --openssldir=/musl/ssl linux-x86_64 && \

0 commit comments

Comments
 (0)