Skip to content

Compilation Error while installing pybitvmbinding during Docker build #16

@Se0ng1

Description

@Se0ng1

The build fails when installing the pybitvmbinding library from a specific commit (32e970d...) using the following command specified in the Dockerfile.

RUN pip install --no-cache-dir git+https://github.com/ramonamela/pybitvmbinding.git@32e970dc3d4321453dae949c36308f816352ffa3

log

docker compose build --no-cache prover-backend
Compose now can delegate build to bake for better performances
Just set COMPOSE_BAKE=true
[+] Building 105.9s (13/25)                                                            docker:desktop-linux
 => [prover-backend internal] load build definition from Dockerfile                                    0.0s
 => => transferring dockerfile: 2.05kB                                                                 0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 41)                        0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 54)                        0.0s
 => [prover-backend internal] load metadata for docker.io/tiangolo/uvicorn-gunicorn:python3.10         1.6s
 => [prover-backend internal] load .dockerignore                                                       0.0s
 => => transferring context: 2B                                                                        0.0s
 => CACHED [prover-backend bitvmx-base  1/16] FROM docker.io/tiangolo/uvicorn-gunicorn:python3.10@sha  0.0s
 => [prover-backend internal] load build context                                                       0.0s
 => => transferring context: 11.29kB                                                                   0.0s
 => [prover-backend bitvmx-base  2/16] RUN apt-get update                                              1.9s
 => [prover-backend bitvmx-base  3/16] RUN apt-get install -y     build-essential     curl             0.7s
 => [prover-backend bitvmx-base  4/16] RUN curl https://sh.rustup.rs -sSf | sh -s -- -y               18.4s 
 => [prover-backend bitvmx-base  5/16] RUN pip install --upgrade pip                                   2.5s 
 => [prover-backend bitvmx-base  6/16] COPY requirements/base.txt /tmp/requirements/                   0.6s 
 => [prover-backend bitvmx-base  7/16] RUN pip install -r /tmp/requirements/base.txt                  14.1s 
 => [prover-backend bitvmx-base  8/16] RUN pip install --no-cache-dir git+https://github.com/ramoname  9.8s 
 => ERROR [prover-backend bitvmx-base  9/16] RUN pip install --no-cache-dir git+https://github.com/r  56.2s 
------                                                                                                      
 > [prover-backend bitvmx-base  9/16] RUN pip install --no-cache-dir git+https://github.com/ramonamela/pybitvmbinding.git@32e970dc3d4321453dae949c36308f816352ffa3:                                                     
