Chia-Network/clvm_rs

Fails to build on Alpine Linux with "don't know how to configure OpenSSL for x86_64-alpine-linux-musl"

bolausson opened this issue ยท 10 comments

I tried to install chia on Alpine Linux (3.14.2-x86_64) but it ultimately fails for me installing clvm_rs:

farmer $ git clone https://github.com/Chia-Network/chia-blockchain.git -b latest
Cloning into 'chia-blockchain'...
remote: Enumerating objects: 52845, done.
remote: Counting objects: 100% (3188/3188), done.
remote: Compressing objects: 100% (1437/1437), done.
remote: Total 52845 (delta 2251), reused 2479 (delta 1735), pack-reused 49657
Receiving objects: 100% (52845/52845), 23.69 MiB | 20.96 MiB/s, done.
Resolving deltas: 100% (40594/40594), done.
[~/chia-blockchain]
farmer $ sh install.sh
apt-get: not found
Submodule 'mozilla-ca' (https://github.com/Chia-Network/mozilla-ca.git) registered for path 'mozilla-ca'
Cloning into '/home/farmer/chia-blockchain/mozilla-ca'...
Submodule path 'mozilla-ca': checked out 'b1b808ab930004fc6b4afc4b248dee0a136f3f00'
pacman: not found
yum: not found
yum: not found
Python version is 3.9
Requirement already satisfied: pip in ./venv/lib/python3.9/site-packages (21.1.1)
Collecting pip
  Using cached pip-21.2.4-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.1
    Uninstalling pip-21.1.1:
      Successfully uninstalled pip-21.1.1
Successfully installed pip-21.2.4
Collecting wheel
  Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.0
Looking in indexes: https://pypi.org/simple, https://pypi.chia.net/simple/
Collecting miniupnpc==2.2.2
  Using cached miniupnpc-2.2.2-cp39-cp39-linux_x86_64.whl
Installing collected packages: miniupnpc
Successfully installed miniupnpc-2.2.2
Looking in indexes: https://pypi.org/simple, https://pypi.chia.net/simple/
Obtaining file:///home/farmer/chia-blockchain
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting keyrings.cryptfile==1.3.4
  Using cached keyrings.cryptfile-1.3.4.tar.gz (17 kB)
Collecting keyring==23.0.1
  Using cached keyring-23.0.1-py3-none-any.whl (33 kB)
Collecting bitstring==3.1.9
  Using cached bitstring-3.1.9-py3-none-any.whl (38 kB)
Collecting colorlog==5.0.1
  Using cached colorlog-5.0.1-py2.py3-none-any.whl (10 kB)
Collecting sortedcontainers==2.3.0
  Using cached sortedcontainers-2.3.0-py2.py3-none-any.whl (29 kB)
Collecting clvm-tools==0.4.3
  Using cached clvm_tools-0.4.3-py3-none-any.whl (36 kB)
Collecting cryptography==3.4.7
  Using cached cryptography-3.4.7.tar.gz (546 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting aiohttp==3.7.4
  Using cached aiohttp-3.7.4.tar.gz (1.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting blspy==1.0.6
  Using cached blspy-1.0.6.tar.gz (284 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting click==7.1.2
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting setproctitle==1.2.2
  Using cached setproctitle-1.2.2.tar.gz (23 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting watchdog==2.1.3
  Using cached watchdog-2.1.3.tar.gz (109 kB)
Collecting chiabip158==1.0
  Using cached chiabip158-1.0.tar.gz (117 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting aiosqlite==0.17.0
  Using cached aiosqlite-0.17.0-py3-none-any.whl (15 kB)
Collecting fasteners==0.16.3
  Using cached fasteners-0.16.3-py2.py3-none-any.whl (28 kB)
Collecting PyYAML==5.4.1
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting chiapos==1.0.4
  Using cached chiapos-1.0.4.tar.gz (1.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting websockets==8.1.0
  Using cached websockets-8.1.tar.gz (58 kB)
Collecting dnspython==2.1.0
  Using cached dnspython-2.1.0-py3-none-any.whl (241 kB)
Collecting clvm==0.9.7
  Using cached clvm-0.9.7-py3-none-any.whl (19 kB)
Collecting colorama==0.4.4
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
ERROR: Could not find a version that satisfies the requirement clvm-rs==0.1.11 (from chia-blockchain) (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.4, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10)
ERROR: No matching distribution found for clvm-rs==0.1.11

So I tried to manually install clvm_rs into the venv:

(venv) [~]
farmer $ git clone https://github.com/Chia-Network/clvm_rs.git -b 0.1.11
Cloning into 'clvm_rs'...
remote: Enumerating objects: 3087, done.
remote: Counting objects: 100% (1173/1173), done.
remote: Compressing objects: 100% (504/504), done.
remote: Total 3087 (delta 805), reused 925 (delta 652), pack-reused 1914
Receiving objects: 100% (3087/3087), 4.31 MiB | 8.30 MiB/s, done.
Resolving deltas: 100% (2101/2101), done.
Note: switching to 'e6985832959aa91ef16496090ee77232e30f39de'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false
(venv) [~/clvm_rs]
farmer $ maturin develop --release

๐Ÿ”— Found pyo3 bindings
๐Ÿ Found CPython 3.9 at python
๐Ÿ“ก Using build options bindings from pyproject.toml
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.28
   Compiling unicode-xid v0.2.2
   Compiling libc v0.2.99
   Compiling proc-macro-hack v0.5.19
   Compiling pyo3-build-config v0.14.2
   Compiling syn v1.0.74
   Compiling radium v0.6.2
   Compiling cc v1.0.69
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.8.0
   Compiling tap v1.0.1
   Compiling typenum v1.13.0
   Compiling version_check v0.9.3
   Compiling pkg-config v0.3.19
   Compiling funty v1.2.0
   Compiling subtle v2.4.1
   Compiling rand_core v0.6.3
   Compiling smallvec v1.6.1
   Compiling scopeguard v1.1.0
   Compiling unindent v0.1.7
   Compiling byteorder v1.4.3
   Compiling openssl v0.10.35
   Compiling foreign-types-shared v0.1.1
   Compiling opaque-debug v0.3.0
   Compiling bitflags v1.3.1
   Compiling cpufeatures v0.1.5
   Compiling hex v0.4.3
   Compiling lazy_static v1.4.0
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling num-bigint v0.4.0
   Compiling instant v0.1.10
   Compiling wyz v0.4.0
   Compiling openssl-src v111.15.0+1.1.1k
   Compiling generic-array v0.14.4
   Compiling lock_api v0.4.4
   Compiling foreign-types v0.3.2
   Compiling openssl-sys v0.9.65
   Compiling quote v1.0.9
   Compiling bitvec v0.22.3
   Compiling parking_lot_core v0.8.3
   Compiling paste-impl v0.1.18
error: failed to run custom build command for `openssl-sys v0.9.65`

Caused by:
  process didn't exit successfully: `/home/farmer/clvm_rs/target/release/build/openssl-sys-19a12d6e2bc14fbe/build-script-main` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=X86_64_ALPINE_LINUX_MUSL_OPENSSL_NO_VENDOR
  X86_64_ALPINE_LINUX_MUSL_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset

  --- stderr
  thread 'main' panicked at 'don't know how to configure OpenSSL for x86_64-alpine-linux-musl', /home/farmer/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-src-111.15.0+1.1.1k/src/lib.rs:275:18
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
๐Ÿ’ฅ maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --release --lib --`
(venv) 19:03:02 [~/clvm_rs]
farmer $

Any suggestions?

Cheers,
Bjoern

'This issue has been flagged as stale as there has been no activity on it in 14 days. If this issue is still affecting you and in need of review, please update it to keep it open.'

Nobody?

'This issue has been flagged as stale as there has been no activity on it in 14 days. If this issue is still affecting you and in need of review, please update it to keep it open.'

'This issue was automatically closed because it has been flagged as stale and subsequently passed 7 days with no further activity.'

If you're still having problems building chia on Alpine Linux, maybe the following will help.

I've been having the same issue with recent 1.2.11 chia release. I tried the same, building clvm_rs from source with no luck and similar SSL error. Eventually I realised that Perl is a dependency of the build process. Also, by the way, I'm not sure if this made a difference but I also used rustup rather than the prebuilt rust and cargo from the Alpine repos, then ran rustup-init as my regular user.

Once Perl is installed (doas apk add perl), building chia-blockchain using sh ./install.sh "just worked" without the need to build clvm_rs separately. Hope that works for you!

Thanks!

I will give it a try!

You're welcome! Though I made a slight error - forgive me, I've been up all night migrating my chia harvesters from 2x Raspberry Pis to a Lenovo Thinkcentre micro PC running FreeBSD + bhyve + Alpine VM :)

I did the following (roughly following Debian and OpenBSD instructions in the chia git wiki) :

  1. doas apk add rustup maturin perl openssl-dev
  2. rustup-init (install rust and cargo)
  3. git clone chia-blockchain
  4. cd chia-blockchain; sh ./install.sh (it will fail when trying to build clvm_rs because pip can't find 0.1.15 wheel or something)
  5. python3 -m venv venv; . ./venv/bin/activate (still in chia-blockchain directory)
  6. cd ../ ; git clone clvm_rs
  7. cd clvm_rs; git checkout 0.1.15; maturin develop --release (this should build fine now that Perl is installed)
  8. pip install .
  9. cd ../chia-blockchain; sh ./install.sh (again)

build should complete.

Let me know if you're still stuck - I've managed to get chia to work on my Alpine X86_64 VM.

Indeed, I was now able to at least build clvm_rs and install it, but chia still fails to find it:

ERROR: Could not find a version that satisfies the requirement clvm-rs==0.1.15 (from chia-blockchain) (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.4, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.14, 0.1.20)
ERROR: No matching distribution found for clvm-rs==0.1.15

My procedure below - it didn't make any difference in which directories I build it etc:
(only showing the output where relevant)

bo@alpinflax $ doas apk add rustup maturin perl openssl-dev python3 python3-dev libffi-dev git build-base
bo@alpinflax $ python3 -m venv venv
bo@alpinflax $ . ./venv/bin/activate
(venv)
bo@alpinflax $ python3 -m pip install --upgrade pip
(venv)
bo@alpinflax $ rustup-init
(venv)
bo@alpinflax $ source ${HOME}/.cargo/env
(venv)
bo@alpinflax $ git clone https://github.com/Chia-Network/clvm_rs.git
(venv)
bo@alpinflax $ cd clvm_rs
(venv)
bo@alpinflax $ git checkout 0.1.15
(venv)
bo@alpinflax $ maturin develop --release
(venv)
bo@alpinflax $ python3 -m pip install .
(venv)
bo@alpinflax $ python3 -m pip list
Package    Version
---------- -------
clvm_rs    0.1.15
pip        22.0.3
setuptools 57.4.0
(venv)
bo@alpinflax $ git clone https://github.com/Chia-Network/chia-blockchain.git
(venv)
bo@alpinflax $ 
cd chia-blockchain
(venv)
bo@alpinflax $ git checkout 1.2.11
(venv)
bo@alpinflax $ chmod +x install.sh 
(venv)
bo@alpinflax $ ./install.sh 
./install.sh: line 7: type: apt-get: not found
Submodule 'mozilla-ca' (https://github.com/Chia-Network/mozilla-ca.git) registered for path 'mozilla-ca'
Cloning into '/home/bolausson/chia-blockchain/mozilla-ca'...
Submodule path 'mozilla-ca': checked out 'b1b808ab930004fc6b4afc4b248dee0a136f3f00'
./install.sh: line 60: type: pacman: not found
./install.sh: line 64: type: yum: not found
./install.sh: line 68: type: yum: not found
Python version is 3.9
Requirement already satisfied: pip in ./venv/lib/python3.9/site-packages (21.2.3)
Collecting pip
  Using cached pip-22.0.3-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.2.3
    Uninstalling pip-21.2.3:
      Successfully uninstalled pip-21.2.3
Successfully installed pip-22.0.3
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.1
Looking in indexes: https://pypi.org/simple, https://pypi.chia.net/simple/
warning: missing-index-doctype

ร— The package index page being used does not have a proper HTML doctype declaration.
โ•ฐโ”€> Problematic URL: https://pypi.chia.net/simple/miniupnpc/

note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
Collecting miniupnpc==2.2.2
  Using cached miniupnpc-2.2.2-cp39-cp39-linux_x86_64.whl
Installing collected packages: miniupnpc
Successfully installed miniupnpc-2.2.2
Looking in indexes: https://pypi.org/simple, https://pypi.chia.net/simple/
Obtaining file:///home/bolausson/chia-blockchain
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting keyrings.cryptfile==1.3.4
  Using cached keyrings.cryptfile-1.3.4.tar.gz (17 kB)
  Preparing metadata (setup.py) ... done
warning: missing-index-doctype

ร— The package index page being used does not have a proper HTML doctype declaration.
โ•ฐโ”€> Problematic URL: https://pypi.chia.net/simple/chiabip158/

note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
Collecting chiabip158==1.0
  Using cached chiabip158-1.0.tar.gz (117 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting watchdog==2.1.6
  Using cached watchdog-2.1.6.tar.gz (107 kB)
  Preparing metadata (setup.py) ... done
Collecting clvm==0.9.7
  Using cached clvm-0.9.7-py3-none-any.whl (19 kB)
Collecting keyring==23.0.1
  Using cached keyring-23.0.1-py3-none-any.whl (33 kB)
Collecting PyYAML==5.4.1
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
warning: missing-index-doctype

ร— The package index page being used does not have a proper HTML doctype declaration.
โ•ฐโ”€> Problematic URL: https://pypi.chia.net/simple/chiavdf/

note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
Collecting chiavdf==1.0.3
  Using cached chiavdf-1.0.3.tar.gz (635 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting dnspythonchia==2.2.0
  Using cached dnspythonchia-2.2.0-py3-none-any.whl (260 kB)
Collecting fasteners==0.16.3
  Using cached fasteners-0.16.3-py2.py3-none-any.whl (28 kB)
warning: missing-index-doctype

ร— The package index page being used does not have a proper HTML doctype declaration.
โ•ฐโ”€> Problematic URL: https://pypi.chia.net/simple/setproctitle/

note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
Collecting setproctitle==1.2.2
  Using cached setproctitle-1.2.2.tar.gz (23 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
warning: missing-index-doctype

ร— The package index page being used does not have a proper HTML doctype declaration.
โ•ฐโ”€> Problematic URL: https://pypi.chia.net/simple/clvm-rs/

note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See https://github.com/pypa/pip/issues/10825 for context.
ERROR: Could not find a version that satisfies the requirement clvm-rs==0.1.15 (from chia-blockchain) (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.4, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.14, 0.1.20)
ERROR: No matching distribution found for clvm-rs==0.1.15
(venv)
bo@alpinflax $

To compile chia 1.3.0 released ~18 hours ago, I didn't need to compile clvm_rs separately like before however, I did have to change a few things:

  1. cd chia-blockchain
  2. git pull
  3. doas apk add asio-dev
  4. Edit setup.py changing the respective clvm_rs line from "clvm_rs==0.1.19", to "clvm_rs==0.1.20",
  5. sh ./install.sh as normal (you might need to run bash first, then activate the python environment before building)