On Raspberry PI 4 - Debian 12 rustup installation in dockerimage fails: Bad system call (core dumped)

Hello, i am trying to install rust tool chain (on following OS) to build python wheels that cannot be found for my OS. pydantic needs rust cargo. How ever i cant get the image to be build successfully on this OS. But on windows it works. As far as i know Docker uses the OS Host Kernel to build images and i need to install cargo seperately on the image.

Architecture: aarch64
OS: Rasparri PI 4 + Debian 12
Docker: v24.0.7

Image:

FROM python:3.12-alpine
LABEL authors="Raphael2b3"
ADD requirements.txt ./
RUN apk add gcc
RUN apk add libffi-dev
// ====  Relevant part

RUN apk add curl  

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y 

// === END
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN rm -f ./requirements.txt
ADD . ./src
WORKDIR ./src
CMD ["python", "main.py"]

The error log i get

Log:

pi@raspberrypi:~/SwarmIntelligenceBackend/src $ sudo docker compose up
[+] Building 3.1s (10/15)                                                                                               docker:default
 => [api internal] load .dockerignore                                                                                             0.0s
 => => transferring context: 80B                                                                                                  0.0s
 => [api internal] load build definition from Dockerfile                                                                          0.1s
 => => transferring dockerfile: 404B                                                                                              0.0s
 => [api internal] load metadata for docker.io/library/python:3.12-alpine                                                         0.6s
 => [api  1/11] FROM docker.io/library/python:3.12-alpine@sha256:c793b92fd9e0e2a0b611756788a033d569ca864b733461c8fb30cfd14847dbc  0.0s
 => [api internal] load build context                                                                                             0.0s
 => => transferring context: 3.37kB                                                                                               0.0s
 => CACHED [api  2/11] ADD requirements.txt ./                                                                                    0.0s
 => CACHED [api  3/11] RUN apk add gcc                                                                                            0.0s
 => CACHED [api  4/11] RUN apk add libffi-dev                                                                                     0.0s
 => CACHED [api  5/11] RUN apk add curl                                                                                           0.0s
 => ERROR [api  6/11] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y                                 2.3s
------
> [api  6/11] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y:
0.545 info: downloading installer
1.993 Bad system call (core dumped)
------
failed to solve: process "/bin/sh -c curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" did not complete successfully: exit code: 1


How can i make this work?

Kind Regards

maybe try to use a base image with gnu glibc instead of musl (which is the libc alpine linux uses). for example, try the debian based image like python:3.12-slim.

for arm targets, aarch64-unknown-linux-gnu is tier 1 target, while aarch64-unknown-linux-musl is tier 2. see the rust platform support page:

https://doc.rust-lang.org/nightly/rustc/platform-support.html

see also this post:

Changing the base image to python:3.12-slim and using following dockerfile:

FROM python:3.12-slim
LABEL authors="Raphael2b3"

ADD requirements.txt ./


RUN apt-get update

RUN apt-get install build-essential libffi-dev curl -y

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

RUN pip install --upgrade pip

RUN pip install -r requirements.txt

RUN rm -f ./requirements.txt

ADD . ./src

WORKDIR ./src

CMD ["python", "main.py"]

I get following error:

pi@raspberrypi:~/SwarmIntelligenceBackend/src $ sudo docker compose up
[+] Building 554.5s (11/14)                                                                              docker:default
 => [api internal] load build definition from Dockerfile                                                           0.0s
 => => transferring dockerfile: 393B                                                                               0.0s
 => [api internal] load .dockerignore                                                                              0.1s
 => => transferring context: 80B                                                                                   0.0s
 => [api internal] load metadata for docker.io/library/python:3.12-slim                                            1.2s
 => [api internal] load build context                                                                              0.1s
 => => transferring context: 3.73kB                                                                                0.0s
 => [api  1/10] FROM docker.io/library/python:3.12-slim@sha256:123229cfb27c384ee1fcc15aec660ad280a09121b7893377e8  0.0s
 => CACHED [api  2/10] ADD requirements.txt ./                                                                     0.0s
 => [api  3/10] RUN apt-get update                                                                                 6.9s
 => [api  4/10] RUN apt-get install build-essential libffi-dev curl -y                                            63.3s
 => [api  5/10] RUN curl https://sh.rustup.rs -sSf | sh -s -- -y                                                 110.5s
 => [api  6/10] RUN pip install --upgrade pip                                                                     15.6s
 => ERROR [api  7/10] RUN pip install -r requirements.txt                                                        356.7s
------
 > [api  7/10] RUN pip install -r requirements.txt:
...
Collects and Dowloads a bunch of stuff
...
116.8    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.5/162.5 kB 4.2 MB/s eta 0:00:00
116.9 Building wheels for collected packages: neo4j, bcrypt, cryptography, httptools, pyyaml, ujson, uvloop, MarkupSafe
116.9   Building wheel for neo4j (pyproject.toml): started
118.8   Building wheel for neo4j (pyproject.toml): finished with status 'done'
118.8   Created wheel for neo4j: filename=neo4j-5.15.0-py3-none-any.whl size=272484 sha256=9510dfde946eecb0e223df912e11c843d5f40d18eb3549d1942c3ce33d87843f
118.8   Stored in directory: /root/.cache/pip/wheels/cc/b4/5c/510cddc2359cad8087f305044c48be5d6ccd38c37b41524ace
118.9   Building wheel for bcrypt (pyproject.toml): started
120.0   Building wheel for bcrypt (pyproject.toml): finished with status 'error'
120.0   error: subprocess-exited-with-error
120.0
120.0   × Building wheel for bcrypt (pyproject.toml) did not run successfully.
120.0   │ exit code: 1
120.0   ╰─> [57 lines of output]
120.0       running bdist_wheel
120.0       running build
120.0       running build_py
120.0       creating build
120.0       creating build/lib.linux-aarch64-cpython-312
120.0       creating build/lib.linux-aarch64-cpython-312/bcrypt
120.0       copying src/bcrypt/__init__.py -> build/lib.linux-aarch64-cpython-312/bcrypt
120.0       running egg_info
120.0       writing src/bcrypt.egg-info/PKG-INFO
120.0       writing dependency_links to src/bcrypt.egg-info/dependency_links.txt
120.0       writing requirements to src/bcrypt.egg-info/requires.txt
120.0       writing top-level names to src/bcrypt.egg-info/top_level.txt
120.0       reading manifest file 'src/bcrypt.egg-info/SOURCES.txt'
120.0       reading manifest template 'MANIFEST.in'
120.0       warning: no previously-included files found matching 'requirements.txt'
120.0       warning: no previously-included files found matching 'release.py'
120.0       warning: no previously-included files found matching 'mypy.ini'
120.0       warning: no previously-included files matching '*' found under directory '.github'
120.0       warning: no previously-included files found matching 'src/_bcrypt/target'
120.0       warning: no previously-included files matching '*' found under directory 'src/_bcrypt/target'
120.0       adding license file 'LICENSE'
120.0       writing manifest file 'src/bcrypt.egg-info/SOURCES.txt'
120.0       copying src/bcrypt/__init__.pyi -> build/lib.linux-aarch64-cpython-312/bcrypt
120.0       copying src/bcrypt/py.typed -> build/lib.linux-aarch64-cpython-312/bcrypt
120.0       running build_ext
120.0       running build_rust
120.0
120.0           =============================DEBUG ASSISTANCE=============================
120.0           If you are seeing a compilation error please try the following steps to
120.0           successfully install bcrypt:
120.0           1) Upgrade to the latest pip and try again. This will fix errors for most
120.0              users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
120.0           2) Ensure you have a recent Rust toolchain installed. bcrypt requires
120.0              rustc >= 1.64.0. (1.63 may be used by setting the BCRYPT_ALLOW_RUST_163
120.0              environment variable)
120.0
120.0           Python: 3.12.1
120.0           platform: Linux-6.1.0-rpi4-rpi-v8-aarch64-with-glibc2.36
120.0           pip: n/a
120.0           setuptools: 69.0.2
120.0           setuptools_rust: 1.8.1
120.0           rustc: n/a
120.0           =============================DEBUG ASSISTANCE=============================
120.0
120.0       error: can't find Rust compiler
120.0
120.0       If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
120.0
120.0       To update pip, run:
120.0
120.0           pip install --upgrade pip
120.0
120.0       and then retry package installation.
120.0
120.0       If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
120.0
120.0       This package requires Rust >=1.63.0.
120.0       [end of output]
120.0
120.0   note: This error originates from a subprocess, and is likely not a problem with pip.
120.1   ERROR: Failed building wheel for bcrypt
120.1   Building wheel for cryptography (pyproject.toml): started
121.2   Building wheel for cryptography (pyproject.toml): finished with status 'error'
121.2   error: subprocess-exited-with-error
121.2
121.2   × Building wheel for cryptography (pyproject.toml) did not run successfully.
121.2   │ exit code: 1
121.2   ╰─> [170 lines of output]
121.2       running bdist_wheel
121.2       running build
121.2       running build_py
121.2       creating build
121.2       creating build/lib.linux-aarch64-cpython-312
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography
121.2       copying src/cryptography/utils.py -> build/lib.linux-aarch64-cpython-312/cryptography
121.2       copying src/cryptography/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography
121.2       copying src/cryptography/fernet.py -> build/lib.linux-aarch64-cpython-312/cryptography
121.2       copying src/cryptography/exceptions.py -> build/lib.linux-aarch64-cpython-312/cryptography
121.2       copying src/cryptography/__about__.py -> build/lib.linux-aarch64-cpython-312/cryptography
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat
121.2       copying src/cryptography/hazmat/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat
121.2       copying src/cryptography/hazmat/_oid.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/general_name.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/base.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/oid.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/name.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/ocsp.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       copying src/cryptography/x509/extensions.py -> build/lib.linux-aarch64-cpython-312/cryptography/x509
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends
121.2       copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/_serialization.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/_asymmetric.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/_cipheralgorithm.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings
121.2       copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/backends/openssl
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/kdf
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/serialization
121.2       copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/serialization
121.2       copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/serialization
121.2       copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/serialization
121.2       copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/serialization
121.2       copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/serialization
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/types.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/asymmetric
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/twofactor
121.2       copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/twofactor
121.2       copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/twofactor
121.2       copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/twofactor
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/ciphers
121.2       copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/ciphers
121.2       copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/ciphers
121.2       copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/ciphers
121.2       copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/ciphers
121.2       copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/primitives/ciphers
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/openssl
121.2       copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/openssl
121.2       copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/openssl
121.2       copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/openssl
121.2       running egg_info
121.2       writing src/cryptography.egg-info/PKG-INFO
121.2       writing dependency_links to src/cryptography.egg-info/dependency_links.txt
121.2       writing requirements to src/cryptography.egg-info/requires.txt
121.2       writing top-level names to src/cryptography.egg-info/top_level.txt
121.2       reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
121.2       reading manifest template 'MANIFEST.in'
121.2       warning: no files found matching '*.c' under directory 'src/_cffi_src'
121.2       warning: no files found matching '*.h' under directory 'src/_cffi_src'
121.2       no previously-included directories found matching 'docs/_build'
121.2       warning: no previously-included files found matching 'vectors'
121.2       warning: no previously-included files matching '*' found under directory 'vectors'
121.2       warning: no previously-included files found matching 'src/rust/target'
121.2       warning: no previously-included files matching '*' found under directory 'src/rust/target'
121.2       warning: no previously-included files matching '*' found under directory '.github'
121.2       warning: no previously-included files found matching 'release.py'
121.2       warning: no previously-included files found matching '.readthedocs.yml'
121.2       warning: no previously-included files found matching 'ci-constraints-requirements.txt'
121.2       warning: no previously-included files found matching 'mypy.ini'
121.2       adding license file 'LICENSE'
121.2       adding license file 'LICENSE.APACHE'
121.2       adding license file 'LICENSE.BSD'
121.2       writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
121.2       copying src/cryptography/py.typed -> build/lib.linux-aarch64-cpython-312/cryptography
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/__init__.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/_openssl.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/asn1.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/exceptions.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/ocsp.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/pkcs7.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       copying src/cryptography/hazmat/bindings/_rust/x509.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust
121.2       creating build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/dh.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       copying src/cryptography/hazmat/bindings/_rust/openssl/x448.pyi -> build/lib.linux-aarch64-cpython-312/cryptography/hazmat/bindings/_rust/openssl
121.2       running build_ext
121.2       running build_rust
121.2
121.2           =============================DEBUG ASSISTANCE=============================
121.2           If you are seeing a compilation error please try the following steps to
121.2           successfully install cryptography:
121.2           1) Upgrade to the latest pip and try again. This will fix errors for most
121.2              users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
121.2           2) Read https://cryptography.io/en/latest/installation/ for specific
121.2              instructions for your platform.
121.2           3) Check our frequently asked questions for more information:
121.2              https://cryptography.io/en/latest/faq/
121.2           4) Ensure you have a recent Rust toolchain installed:
121.2              https://cryptography.io/en/latest/installation/#rust
121.2
121.2           Python: 3.12.1
121.2           platform: Linux-6.1.0-rpi4-rpi-v8-aarch64-with-glibc2.36
121.2           pip: n/a
121.2           setuptools: 69.0.2
121.2           setuptools_rust: 1.8.1
121.2           rustc: n/a
121.2           =============================DEBUG ASSISTANCE=============================
121.2
121.2       error: can't find Rust compiler
121.2
121.2       If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
121.2
121.2       To update pip, run:
121.2
121.2           pip install --upgrade pip
121.2
121.2       and then retry package installation.
121.2
121.2       If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
121.2
121.2       This package requires Rust >=1.56.0.
121.2       [end of output]
121.2
121.2   note: This error originates from a subprocess, and is likely not a problem with pip.
121.2   ERROR: Failed building wheel for cryptography
121.2   Building wheel for httptools (setup.py): started
140.7   Building wheel for httptools (setup.py): finished with status 'done'
140.7   Created wheel for httptools: filename=httptools-0.6.1-cp312-cp312-linux_armv7l.whl size=326331 sha256=d11c23b6774aa9c2c2e359a1ea0239179d741e5a92552d3ec9060cff7a71fb40
140.7   Stored in directory: /root/.cache/pip/wheels/19/d8/40/f5f2a25146d927f1c6f5a9d9b84edec4d2d7a70561844de7e0
140.7   Building wheel for pyyaml (pyproject.toml): started
142.1   Building wheel for pyyaml (pyproject.toml): finished with status 'done'
142.1   Created wheel for pyyaml: filename=PyYAML-6.0.1-cp312-cp312-linux_armv7l.whl size=45361 sha256=06cb90c6912c9a668bcf5d0c2672440a3c2d8c77cf0897c5edd6171d60c86493
142.1   Stored in directory: /root/.cache/pip/wheels/4a/68/8e/df9cd97725df58bd2ab35992dce00b50f70490a3d672da85ea
142.1   Building wheel for ujson (pyproject.toml): started
158.7   Building wheel for ujson (pyproject.toml): finished with status 'done'
158.7   Created wheel for ujson: filename=ujson-5.9.0-cp312-cp312-linux_armv7l.whl size=45869 sha256=8252f043514a9f4877de87b49b24bc77af9f670ab33c1f07bbb83c2f7c32dc1d
158.7   Stored in directory: /root/.cache/pip/wheels/2b/17/0f/e15f4c32f5b40d2020f722dbbcde0b662624936e6d04ae7891
158.7   Building wheel for uvloop (pyproject.toml): started
350.1   Building wheel for uvloop (pyproject.toml): still running...
352.3   Building wheel for uvloop (pyproject.toml): finished with status 'done'
352.3   Created wheel for uvloop: filename=uvloop-0.19.0-cp312-cp312-linux_armv7l.whl size=3897625 sha256=8debc94850b795ee9a263e4986182c0d38c98a5b8f7b572df926ac399586f6e2
352.3   Stored in directory: /root/.cache/pip/wheels/63/19/20/89180be5fd7b8e6a19c0120d4edb3a70aa20e31946c46fec77
352.3   Building wheel for MarkupSafe (setup.py): started
354.2   Building wheel for MarkupSafe (setup.py): finished with status 'done'
354.2   Created wheel for MarkupSafe: filename=MarkupSafe-2.1.3-cp312-cp312-linux_armv7l.whl size=26998 sha256=1507834b04cfef3e10dd8711e9c87ceedcd9da1f7cc6cea2d3c81627001dd87f
354.2   Stored in directory: /root/.cache/pip/wheels/c2/bd/c4/f13a19279cf9072aeb000631eeedb8f80ab9b91a6851054592
354.2 Successfully built neo4j httptools pyyaml ujson uvloop MarkupSafe
354.2 Failed to build bcrypt cryptography
354.2 ERROR: Could not build wheels for bcrypt, cryptography, which is required to install pyproject.toml-based projects
------
failed to solve: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1

But i think i am more close to the solution

it might be just $PATH environment variable is not configured correctly. rustup look for the environment variable $RUSTUP_HOME and $CARGO_HOME, and fallback to $HOME/.rustup and $HOME/.cargo respectively. you either need to add $HOME/.cargo/bin to $PATH, or you can set $CARGO_HOME before running rustup.

you can take a look at the dockerfile of the official rust docker image:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.