0.520 Collecting git+https://github.com/ramonamela/pybitvmbinding.git@32e970dc3d4321453dae949c36308f816352ffa3                                                                                                          
0.521   Cloning https://github.com/ramonamela/pybitvmbinding.git (to revision 32e970dc3d4321453dae949c36308f816352ffa3) to /tmp/pip-req-build-m19hoio2
0.522   Running command git clone --filter=blob:none --quiet https://github.com/ramonamela/pybitvmbinding.git /tmp/pip-req-build-m19hoio2
1.832   Running command git rev-parse -q --verify 'sha^32e970dc3d4321453dae949c36308f816352ffa3'
1.833   Running command git fetch -q https://github.com/ramonamela/pybitvmbinding.git 32e970dc3d4321453dae949c36308f816352ffa3
2.340   Running command git checkout -q 32e970dc3d4321453dae949c36308f816352ffa3
2.851   Resolved https://github.com/ramonamela/pybitvmbinding.git to commit 32e970dc3d4321453dae949c36308f816352ffa3
2.862   Installing build dependencies: started
4.166   Installing build dependencies: finished with status 'done'
4.169   Getting requirements to build wheel: started
4.260   Getting requirements to build wheel: finished with status 'done'
4.261   Preparing metadata (pyproject.toml): started
23.95   Preparing metadata (pyproject.toml): finished with status 'done'
23.96 Building wheels for collected packages: pybitvmbinding
23.97   Building wheel for pybitvmbinding (pyproject.toml): started
55.12   Building wheel for pybitvmbinding (pyproject.toml): finished with status 'error'
55.20   error: subprocess-exited-with-error
55.20   
55.20   × Building wheel for pybitvmbinding (pyproject.toml) did not run successfully.
55.20   │ exit code: 1
55.20   ╰─> [279 lines of output]
55.20       Running `maturin pep517 build-wheel -i /usr/local/bin/python3.10 --compatibility off`
55.20       warning: patch for `ark-bn254` uses the features mechanism. default-features and features will not take effect because the patch dependency does not support this mechanism
55.20       🔗 Found pyo3 bindings
55.20       🐍 Found CPython 3.10 at /usr/local/bin/python3.10
55.20       📡 Using build options features from pyproject.toml
55.20       warning: patch for `ark-bn254` uses the features mechanism. default-features and features will not take effect because the patch dependency does not support this mechanism
55.20          Compiling unicode-ident v1.0.18
55.20          Compiling proc-macro2 v1.0.95
55.20          Compiling libc v0.2.174
55.20          Compiling cfg-if v1.0.1
55.20          Compiling autocfg v1.5.0
55.20          Compiling version_check v0.9.5
55.20          Compiling shlex v1.3.0
55.20          Compiling zerocopy v0.8.26
55.20          Compiling cc v1.2.30
55.20          Compiling once_cell v1.21.3
55.20          Compiling arrayvec v0.7.6
55.20          Compiling smallvec v1.15.1
55.20          Compiling typenum v1.18.0
55.20          Compiling generic-array v0.14.7
55.20          Compiling num-traits v0.2.19
55.20          Compiling serde v1.0.219
55.20          Compiling either v1.15.0
55.20          Compiling lazy_static v1.5.0
55.20          Compiling pin-project-lite v0.2.16
55.20          Compiling subtle v2.6.1
55.20          Compiling quote v1.0.40
55.20          Compiling getrandom v0.2.16
55.20          Compiling rand_core v0.6.4
55.20          Compiling syn v2.0.104
55.20          Compiling log v0.4.27
55.20          Compiling allocator-api2 v0.2.21
55.20          Compiling lock_api v0.4.13
55.20          Compiling bitcoin-internals v0.2.0 (https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda92)
55.20          Compiling parking_lot_core v0.9.11
55.20          Compiling hashbrown v0.15.4
55.20          Compiling crossbeam-utils v0.8.21
55.20          Compiling crypto-common v0.1.6
55.20          Compiling block-buffer v0.10.4
55.20          Compiling num-integer v0.1.46
55.20          Compiling digest v0.10.7
55.20          Compiling scopeguard v1.2.0
55.20          Compiling stable_deref_trait v1.2.0
55.20          Compiling num-bigint v0.4.6
55.20          Compiling secp256k1-sys v0.10.1
55.20          Compiling ppv-lite86 v0.2.21
55.20          Compiling signal-hook-registry v1.4.5
55.20          Compiling paste v1.0.15
55.20          Compiling crossbeam-epoch v0.9.18
55.20          Compiling parking_lot v0.12.4
55.20          Compiling rand_chacha v0.3.1
55.20          Compiling hex-conservative v0.2.1
55.20          Compiling rand v0.8.5
55.20          Compiling tracing-core v0.1.34
55.20          Compiling itoa v1.0.15
55.20          Compiling rayon-core v1.12.1
55.20          Compiling bitcoin-io v0.1.2 (https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda92)
55.20          Compiling target-lexicon v0.12.16
55.20          Compiling hex_lit v0.1.1
55.20          Compiling crossbeam-deque v0.8.6
55.20          Compiling itertools v0.13.0
55.20          Compiling ahash v0.8.12
55.20          Compiling wasm-bindgen-shared v0.2.100
55.20          Compiling pkg-config v0.3.32
55.20          Compiling equivalent v1.0.2
55.20          Compiling vcpkg v0.2.15
55.20          Compiling bytes v1.10.1
55.20          Compiling pyo3-build-config v0.20.3
55.20          Compiling rayon v1.10.0
55.20          Compiling openssl-sys v0.9.109
55.20          Compiling synstructure v0.13.2
55.20          Compiling indexmap v2.10.0
55.20          Compiling bitcoin_hashes v0.13.0 (https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda92)
55.20          Compiling rustversion v1.0.21
55.20          Compiling memchr v2.7.5
55.20          Compiling bumpalo v3.19.0
55.20          Compiling syn v1.0.109
55.20          Compiling wasm-bindgen-backend v0.2.100
55.20          Compiling mio v1.0.4
55.20          Compiling socket2 v0.5.10
55.20          Compiling litemap v0.8.0
55.20          Compiling serde_derive v1.0.219
55.20          Compiling zerofrom-derive v0.1.6
55.20          Compiling yoke-derive v0.8.0
55.20          Compiling zeroize_derive v1.4.2
55.20          Compiling enum-ordinalize-derive v4.3.1
55.20          Compiling zerovec-derive v0.11.1
55.20          Compiling displaydoc v0.2.5
55.20          Compiling tracing-attributes v0.1.30
55.20          Compiling zeroize v1.8.1
55.20          Compiling ark-std v0.5.0
55.20          Compiling enum-ordinalize v4.3.0
55.20          Compiling educe v0.6.0
55.20          Compiling ark-serialize-derive v0.5.0
55.20          Compiling zerofrom v0.1.6
55.20          Compiling tokio-macros v2.5.0
55.20          Compiling yoke v0.8.0
55.20          Compiling futures-core v0.3.31
55.20          Compiling writeable v0.6.1
55.20          Compiling zerovec v0.11.2
55.20          Compiling bitcoin-internals v0.3.0
55.20          Compiling ark-serialize v0.5.0
55.20          Compiling tokio v1.46.1
55.20          Compiling zerotrie v0.2.2
55.20          Compiling wasm-bindgen-macro-support v0.2.100
55.20          Compiling tracing v0.1.41
55.20          Compiling ark-ff-macros v0.5.0
55.20          Compiling tinystr v0.8.1
55.20          Compiling potential_utf v0.1.2
55.20          Compiling ark-ff-asm v0.5.0
55.20          Compiling icu_locale_core v2.0.0
55.20          Compiling serde_json v1.0.141
55.20          Compiling ryu v1.0.20
55.20          Compiling wasm-bindgen v0.2.100
55.20          Compiling icu_normalizer_data v2.0.0
55.20          Compiling icu_properties_data v2.0.1
55.20          Compiling ark-ff v0.5.0
55.20          Compiling icu_provider v2.0.0
55.20          Compiling wasm-bindgen-macro v0.2.100
55.20          Compiling icu_collections v2.0.0
55.20          Compiling colored v2.2.0
55.20          Compiling bitcoin-units v0.1.0 (https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda92)
55.20          Compiling bitcoin_hashes v0.14.0
55.20          Compiling proc-macro-error-attr v1.0.4
55.20          Compiling foreign-types-shared v0.1.1
55.20          Compiling bitcoin v0.32.6
55.20          Compiling futures-task v0.3.31
55.20          Compiling utf8parse v0.2.2
55.20          Compiling pin-utils v0.1.0
55.20          Compiling overload v0.1.1
55.20          Compiling openssl v0.10.73
55.20          Compiling bech32 v0.11.0
55.20          Compiling fnv v1.0.7
55.20          Compiling http v0.2.12
55.20          Compiling base58ck v0.1.0
55.20          Compiling nu-ansi-term v0.46.0
55.20          Compiling futures-util v0.3.31
55.20          Compiling anstyle-parse v0.2.7
55.20          Compiling foreign-types v0.3.2
55.20          Compiling ark-std v0.4.0
55.20          Compiling ark-serialize-derive v0.4.2 (https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde2)
55.20          Compiling openssl-macros v0.1.1
55.20          Compiling tracing-log v0.2.0
55.20          Compiling cpufeatures v0.2.17
55.20          Compiling sharded-slab v0.1.7
55.20          Compiling ark-poly v0.5.0
55.20          Compiling proc-macro-error v1.0.4
55.20          Compiling secp256k1 v0.29.1
55.20          Compiling thread_local v1.1.9
55.20          Compiling bitflags v2.9.1
55.20          Compiling signal-hook v0.3.18
55.20          Compiling heck v0.5.0
55.20          Compiling anstyle v1.0.11
55.20          Compiling native-tls v0.2.14
55.20          Compiling anstyle-query v1.1.3
55.20          Compiling colorchoice v1.0.4
55.20          Compiling httparse v1.10.1
55.20          Compiling is_terminal_polyfill v1.70.1
55.20          Compiling futures-sink v0.3.31
55.20          Compiling anstream v0.6.19
55.20          Compiling tokio-util v0.7.15
55.20          Compiling tracing-subscriber v0.3.19
55.20       error[E0425]: cannot find function `hex_u128` in module `parse`
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/pow.rs:515:30
55.20           |
55.20       515 |             let low = parse::hex_u128(s)?;
55.20           |                              ^^^^^^^^ help: a function with a similar name exists: `hex_u32`
55.20           |
55.20          ::: /root/.cargo/git/checkouts/rust-bitcoin-6f6753463a966952/48efda9/units/src/parse.rs:108:1
55.20           |
55.20       108 | pub fn hex_u32<S: AsRef<str> + Into<String>>(s: S) -> Result<u32, ParseIntError> {
55.20           | -------------------------------------------------------------------------------- similarly named function `hex_u32` defined here
55.20       
55.20       error[E0425]: cannot find function `hex_u128` in module `parse`
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/pow.rs:522:31
55.20           |
55.20       522 |             let high = parse::hex_u128(high_s)?;
55.20           |                               ^^^^^^^^ help: a function with a similar name exists: `hex_u32`
55.20           |
55.20          ::: /root/.cargo/git/checkouts/rust-bitcoin-6f6753463a966952/48efda9/units/src/parse.rs:108:1
55.20           |
55.20       108 | pub fn hex_u32<S: AsRef<str> + Into<String>>(s: S) -> Result<u32, ParseIntError> {
55.20           | -------------------------------------------------------------------------------- similarly named function `hex_u32` defined here
55.20       
55.20       error[E0425]: cannot find function `hex_u128` in module `parse`
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/pow.rs:523:30
55.20           |
55.20       523 |             let low = parse::hex_u128(low_s)?;
55.20           |                              ^^^^^^^^ help: a function with a similar name exists: `hex_u32`
55.20           |
55.20          ::: /root/.cargo/git/checkouts/rust-bitcoin-6f6753463a966952/48efda9/units/src/parse.rs:108:1
55.20           |
55.20       108 | pub fn hex_u32<S: AsRef<str> + Into<String>>(s: S) -> Result<u32, ParseIntError> {
55.20           | -------------------------------------------------------------------------------- similarly named function `hex_u32` defined here
55.20       
55.20          Compiling ark-serialize v0.4.2 (https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde2)
55.20          Compiling icu_normalizer v2.0.0
55.20          Compiling icu_properties v2.0.1
55.20       error[E0599]: no method named `to_consensus_u32` found for reference `&bitcoin_units::locktime::relative::Height` in the current scope
55.20         --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/blockdata/locktime/relative.rs:88:42
55.20          |
55.20       88 |             LockTime::Blocks(ref h) => h.to_consensus_u32(),
55.20          |                                          ^^^^^^^^^^^^^^^^ method not found in `&Height`
55.20       
55.20       error[E0599]: no method named `to_consensus_u32` found for reference `&bitcoin_units::locktime::relative::Time` in the current scope
55.20         --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/blockdata/locktime/relative.rs:89:40
55.20          |
55.20       89 |             LockTime::Time(ref t) => t.to_consensus_u32(),
55.20          |                                        ^^^^^^^^^^^^^^^^ method not found in `&Time`
55.20       
55.20       error[E0599]: no function or associated item named `from_height` found for struct `bitcoin_units::locktime::relative::Height` in the current scope
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/blockdata/locktime/relative.rs:108:73
55.20           |
55.20       108 |     pub const fn from_height(n: u16) -> Self { LockTime::Blocks(Height::from_height(n)) }
55.20           |                                                                         ^^^^^^^^^^^ function or associated item not found in `Height`
55.20       
55.20       error[E0599]: no function or associated item named `from_seconds_floor` found for struct `bitcoin_units::locktime::relative::Time` in the current scope
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/blockdata/locktime/relative.rs:127:21
55.20           |
55.20       127 |         match Time::from_seconds_floor(seconds) {
55.20           |                     ^^^^^^^^^^^^^^^^^^ function or associated item not found in `Time`
55.20           |
55.20       note: if you're trying to build a new `bitcoin_units::locktime::relative::Time` consider using one of the following associated functions:
55.20             bitcoin_units::locktime::relative::Time::from_512_second_intervals
55.20             bitcoin_units::locktime::relative::Time::from_seconds_ceil
55.20          --> /root/.cargo/git/checkouts/rust-bitcoin-6f6753463a966952/48efda9/units/src/locktime/relative.rs:62:5
55.20           |
55.20       62  |     pub fn from_512_second_intervals(intervals: u16) -> Self { Time(intervals) }
55.20           |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55.20       ...
55.20       71  |     pub fn from_seconds_ceil(seconds: u32) -> Result<Self, TimeOverflowError> {
55.20           |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55.20       help: there is an associated function `from_seconds_ceil` with a similar name
55.20           |
55.20       127 -         match Time::from_seconds_floor(seconds) {
55.20       127 +         match Time::from_seconds_ceil(seconds) {
55.20           |
55.20       
55.20          Compiling ark-ff-asm v0.4.2 (https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde2)
55.20          Compiling ark-ff-macros v0.4.2 (https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde2)
55.20          Compiling foldhash v0.1.5
55.20          Compiling openssl-probe v0.1.6
55.20          Compiling clap_lex v0.7.5
55.20          Compiling slab v0.4.10
55.20          Compiling percent-encoding v2.3.1
55.20          Compiling try-lock v0.2.5
55.20          Compiling strsim v0.11.1
55.20          Compiling thiserror v1.0.69
55.20          Compiling ark-ff v0.4.2 (https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde2)
55.20       error[E0015]: cannot call non-const associated function `bitcoin_units::locktime::relative::Time::from_512_second_intervals` in constant functions
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/blockdata/locktime/relative.rs:116:24
55.20           |
55.20       116 |         LockTime::Time(Time::from_512_second_intervals(intervals))
55.20           |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55.20           |
55.20           = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
55.20       
55.20       error[E0015]: cannot call non-const associated function `bitcoin_units::locktime::relative::Time::from_seconds_ceil` in constant functions
55.20          --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.6/src/blockdata/locktime/relative.rs:141:15
55.20           |
55.20       141 |         match Time::from_seconds_ceil(seconds) {
55.20           |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55.20           |
55.20           = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
55.20       
55.20          Compiling clap_builder v4.5.41
55.20          Compiling form_urlencoded v1.2.1
55.20          Compiling want v0.3.1
55.20          Compiling h2 v0.3.27
55.20          Compiling ark-relations v0.5.1 (https://github.com/arkworks-rs/snark/#4c740f7e)
55.20       Some errors have detailed explanations: E0015, E0425, E0599.
55.20       For more information about an error, try `rustc --explain E0015`.
55.20       error: could not compile `bitcoin` (lib) due to 9 previous errors
55.20       warning: build failed, waiting for other jobs to finish...
55.20       error: could not compile `bitcoin` (lib) due to 9 previous errors
55.20       💥 maturin failed
55.20         Caused by: Failed to build a native library through cargo
55.20         Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.10-64bit" PYO3_PYTHON="/usr/local/bin/python3.10" PYTHON_SYS_EXECUTABLE="/usr/local/bin/python3.10" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-req-build-m19hoio2/Cargo.toml" "--release" "--lib"`
55.20       Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/local/bin/python3.10', '--compatibility', 'off'] returned non-zero exit status 1
55.20       [end of output]
55.20   
55.20   note: This error originates from a subprocess, and is likely not a problem with pip.
55.20   ERROR: Failed building wheel for pybitvmbinding
55.20 Failed to build pybitvmbinding
55.31 ERROR: Failed to build installable wheels for some pyproject.toml based projects (pybitvmbinding)
------
failed to solve: process "/bin/sh -c pip install --no-cache-dir git+https://github.com/ramonamela/pybitvmbinding.git@32e970dc3d4321453dae949c36308f816352ffa3" did not complete successfully: exit code: 1

Based on the error logs, it seems the bitcoin crate (v0.32.6) is incompatible with the API of its dependency, the bitcoin_units crate. Errors like "cannot find function hex_u128" and "no method named to_consensus_u32" occur repeatedly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions