Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.82k stars 2.03k forks source link

[Bug] 1.8.0 Fails to build on Alpine Linux v3.18 - compiler error #15318

Closed cybern0id closed 1 year ago

cybern0id commented 1 year ago

What happened?

Not sure whether this is a fault of the chia build time flags, a compiler bug or Alpine Linux' default compiler behaviour.

A similar error reported for pybind: https://github.com/pybind/pybind11/issues/1650 and one suggestion is disabling LTO or lowering compiler optimisation level.

Another discussion about a similar bug on the Alpine gitlab tracker: https://gitlab.alpinelinux.org/alpine/aports/-/issues/8626 suggests that because Alpine Linux uses "... -D_FORTIFY_SOURCE=2, a compile flag which Alpine uses by default for security reasons.", the failure is due to the code being compiled isn't compatible with this flag.

I'm not sure how to add that flag to my build environment or where in the chia code to do so and if I do, what the implications are in terms of security.

:~$ g++ --version
g++ (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chia-node:~/sources/chia-blockchain$ gcc --version
gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chia-node:~/sources/chia-blockchain$ cmake --version
cmake version 3.26.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Version

1.8.0

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

:~$ sh ./install.sh
Searching available python executables...
Python version is 3.11
SQLite version for Python is 3.41.2
OpenSSL version for Python is OpenSSL 3.1.0 14 Mar 2023
Requirement already satisfied: pip in ./venv/lib/python3.11/site-packages (22.3.1)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed pip-23.1.2
Collecting wheel
  Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
Installing collected packages: wheel
Successfully installed wheel-0.40.0
Looking in indexes: https://pypi.org/simple, https://pypi.chia.net/simple/
Collecting miniupnpc==2.2.2
  Using cached https://download.chia.net/simple/miniupnpc/miniupnpc-2.2.2.tar.gz (73 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: miniupnpc
  Building wheel for miniupnpc (pyproject.toml) ... done
  Created wheel for miniupnpc: filename=miniupnpc-2.2.2-cp311-cp311-linux_x86_64.whl size=49466 sha256=3ac5954f4ef7245e26c42671bcd13a30ab29109e991dac4e60674322ffad801a
  Stored in directory: /home/user/.cache/pip/wheels/81/18/94/3e70a2e7f0aba9b5d92cb8cc88563f86b17a38517979cfc179
Successfully built miniupnpc
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/user/sources/chia-blockchain
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting aiofiles==23.1.0 (from chia-blockchain==1.8.0)
  Using cached aiofiles-23.1.0-py3-none-any.whl (14 kB)
Collecting anyio==3.6.2 (from chia-blockchain==1.8.0)
  Using cached anyio-3.6.2-py3-none-any.whl (80 kB)
Collecting boto3==1.26.111 (from chia-blockchain==1.8.0)
  Using cached boto3-1.26.111-py3-none-any.whl (135 kB)
Collecting blspy==1.0.16 (from chia-blockchain==1.8.0)
  Using cached blspy-1.0.16.tar.gz (163 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting chiavdf==1.0.8 (from chia-blockchain==1.8.0)
  Using cached chiavdf-1.0.8.tar.gz (639 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting chiabip158==1.2 (from chia-blockchain==1.8.0)
  Using cached chiabip158-1.2.tar.gz (117 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting chiapos==1.0.11 (from chia-blockchain==1.8.0)
  Using cached chiapos-1.0.11.tar.gz (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting clvm==0.9.7 (from chia-blockchain==1.8.0)
  Using cached clvm-0.9.7-py3-none-any.whl (19 kB)
Collecting clvm-tools==0.4.6 (from chia-blockchain==1.8.0)
  Using cached clvm_tools-0.4.6-py3-none-any.whl (35 kB)
Collecting chia-rs==0.2.7 (from chia-blockchain==1.8.0)
  Using cached chia_rs-0.2.7.tar.gz (225 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting clvm-tools-rs==0.1.30 (from chia-blockchain==1.8.0)
  Using cached clvm_tools_rs-0.1.30-cp37-abi3-musllinux_1_1_x86_64.whl (954 kB)
Collecting aiohttp==3.8.4 (from chia-blockchain==1.8.0)
  Downloading aiohttp-3.8.4-cp311-cp311-musllinux_1_1_x86_64.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 4.1 MB/s eta 0:00:00
Collecting aiosqlite==0.17.0 (from chia-blockchain==1.8.0)
  Using cached aiosqlite-0.17.0-py3-none-any.whl (15 kB)
Collecting bitstring==4.0.1 (from chia-blockchain==1.8.0)
  Using cached bitstring-4.0.1-py3-none-any.whl (45 kB)
Collecting colorama==0.4.6 (from chia-blockchain==1.8.0)
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting colorlog==6.7.0 (from chia-blockchain==1.8.0)
  Using cached colorlog-6.7.0-py2.py3-none-any.whl (11 kB)
Collecting concurrent-log-handler==0.9.20 (from chia-blockchain==1.8.0)
  Using cached concurrent_log_handler-0.9.20-py2.py3-none-any.whl (20 kB)
Collecting cryptography==39.0.1 (from chia-blockchain==1.8.0)
  Using cached cryptography-39.0.1-cp36-abi3-musllinux_1_1_x86_64.whl (4.3 MB)
Collecting filelock==3.9.0 (from chia-blockchain==1.8.0)
  Using cached filelock-3.9.0-py3-none-any.whl (9.7 kB)
Collecting keyring==23.13.1 (from chia-blockchain==1.8.0)
  Using cached keyring-23.13.1-py3-none-any.whl (37 kB)
Collecting PyYAML==6.0 (from chia-blockchain==1.8.0)
  Using cached PyYAML-6.0.tar.gz (124 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting setproctitle==1.3.2 (from chia-blockchain==1.8.0)
  Downloading setproctitle-1.3.2-cp311-cp311-musllinux_1_1_x86_64.whl (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.1/41.1 kB 3.1 MB/s eta 0:00:00
Collecting sortedcontainers==2.4.0 (from chia-blockchain==1.8.0)
  Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting click==8.1.3 (from chia-blockchain==1.8.0)
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting dnspython==2.3.0 (from chia-blockchain==1.8.0)
  Using cached dnspython-2.3.0-py3-none-any.whl (283 kB)
Collecting watchdog==2.2.0 (from chia-blockchain==1.8.0)
  Using cached watchdog-2.2.0.tar.gz (119 kB)
  Preparing metadata (setup.py) ... done
Collecting dnslib==0.9.23 (from chia-blockchain==1.8.0)
  Using cached dnslib-0.9.23-py3-none-any.whl (60 kB)
Collecting typing-extensions==4.5.0 (from chia-blockchain==1.8.0)
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting zstd==1.5.4.0 (from chia-blockchain==1.8.0)
  Downloading zstd-1.5.4.0-cp311-cp311-musllinux_1_1_x86_64.whl (1.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.9/1.9 MB 5.9 MB/s eta 0:00:00
Collecting packaging==23.0 (from chia-blockchain==1.8.0)
  Using cached packaging-23.0-py3-none-any.whl (42 kB)
Collecting psutil==5.9.4 (from chia-blockchain==1.8.0)
  Using cached psutil-5.9.4.tar.gz (485 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting attrs>=17.3.0 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting charset-normalizer<4.0,>=2.0 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Downloading charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl (190 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 191.0/191.0 kB 4.9 MB/s eta 0:00:00
Collecting multidict<7.0,>=4.5 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Downloading multidict-6.0.4-cp311-cp311-musllinux_1_1_x86_64.whl (137 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.3/137.3 kB 5.1 MB/s eta 0:00:00
Collecting async-timeout<5.0,>=4.0.0a3 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Downloading yarl-1.9.2-cp311-cp311-musllinux_1_1_x86_64.whl (251 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 251.7/251.7 kB 5.0 MB/s eta 0:00:00
Collecting frozenlist>=1.1.1 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Downloading frozenlist-1.3.3-cp311-cp311-musllinux_1_1_x86_64.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.4/155.4 kB 4.5 MB/s eta 0:00:00
Collecting aiosignal>=1.1.2 (from aiohttp==3.8.4->chia-blockchain==1.8.0)
  Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting idna>=2.8 (from anyio==3.6.2->chia-blockchain==1.8.0)
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting sniffio>=1.1 (from anyio==3.6.2->chia-blockchain==1.8.0)
  Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Requirement already satisfied: wheel in ./venv/lib/python3.11/site-packages (from blspy==1.0.16->chia-blockchain==1.8.0) (0.40.0)
Collecting botocore<1.30.0,>=1.29.111 (from boto3==1.26.111->chia-blockchain==1.8.0)
  Downloading botocore-1.29.135-py3-none-any.whl (10.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 3.5 MB/s eta 0:00:00
Collecting jmespath<2.0.0,>=0.7.1 (from boto3==1.26.111->chia-blockchain==1.8.0)
  Using cached jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting s3transfer<0.7.0,>=0.6.0 (from boto3==1.26.111->chia-blockchain==1.8.0)
  Downloading s3transfer-0.6.1-py3-none-any.whl (79 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.8/79.8 kB 3.1 MB/s eta 0:00:00
Collecting portalocker>=1.4.0 (from concurrent-log-handler==0.9.20->chia-blockchain==1.8.0)
  Using cached portalocker-2.7.0-py2.py3-none-any.whl (15 kB)
Collecting cffi>=1.12 (from cryptography==39.0.1->chia-blockchain==1.8.0)
  Downloading cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl (474 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 474.3/474.3 kB 2.6 MB/s eta 0:00:00
Collecting jaraco.classes (from keyring==23.13.1->chia-blockchain==1.8.0)
  Using cached jaraco.classes-3.2.3-py3-none-any.whl (6.0 kB)
Collecting importlib-metadata>=4.11.4 (from keyring==23.13.1->chia-blockchain==1.8.0)
  Using cached importlib_metadata-6.6.0-py3-none-any.whl (22 kB)
Collecting SecretStorage>=3.2 (from keyring==23.13.1->chia-blockchain==1.8.0)
  Using cached SecretStorage-3.3.3-py3-none-any.whl (15 kB)
Collecting jeepney>=0.4.2 (from keyring==23.13.1->chia-blockchain==1.8.0)
  Using cached jeepney-0.8.0-py3-none-any.whl (48 kB)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.30.0,>=1.29.111->boto3==1.26.111->chia-blockchain==1.8.0)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting urllib3<1.27,>=1.25.4 (from botocore<1.30.0,>=1.29.111->boto3==1.26.111->chia-blockchain==1.8.0)
  Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
Collecting pycparser (from cffi>=1.12->cryptography==39.0.1->chia-blockchain==1.8.0)
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting zipp>=0.5 (from importlib-metadata>=4.11.4->keyring==23.13.1->chia-blockchain==1.8.0)
  Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting more-itertools (from jaraco.classes->keyring==23.13.1->chia-blockchain==1.8.0)
  Using cached more_itertools-9.1.0-py3-none-any.whl (54 kB)
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.30.0,>=1.29.111->boto3==1.26.111->chia-blockchain==1.8.0)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: chia-blockchain, blspy, chia-rs, chiabip158, chiapos, chiavdf, psutil, PyYAML, watchdog
  Building editable for chia-blockchain (pyproject.toml) ... done
  Created wheel for chia-blockchain: filename=chia_blockchain-1.8.0-0.editable-py3-none-any.whl size=9420 sha256=8b4fac19e89d49b9df525cf188c63c5a983746e15a94c20bde5289bd9209d07a
  Stored in directory: /tmp/pip-ephem-wheel-cache-5qogmr8a/wheels/27/ac/c0/3a0dcbd6e4ca57e8d386743095050760e1c587734b152928c5
  Building wheel for blspy (pyproject.toml) ... done
  Created wheel for blspy: filename=blspy-1.0.16-cp311-cp311-linux_x86_64.whl size=501912 sha256=a835e8bcfb3afc716be95e3f8977c2e0f07cfcb8ba29245c899659bc704b8b98
  Stored in directory: /home/user/.cache/pip/wheels/a6/48/8a/2ed9335636cbfda0b1e86e4eb6bebcb33714fda45a142cc1d1
  Building wheel for chia-rs (pyproject.toml) ... done
  Created wheel for chia-rs: filename=chia_rs-0.2.7-cp311-cp311-linux_x86_64.whl size=2401922 sha256=612e3dd28a1a93e309cd026a6d81597e9529e680ef61798ffbd5f28ac4bcf6c8
  Stored in directory: /home/user/.cache/pip/wheels/d3/aa/4f/3b372549785546e3e84dad181c15d7c6eb408f0a067efa0dfb
  Building wheel for chiabip158 (pyproject.toml) ... done
  Created wheel for chiabip158: filename=chiabip158-1.2-cp311-cp311-linux_x86_64.whl size=2000908 sha256=50df9ac357275b2d2f382cb6cfd9002ec4aa65a643f3ed84f80f9c5caca9e944
  Stored in directory: /home/user/.cache/pip/wheels/a1/78/70/1f5e658eb8f31944f309eed471a33bd9cb5226060147d78c60
  Building wheel for chiapos (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for chiapos (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [155 lines of output]
      running bdist_wheel
      running build
      running build_ext
      -- The C compiler identification is GNU 12.2.1
      -- The CXX compiler identification is GNU 12.2.1
      -- The ASM compiler identification is GNU
      -- Found assembler: /usr/bin/cc
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- pybind11 v2.10.0
      -- Found PythonInterp: /home/user/sources/chia-blockchain/venv/bin/python (found suitable version "3.11.3", minimum required is "3.6")
      -- Found PythonLibs: /usr/lib/libpython3.11.so
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- cxxopts version 2.2.0
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- Configuring done (26.9s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/build/temp.linux-x86_64-cpython-311
      [  2%] Building C object CMakeFiles/fse.dir/lib/FiniteStateEntropy/lib/fse_decompress.c.o
      [  4%] Building C object CMakeFiles/fse.dir/lib/FiniteStateEntropy/lib/fse_compress.c.o
      [  6%] Building CXX object _deps/cxxopts-build/test/CMakeFiles/options_test.dir/main.cpp.o
      [  9%] Building CXX object _deps/cxxopts-build/src/CMakeFiles/example.dir/example.cpp.o
      [ 11%] Building CXX object CMakeFiles/uint128.dir/uint128_t/uint128_t.cpp.o
      [ 13%] Building CXX object _deps/cxxopts-build/test/CMakeFiles/link_test.dir/link_a.cpp.o
      [ 16%] Building C object CMakeFiles/fse.dir/lib/FiniteStateEntropy/lib/entropy_common.c.o
      In file included from /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/uint128_t/uint128_t.build:7,
                       from /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/uint128_t/uint128_t.cpp:1:
      /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/uint128_t/uint128_t.include: In instantiation of 'uint128_t::uint128_t(const T&) [with T = bool; <template-parameter-1-2> = bool]':
      /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/uint128_t/uint128_t.cpp:456:25:   required from here
      /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/uint128_t/uint128_t.include:83:25: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
         83 |                 if (rhs < 0) {
            |                     ~~~~^~~
      [ 18%] Building C object CMakeFiles/fse.dir/lib/FiniteStateEntropy/lib/hist.c.o
      [ 20%] Building CXX object _deps/cxxopts-build/test/CMakeFiles/link_test.dir/link_b.cpp.o
      [ 23%] Linking C static library libfse.a
      [ 23%] Built target fse
      [ 25%] Building CXX object _deps/cxxopts-build/test/CMakeFiles/options_test.dir/options.cpp.o
      [ 27%] Linking CXX static library libuint128.a
      [ 27%] Built target uint128
      [ 30%] Building CXX object CMakeFiles/chiapos.dir/python-bindings/chiapos.cpp.o
      [ 32%] Building C object CMakeFiles/chiapos.dir/src/chacha8.c.o
      [ 34%] Building C object CMakeFiles/chiapos.dir/src/b3/blake3.c.o
      [ 37%] Linking CXX executable link_test
      [ 37%] Built target link_test
      [ 39%] Building CXX object CMakeFiles/ProofOfSpace.dir/src/cli.cpp.o
      [ 41%] Building C object CMakeFiles/chiapos.dir/src/b3/blake3_portable.c.o
      [ 44%] Building C object CMakeFiles/chiapos.dir/src/b3/blake3_dispatch.c.o
      [ 46%] Building ASM object CMakeFiles/chiapos.dir/src/b3/blake3_avx2_x86-64_unix.S.o
      [ 48%] Building ASM object CMakeFiles/chiapos.dir/src/b3/blake3_avx512_x86-64_unix.S.o
      [ 51%] Building ASM object CMakeFiles/chiapos.dir/src/b3/blake3_sse41_x86-64_unix.S.o
      [ 53%] Building C object CMakeFiles/ProofOfSpace.dir/src/chacha8.c.o
      [ 55%] Building C object CMakeFiles/ProofOfSpace.dir/src/b3/blake3.c.o
      [ 58%] Building C object CMakeFiles/ProofOfSpace.dir/src/b3/blake3_portable.c.o
      [ 60%] Linking CXX executable example
      [ 60%] Built target example
      [ 62%] Building CXX object CMakeFiles/RunTests.dir/tests/test-main.cpp.o
      [ 65%] Building C object CMakeFiles/ProofOfSpace.dir/src/b3/blake3_dispatch.c.o
      [ 67%] Building ASM object CMakeFiles/ProofOfSpace.dir/src/b3/blake3_avx2_x86-64_unix.S.o
      [ 69%] Building ASM object CMakeFiles/ProofOfSpace.dir/src/b3/blake3_avx512_x86-64_unix.S.o
      [ 72%] Building ASM object CMakeFiles/ProofOfSpace.dir/src/b3/blake3_sse41_x86-64_unix.S.o
      [ 74%] Building CXX object CMakeFiles/RunTests.dir/tests/test.cpp.o
      [ 76%] Building C object CMakeFiles/RunTests.dir/src/chacha8.c.o
      [ 79%] Building C object CMakeFiles/RunTests.dir/src/b3/blake3.c.o
      [ 81%] Linking CXX shared module /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/build/lib.linux-x86_64-cpython-311/chiapos.cpython-311-x86_64-linux-musl.so
      lto-wrapper: warning: using serial compilation of 7 LTRANS jobs
      lto-wrapper: note: see the '-flto' option documentation for more information
      [ 83%] Building C object CMakeFiles/RunTests.dir/src/b3/blake3_portable.c.o
      [ 86%] Building C object CMakeFiles/RunTests.dir/src/b3/blake3_dispatch.c.o
      [ 88%] Building ASM object CMakeFiles/RunTests.dir/src/b3/blake3_avx2_x86-64_unix.S.o
      [ 90%] Building ASM object CMakeFiles/RunTests.dir/src/b3/blake3_avx512_x86-64_unix.S.o
      [ 93%] Building ASM object CMakeFiles/RunTests.dir/src/b3/blake3_sse41_x86-64_unix.S.o
      [ 95%] Linking CXX executable options_test
      [ 95%] Built target options_test
      /usr/include/fortify/stdio.h: In function '__to_xstring.constprop':
      /usr/include/fortify/stdio.h:73:28: error: inlining failed in call to 'always_inline' 'vsnprintf': function body can be overwritten at link time
         73 | _FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n,
            |                            ^
      /usr/include/c++/12.2.1/ext/string_conversions.h:111:32: note: called from here
        111 |       const int __len = __convf(__s, __n, __fmt, __args);
            |                                ^
      lto-wrapper: fatal error: /usr/bin/c++ returned 1 exit status
      compilation terminated.
      /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
      collect2: error: ld returned 1 exit status
      make[2]: *** [CMakeFiles/chiapos.dir/build.make:207: /tmp/pip-install-wy2jkae_/chiapos_7758ed2658474e16aed098c3bfba3a32/build/lib.linux-x86_64-cpython-311/chiapos.cpython-311-x86_64-linux-musl.so] Error 1
      make[1]: *** [CMakeFiles/Makefile2:223: CMakeFiles/chiapos.dir/all] Error 2
      make[1]: *** Waiting for unfinished jobs....
      [ 97%] Linking CXX executable ProofOfSpace
      [ 97%] Built target ProofOfSpace
      [100%] Linking CXX executable RunTests
      [100%] Built target RunTests
      make: *** [Makefile:146: all] Error 2
      Traceback (most recent call last):
        File "/home/user/sources/chia-blockchain/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/user/sources/chia-blockchain/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/user/sources/chia-blockchain/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 204, in <module>
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-f5gu3knt/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 38, in run
        File "<string>", line 70, in build_extension
        File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j', '6']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chiapos
  Building wheel for chiavdf (pyproject.toml) ... done
  Created wheel for chiavdf: filename=chiavdf-1.0.8-cp311-cp311-linux_x86_64.whl size=1068535 sha256=57baacef34c75ec5cbb6613caefd09a8c43409c6bea6fd4615f76c17c6f551d0
  Stored in directory: /home/user/.cache/pip/wheels/16/f1/2a/cc39fc1a285eb673c5241a1b76e0dd3fdec5fc9951ef570224
  Building wheel for psutil (pyproject.toml) ... done
  Created wheel for psutil: filename=psutil-5.9.4-cp311-abi3-linux_x86_64.whl size=275254 sha256=b96d4ecfc75b936c9e028b0515be04a4adce0a5f4a1ef17b83ed114a61f1e907
  Stored in directory: /home/user/.cache/pip/wheels/8a/1e/ad/6603c49d4802a689d24cbdea92450a70666ef00baab3f5d59b
  Building wheel for PyYAML (pyproject.toml) ... done
  Created wheel for PyYAML: filename=PyYAML-6.0-cp311-cp311-linux_x86_64.whl size=45331 sha256=dd5cf3f86d5d1cbf3c82f70c26ed13801e46dfbd5536e3d7fa808beb87ba4eaa
  Stored in directory: /home/user/.cache/pip/wheels/3c/de/35/2cbb99955fa449eeddb2b433b4369035ee5bdf0fc121035ffe
  Building wheel for watchdog (setup.py) ... done
  Created wheel for watchdog: filename=watchdog-2.2.0-py3-none-any.whl size=78665 sha256=b37d517e4f88cbd6ff39db16946dd4569aa554e420d6b10270965fa4bcab27ea
  Stored in directory: /home/user/.cache/pip/wheels/29/2e/6b/764566d64113f06a327679f03a0dea6edf8161142691e1a3ac
Successfully built chia-blockchain blspy chia-rs chiabip158 chiavdf psutil PyYAML watchdog
Failed to build chiapos
ERROR: Could not build wheels for chiapos, which is required to install pyproject.toml-based projects
cybern0id commented 1 year ago

Ah, prepending the install command with a CXXFLAGS= environment variable to disable the compile flag allows the code to compile at least:

:~$CXXFLAGS="-U_FORTIFY_SOURCE" sh ./install.sh

Still, I have no idea of the implications of this or whether it will adversely affect the security of my node. The documentation https://man7.org/linux/man-pages/man7/feature_test_macros.7.html in relation to this compile flag mention buffer overflow checks etc. Perhaps the variable should be set to -D_FORTIFY_SOURCE=1 instead? And changing optimisation to -O1 instead of -O2? Clutching at straws here....

emlowe commented 1 year ago

Due to limited resources, we cannot support all Linux variants. We publish a PEP 600 compliant manylinux binary wheel for chiapos manylinux_2_17_x86_64 - where 2_17 is the GLIBCMAJOR_GLIBCMINOR version.

Linux variants that are unable to use this binary wheel are community supported.

You may have more success by cloning the chiapos repo and trying to build it from there, rather than the wheel process.

Closing issue.

cybern0id commented 1 year ago

Ah, that's a shame but understandable. My Alpine node has been running from release versions of compiled chia source since main net went live without any problems (though IIRC I had to compile chia_rs independently at one point). Anyway, as you kindly suggest, I'm going to take a look at compiling chiapos independently too. I'm not finding a lot of detailed documentation regarding FORTIFY_SOURCE but from initial reading, it looks like I can turn it off without much to worry about.

emlowe commented 1 year ago

Technically you are compiling all the wheels already - if you look at your output:

Building wheel for chiavdf (pyproject.toml Building wheel for blspy Building wheel for chia-rs

cybern0id commented 1 year ago

Of course! But independently cloning the git repo of each problematic dependency allows easier troubleshooting and testing different compile options and code changes (for me) :)

emlowe commented 1 year ago

oh yes certainly.