From 18da0f9dfcd0b9b7ac9d8c0f419135e056534444 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 27 Feb 2024 13:51:38 -0500 Subject: [PATCH 01/15] build sqlite for risc python installs --- ubuntu-22.04-risc/Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 1de4a9f..b92d10c 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -3,13 +3,21 @@ FROM riscv64/ubuntu:focal ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" +# Compile newer version of sqlite3 \ +RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ + tar -xzf sqlite-autoconf-3400100.tar.gz && \ + cd sqlite-autoconf-3400100 && \ + CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/sqlite/usr && \ + make && \ + make install + RUN apt-get update && \ DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential cmake curl git make libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ curl https://pyenv.run | bash && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \ + # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ + # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \ + # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ + # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \ PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.12 && \ pyenv global 3.12 && \ rm -rf /var/lib/apt/lists/* From d5805327e88c8d76657662ed6489a8d4de576854 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 27 Feb 2024 14:29:38 -0500 Subject: [PATCH 02/15] Update Dockerfile --- ubuntu-22.04-risc/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index b92d10c..9504d8c 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -3,6 +3,9 @@ FROM riscv64/ubuntu:focal ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" +RUN apt-get update && \ + DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential cmake curl wget git make libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev + # Compile newer version of sqlite3 \ RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ tar -xzf sqlite-autoconf-3400100.tar.gz && \ @@ -11,9 +14,7 @@ RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ make && \ make install -RUN apt-get update && \ - DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential cmake curl git make libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ - curl https://pyenv.run | bash && \ +RUN curl https://pyenv.run | bash && \ # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \ # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ From 99389b28c8c575435f89c51b8b9fbf1f4b4de85b Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 27 Feb 2024 14:31:13 -0500 Subject: [PATCH 03/15] Update Dockerfile --- ubuntu-22.04-risc/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 9504d8c..0405e3c 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -4,7 +4,8 @@ ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" RUN apt-get update && \ - DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential cmake curl wget git make libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev + DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential cmake curl wget git make libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ + rm -rf /var/lib/apt/lists/* # Compile newer version of sqlite3 \ RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ @@ -20,8 +21,7 @@ RUN curl https://pyenv.run | bash && \ # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \ PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.12 && \ - pyenv global 3.12 && \ - rm -rf /var/lib/apt/lists/* + pyenv global 3.12 ENV PATH="/root/.cargo/bin:${PATH}" ENV RUST_BACKTRACE=1 From 92972e7ec756fbf15104badff9cebd8e951e3ce5 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 28 Feb 2024 07:49:16 -0500 Subject: [PATCH 04/15] Update Dockerfile --- ubuntu-22.04-risc/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 0405e3c..21075b5 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -16,10 +16,10 @@ RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ make install RUN curl https://pyenv.run | bash && \ - # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ - # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \ - # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ - # PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \ + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \ + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \ PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.12 && \ pyenv global 3.12 From 730ef7c3b1c09768d588d1c7f605c0992551c4e3 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 28 Feb 2024 11:22:35 -0500 Subject: [PATCH 05/15] Update Dockerfile --- ubuntu-22.04-risc/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 21075b5..d36575f 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -8,12 +8,15 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Compile newer version of sqlite3 \ -RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ +RUN cd ~ && \ + wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ tar -xzf sqlite-autoconf-3400100.tar.gz && \ cd sqlite-autoconf-3400100 && \ - CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/sqlite/usr && \ + CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/usr && \ make && \ - make install + make install && \ + cd ~ && \ + rm -rf ~/sqlite-autoconf* RUN curl https://pyenv.run | bash && \ PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ From cf8d6d14215751ddcb570879fa53ccafc0e4de59 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Mon, 22 Jul 2024 16:24:05 -0400 Subject: [PATCH 06/15] Update Dockerfile --- ubuntu-22.04-risc/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 0d8f529..8c97837 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -24,7 +24,7 @@ RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ make && \ make install && \ ls -la /sqlite/usr/bin && \ - sqlite -version + /sqlite/usr/bin/sqlite3 -version FROM base as final @@ -34,7 +34,7 @@ COPY --from=sqlite /sqlite/usr /usr RUN ls -la /usr/bin && \ ld --version && \ - sqlite -version + sqlite3 -version ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" From 2fba6f66846391e86d1215ba79cca73e03a01f6a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 11:35:29 -0400 Subject: [PATCH 07/15] to share --- ubuntu-22.04-risc/Dockerfile | 53 ++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 8c97837..dc6d962 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -1,50 +1,57 @@ -FROM riscv64/ubuntu:focal as base +FROM ubuntu:focal as base RUN apt-get update && \ - DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential cmake curl wget git make pkg-config libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ + DEBIAN_FRONTEND="noninteractive" apt-get install -y tree build-essential cmake curl wget git make pkg-config libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ rm -rf /var/lib/apt/lists/* -FROM base as ld - -RUN curl -L -O https://ftpmirror.gnu.org/gnu/binutils/binutils-2.38.tar.gz && \ - tar -xvzf binutils-2.38.tar.gz && \ - cd binutils-2.38 && \ - ./configure --enable-ld --disable-gas --disable-gmp --disable-gold --disable-gprof --prefix=/ld/usr && \ - make && \ - make install && \ - ls -la /ld/usr/bin && \ - ld --version +#FROM base as ld +# +#RUN curl -L -O https://ftpmirror.gnu.org/gnu/binutils/binutils-2.38.tar.gz && \ +# tar -xvzf binutils-2.38.tar.gz && \ +# cd binutils-2.38 && \ +# ./configure --enable-ld --disable-gas --disable-gmp --disable-gold --disable-gprof --prefix=/ld/usr && \ +# make && \ +# make install && \ +# ls -la /ld/usr/bin && \ +# ld --version FROM base as sqlite RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ tar -xzf sqlite-autoconf-3400100.tar.gz && \ cd sqlite-autoconf-3400100 && \ - CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/sqlite/usr && \ + CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/opt/sqlite3 && \ make && \ make install && \ - ls -la /sqlite/usr/bin && \ - /sqlite/usr/bin/sqlite3 -version + tree /opt/sqlite3 && \ + ls -la /opt/sqlite3/bin && \ + /opt/sqlite3/bin/sqlite3 -version FROM base as final -COPY --from=ld /ld/usr /usr +#COPY --from=ld /ld/usr /usr -COPY --from=sqlite /sqlite/usr /usr +COPY --from=sqlite /opt/sqlite3 /opt/sqlite3 RUN ls -la /usr/bin && \ ld --version && \ - sqlite3 -version + tree /opt/sqlite3 && \ + /opt/sqlite3/bin/sqlite3 -version ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" RUN curl https://pyenv.run | bash && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \ - PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.12 && \ + export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared" && \ + export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} SQLITE3_LIBS='-L/opt/sqlite3/lib -lsqlite3'" && \ + ls -la /opt/sqlite3/lib && \ + export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} SQLITE3_CFLAGS='-I/opt/sqlite3/include'" && \ + ls -la /opt/sqlite3/include && \ + pyenv install --skip-existing 3.8 && \ + pyenv install --skip-existing 3.9 && \ + pyenv install --skip-existing 3.10 && \ + pyenv install --skip-existing 3.11 && \ + pyenv install --skip-existing 3.12 && \ pyenv global 3.12 ENV PATH="/root/.cargo/bin:${PATH}" From bda020318742e03ac28f3945af20e7154618e8d9 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 12:03:53 -0400 Subject: [PATCH 08/15] tidy and works --- ubuntu-22.04-risc/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index dc6d962..14a626d 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -41,12 +41,13 @@ RUN ls -la /usr/bin && \ ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" -RUN curl https://pyenv.run | bash && \ +RUN tree /opt && \ + curl https://pyenv.run | bash && \ export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared" && \ - export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} SQLITE3_LIBS='-L/opt/sqlite3/lib -lsqlite3'" && \ - ls -la /opt/sqlite3/lib && \ - export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} SQLITE3_CFLAGS='-I/opt/sqlite3/include'" && \ - ls -la /opt/sqlite3/include && \ + export LDFLAGS="$(PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig pkg-config --libs --define-variable=prefix=/opt/sqlite3 sqlite3)" && \ + export CPPFLAGS="$(PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig pkg-config --cflags --define-variable=prefix=/opt/sqlite3 sqlite3)" && \ + echo LDFLAGS="${LDFLAGS}" && \ + echo CPPFLAGS="${CPPFLAGS}" && \ pyenv install --skip-existing 3.8 && \ pyenv install --skip-existing 3.9 && \ pyenv install --skip-existing 3.10 && \ From 7efa8fd314b072ab28c2d80b7333545a0c3deb6e Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 14:46:35 -0400 Subject: [PATCH 09/15] pkg-config? nope --- .github/workflows/build-ubuntu-22.04-risc.yml | 2 +- ubuntu-22.04-risc/Dockerfile | 86 ++++++++++++------- 2 files changed, 55 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-ubuntu-22.04-risc.yml b/.github/workflows/build-ubuntu-22.04-risc.yml index 0476c86..0a9d2e3 100644 --- a/.github/workflows/build-ubuntu-22.04-risc.yml +++ b/.github/workflows/build-ubuntu-22.04-risc.yml @@ -30,7 +30,7 @@ jobs: docker-context: "./ubuntu-22.04-risc" dockerfile: "./ubuntu-22.04-risc/Dockerfile" dockerhub_imagename: "chianetwork/ubuntu-22.04-risc-builder" - docker-platforms: linux/riscv64 +# docker-platforms: linux/riscv64 image_subpath: "ubuntu-22.04-risc-builder" secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 14a626d..77d3166 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -4,59 +4,81 @@ RUN apt-get update && \ DEBIAN_FRONTEND="noninteractive" apt-get install -y tree build-essential cmake curl wget git make pkg-config libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ rm -rf /var/lib/apt/lists/* -#FROM base as ld -# -#RUN curl -L -O https://ftpmirror.gnu.org/gnu/binutils/binutils-2.38.tar.gz && \ -# tar -xvzf binutils-2.38.tar.gz && \ -# cd binutils-2.38 && \ -# ./configure --enable-ld --disable-gas --disable-gmp --disable-gold --disable-gprof --prefix=/ld/usr && \ -# make && \ -# make install && \ -# ls -la /ld/usr/bin && \ -# ld --version +FROM base as ld + +RUN curl -L -O https://ftpmirror.gnu.org/gnu/binutils/binutils-2.38.tar.gz && \ + tar -xvzf binutils-2.38.tar.gz && \ + cd binutils-2.38 && \ + ./configure --enable-ld --disable-gas --disable-gmp --disable-gold --disable-gprof --prefix=/opt/ld && \ + make && \ + make install && \ + tree /opt && \ + /opt/ld/bin/ld --version FROM base as sqlite -RUN wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ - tar -xzf sqlite-autoconf-3400100.tar.gz && \ +RUN curl -L -O https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \ + tar -xvzf sqlite-autoconf-3400100.tar.gz && \ cd sqlite-autoconf-3400100 && \ CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/opt/sqlite3 && \ make && \ make install && \ - tree /opt/sqlite3 && \ - ls -la /opt/sqlite3/bin && \ + tree /opt && \ /opt/sqlite3/bin/sqlite3 -version FROM base as final -#COPY --from=ld /ld/usr /usr +COPY --from=ld /opt/ld /usr COPY --from=sqlite /opt/sqlite3 /opt/sqlite3 -RUN ls -la /usr/bin && \ +RUN tree /opt && \ ld --version && \ - tree /opt/sqlite3 && \ /opt/sqlite3/bin/sqlite3 -version ENV PYENV_ROOT=/root/.pyenv ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" -RUN tree /opt && \ - curl https://pyenv.run | bash && \ - export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared" && \ - export LDFLAGS="$(PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig pkg-config --libs --define-variable=prefix=/opt/sqlite3 sqlite3)" && \ - export CPPFLAGS="$(PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig pkg-config --cflags --define-variable=prefix=/opt/sqlite3 sqlite3)" && \ - echo LDFLAGS="${LDFLAGS}" && \ - echo CPPFLAGS="${CPPFLAGS}" && \ - pyenv install --skip-existing 3.8 && \ - pyenv install --skip-existing 3.9 && \ - pyenv install --skip-existing 3.10 && \ - pyenv install --skip-existing 3.11 && \ - pyenv install --skip-existing 3.12 && \ - pyenv global 3.12 +RUN curl https://pyenv.run | bash + +ARG PYTHON_CONFIGURE_OPTS="--enable-shared" + +# for 3.8 - 3.10 +ARG LDFLAGS="-L/opt/sqlite3/lib -lsqlite3" +ARG CPPFLAGS=-I/opt/sqlite3/include + +RUN pyenv install 3.8 +#RUN pyenv install 3.9 +#RUN pyenv install 3.10 + +# for 3.11+ +#ARG LIBSQLITE3_LIBS=-L/opt/sqlite3/lib -lsqlite3 +#ARG LIBSQLITE3_CFLAGS=-I/opt/sqlite3/include +#ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} LIBSQLITE3_LIBS='-L/opt/sqlite3/lib -lsqlite3'" +#ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} LIBSQLITE3_CFLAGS=-I/opt/sqlite3/include" + +ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig" + +RUN tree /opt +ARG PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig +RUN pkg-config sqlite3 --cflags +RUN pkg-config sqlite3 --libs + +RUN pyenv install 3.11 +#RUN pyenv install 3.12 + +RUN pyenv global 3.11 3.8 + +ENV LD_LIBRARY_PATH="/opt/sqlite3/lib" + +RUN ldd $(python3.8 -c 'import _sqlite3; print(_sqlite3.__file__)') +#RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') +#RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') +RUN ldd $(python3.11 -c 'import _sqlite3; print(_sqlite3.__file__)') +#RUN ldd $(python3.12 -c 'import _sqlite3; print(_sqlite3.__file__)') ENV PATH="/root/.cargo/bin:${PATH}" ENV RUST_BACKTRACE=1 -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ - cargo install sccache +#RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ +# cargo install sccache From c97e6e11dc5667973ff1680dd953cfb4ac3b2b2a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 15:39:43 -0400 Subject: [PATCH 10/15] working in 3.11 --- ubuntu-22.04-risc/Dockerfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 77d3166..4d80465 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -41,11 +41,12 @@ ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" RUN curl https://pyenv.run | bash +#ARG PYTHONSTRICTEXTENSIONBUILD=1 ARG PYTHON_CONFIGURE_OPTS="--enable-shared" # for 3.8 - 3.10 ARG LDFLAGS="-L/opt/sqlite3/lib -lsqlite3" -ARG CPPFLAGS=-I/opt/sqlite3/include +ARG CPPFLAGS="-I/opt/sqlite3/include" RUN pyenv install 3.8 #RUN pyenv install 3.9 @@ -57,20 +58,16 @@ RUN pyenv install 3.8 #ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} LIBSQLITE3_LIBS='-L/opt/sqlite3/lib -lsqlite3'" #ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} LIBSQLITE3_CFLAGS=-I/opt/sqlite3/include" -ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig" +#ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig" RUN tree /opt -ARG PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig -RUN pkg-config sqlite3 --cflags -RUN pkg-config sqlite3 --libs +ENV LD_LIBRARY_PATH="/opt/sqlite3/lib" RUN pyenv install 3.11 #RUN pyenv install 3.12 RUN pyenv global 3.11 3.8 -ENV LD_LIBRARY_PATH="/opt/sqlite3/lib" - RUN ldd $(python3.8 -c 'import _sqlite3; print(_sqlite3.__file__)') #RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') #RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') From ce0b9e1fe36e4497c225385842fcf8c1ddbe8fba Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 15:44:43 -0400 Subject: [PATCH 11/15] all --- ubuntu-22.04-risc/Dockerfile | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 4d80465..cd0590f 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -41,41 +41,31 @@ ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" RUN curl https://pyenv.run | bash -#ARG PYTHONSTRICTEXTENSIONBUILD=1 ARG PYTHON_CONFIGURE_OPTS="--enable-shared" -# for 3.8 - 3.10 ARG LDFLAGS="-L/opt/sqlite3/lib -lsqlite3" ARG CPPFLAGS="-I/opt/sqlite3/include" RUN pyenv install 3.8 -#RUN pyenv install 3.9 -#RUN pyenv install 3.10 +RUN pyenv install 3.9 +RUN pyenv install 3.10 -# for 3.11+ -#ARG LIBSQLITE3_LIBS=-L/opt/sqlite3/lib -lsqlite3 -#ARG LIBSQLITE3_CFLAGS=-I/opt/sqlite3/include -#ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} LIBSQLITE3_LIBS='-L/opt/sqlite3/lib -lsqlite3'" -#ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} LIBSQLITE3_CFLAGS=-I/opt/sqlite3/include" - -#ARG PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} PKG_CONFIG_PATH=/opt/sqlite3/lib/pkgconfig" - -RUN tree /opt +# needed only for the 3.11+ builds ENV LD_LIBRARY_PATH="/opt/sqlite3/lib" RUN pyenv install 3.11 -#RUN pyenv install 3.12 +RUN pyenv install 3.12 -RUN pyenv global 3.11 3.8 +RUN pyenv global 3.12 3.11 3.10 3.9 3.8 RUN ldd $(python3.8 -c 'import _sqlite3; print(_sqlite3.__file__)') -#RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') -#RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') +RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') +RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') RUN ldd $(python3.11 -c 'import _sqlite3; print(_sqlite3.__file__)') -#RUN ldd $(python3.12 -c 'import _sqlite3; print(_sqlite3.__file__)') +RUN ldd $(python3.12 -c 'import _sqlite3; print(_sqlite3.__file__)') ENV PATH="/root/.cargo/bin:${PATH}" ENV RUST_BACKTRACE=1 -#RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ -# cargo install sccache +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ + cargo install sccache From 8384e02c5974eeb45deb27a1e61f9dcc76e6f5ec Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 15:50:21 -0400 Subject: [PATCH 12/15] back to risc --- .github/workflows/build-ubuntu-22.04-risc.yml | 2 +- ubuntu-22.04-risc/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ubuntu-22.04-risc.yml b/.github/workflows/build-ubuntu-22.04-risc.yml index 0a9d2e3..0476c86 100644 --- a/.github/workflows/build-ubuntu-22.04-risc.yml +++ b/.github/workflows/build-ubuntu-22.04-risc.yml @@ -30,7 +30,7 @@ jobs: docker-context: "./ubuntu-22.04-risc" dockerfile: "./ubuntu-22.04-risc/Dockerfile" dockerhub_imagename: "chianetwork/ubuntu-22.04-risc-builder" -# docker-platforms: linux/riscv64 + docker-platforms: linux/riscv64 image_subpath: "ubuntu-22.04-risc-builder" secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index cd0590f..56d830e 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal as base +FROM riscv64/ubuntu:focal as base RUN apt-get update && \ DEBIAN_FRONTEND="noninteractive" apt-get install -y tree build-essential cmake curl wget git make pkg-config libgmp-dev libboost-dev libssl-dev zlib1g zlib1g-dev libreadline-dev libffi-dev && \ From ec6932e24d045a3e28e6b2e62e64cb6020e893fd Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 16:01:30 -0400 Subject: [PATCH 13/15] rpath --- ubuntu-22.04-risc/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 56d830e..5913263 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -43,16 +43,13 @@ RUN curl https://pyenv.run | bash ARG PYTHON_CONFIGURE_OPTS="--enable-shared" -ARG LDFLAGS="-L/opt/sqlite3/lib -lsqlite3" +ARG LDFLAGS="-Wl,-rpath,/opt/sqlite3/lib -L/opt/sqlite3/lib -lsqlite3" ARG CPPFLAGS="-I/opt/sqlite3/include" RUN pyenv install 3.8 RUN pyenv install 3.9 RUN pyenv install 3.10 -# needed only for the 3.11+ builds -ENV LD_LIBRARY_PATH="/opt/sqlite3/lib" - RUN pyenv install 3.11 RUN pyenv install 3.12 From 696a2bb589e02ba186bc5ee54ddfd063c28a9082 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 16:10:55 -0400 Subject: [PATCH 14/15] check sqlite load path --- ubuntu-22.04-risc/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index 5913263..d4cd871 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -55,11 +55,12 @@ RUN pyenv install 3.12 RUN pyenv global 3.12 3.11 3.10 3.9 3.8 -RUN ldd $(python3.8 -c 'import _sqlite3; print(_sqlite3.__file__)') -RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') -RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') -RUN ldd $(python3.11 -c 'import _sqlite3; print(_sqlite3.__file__)') -RUN ldd $(python3.12 -c 'import _sqlite3; print(_sqlite3.__file__)') +# make sure sqlite is loaded from the expected path +RUN ldd $(python3.8 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/ +RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/ +RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/ +RUN ldd $(python3.11 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/ +RUN ldd $(python3.12 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/ ENV PATH="/root/.cargo/bin:${PATH}" ENV RUST_BACKTRACE=1 From fcff9a3020a7024c37d1063c378accd24f00077c Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 23 Jul 2024 20:25:31 -0400 Subject: [PATCH 15/15] Update Dockerfile --- ubuntu-22.04-risc/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/ubuntu-22.04-risc/Dockerfile b/ubuntu-22.04-risc/Dockerfile index d4cd871..2ab3f4d 100644 --- a/ubuntu-22.04-risc/Dockerfile +++ b/ubuntu-22.04-risc/Dockerfile @@ -42,14 +42,12 @@ ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" RUN curl https://pyenv.run | bash ARG PYTHON_CONFIGURE_OPTS="--enable-shared" - ARG LDFLAGS="-Wl,-rpath,/opt/sqlite3/lib -L/opt/sqlite3/lib -lsqlite3" ARG CPPFLAGS="-I/opt/sqlite3/include" RUN pyenv install 3.8 RUN pyenv install 3.9 RUN pyenv install 3.10 - RUN pyenv install 3.11 RUN pyenv install 3.12