From 23b4d99999bf5437638aecb54752fd675594ea46 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 2 Sep 2025 02:43:00 -0700 Subject: [PATCH] docker: Dockerfile fixes after poetry to uv migration Cargo utilizes `git ls-remote` to resolve git dependencies specified by commit hashes. GitHub only advertises commits that are reachable from branches, tags, or PR references. The `bip353-plugin` was referencing an orphaned commit in the `bitcoin-payment-instructions` dependency that was unreachable through any advertised reference. This can be resolved by installing the tarball release v0.5.0. Changelog-None. --- Cargo.lock | 5 +++-- Dockerfile | 16 ++++++++-------- plugins/bip353-plugin/Cargo.toml | 4 +--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6582b976f554..75f85c53a514 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -363,8 +363,9 @@ checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" [[package]] name = "bitcoin-payment-instructions" -version = "0.4.0" -source = "git+https://github.com/rust-bitcoin/bitcoin-payment-instructions.git?rev=d071ce27734ca13be2471f81abf8699d902c3a10#d071ce27734ca13be2471f81abf8699d902c3a10" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f00d509810205bfef492f1d6cefe1e2ac35b5e66675d51642315ddc5cee0e78" dependencies = [ "bitcoin 0.32.6", "dnssec-prover", diff --git a/Dockerfile b/Dockerfile index e80f3b8eb109..dc2c4d107221 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,8 +90,6 @@ RUN apt-get update -qq && \ ENV PATH="/root/.local/bin:$PATH" \ PYTHON_VERSION=3 -RUN wget -qO- https://astral.sh/uv/install.sh | sh && \ - && uv sync --all-extras --all-groups RUN wget -q https://zlib.net/fossils/zlib-1.2.13.tar.gz -O zlib.tar.gz && \ wget -q https://www.sqlite.org/2019/sqlite-src-3290000.zip -O sqlite.zip && \ @@ -102,7 +100,9 @@ COPY . /tmp/lightning RUN git clone --recursive /tmp/lightning . && \ git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD) -# Do not build python plugins here, python doesn't support cross compilation. +RUN wget -qO- https://astral.sh/uv/install.sh | sh && \ + uv sync --all-extras --all-groups + WORKDIR / FROM base-builder AS base-builder-linux-amd64 @@ -202,6 +202,10 @@ RUN mkdir /var/libpq && cp -a "$(${PG_CONFIG} --libdir)"/libpq.* /var/libpq ENV RUST_PROFILE=release \ PATH="/root/.cargo/bin:/root/.local/bin:$PATH" +ENV UV_CACHE_DIR=/tmp/uv-cache +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV CARGO_NET_GIT_FETCH_WITH_CLI_ALWAYS=true + RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ${RUSTUP_INSTALL_OPTS} RUN rustup toolchain install stable --component rustfmt --allow-downgrade @@ -218,14 +222,11 @@ RUN ( ! [ "${target_host}" = "arm-linux-gnueabihf" ] ) || \ # Ensure that git differences are removed before making bineries, to avoid `-modded` suffix RUN git reset --hard HEAD - RUN ./configure --prefix=/tmp/lightning_install --enable-static && uv run make install WORKDIR /opt/lightningd RUN echo 'RUSTUP_INSTALL_OPTS="${RUSTUP_INSTALL_OPTS}"' > /tmp/rustup_install_opts.txt -# Copy rustup_install_opts.txt file from builder -COPY --from=builder /tmp/rustup_install_opts.txt /tmp/rustup_install_opts.txt # Setup ENV $RUSTUP_INSTALL_OPTS for this stage RUN export $(cat /tmp/rustup_install_opts.txt) ENV PATH="/root/.cargo/bin:/root/.venvs/cln/bin:$PATH" @@ -241,7 +242,7 @@ RUN apt-get update && \ socat \ inotify-tools \ jq \ - python3 \ + python3 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -262,7 +263,6 @@ RUN --mount=type=bind,from=builder,source=/var/libpq,target=/var/libpq,rw \ ldconfig COPY --from=builder /tmp/lightning_install/ /usr/local/ -COPY --from=builder-python /root/.venvs/cln/lib/python3.11/site-packages /usr/local/lib/python3.11/dist-packages/ COPY --from=downloader /opt/bitcoin/bin /usr/bin COPY --from=downloader /opt/litecoin/bin /usr/bin COPY tools/docker-entrypoint.sh entrypoint.sh diff --git a/plugins/bip353-plugin/Cargo.toml b/plugins/bip353-plugin/Cargo.toml index b1b877feb3ed..7d60e2b7da16 100644 --- a/plugins/bip353-plugin/Cargo.toml +++ b/plugins/bip353-plugin/Cargo.toml @@ -19,9 +19,7 @@ log-panics = "2" cln-plugin = { version = "0.5", path = "../../plugins" } -bitcoin-payment-instructions = { git = "https://github.com/rust-bitcoin/bitcoin-payment-instructions.git", rev = "d071ce27734ca13be2471f81abf8699d902c3a10", features = [ - "http", -] } +bitcoin-payment-instructions = { version = "0.5.0", features = ["http"] } reqwest = { version = "0.11", default-features = false, features = [ "rustls-tls",