Problems building bcrypt on ARM7 / Armbian

Hi, I am having an issue with building the bcrypt package on Armbian BananaPi-M3 ARM7 hf>

Here is the output I am getting :-

root@mail:/usr/local/lib/mailinabox/env# rustup default stable
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
info: latest update on 2024-06-13, rust version 1.79.0 (129f3b996 2024-06-10)
info: downloading component 'cargo'
  7.9 MiB /   7.9 MiB (100 %)   3.9 MiB/s in  4s ETA:  0s
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 15.3 MiB /  15.3 MiB (100 %)   3.9 MiB/s in  8s ETA:  0s
info: downloading component 'rust-std'
 23.7 MiB /  23.7 MiB (100 %)   3.8 MiB/s in 11s ETA:  0s
info: downloading component 'rustc'
 77.7 MiB /  77.7 MiB (100 %)   3.8 MiB/s in 39s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
  7.9 MiB /   7.9 MiB (100 %)   2.8 MiB/s in  3s ETA:  0s
info: installing component 'clippy'
  2.4 MiB /   2.4 MiB (100 %)   2.3 MiB/s in  1s ETA:  0s
info: installing component 'rust-docs'
  9.5 MiB /  15.3 MiB ( 62 %)  14.4 KiB/s in  8m  1s ETA:  6m 53s
info: rolling back changes
error: failed to extract package: No space left on device (os error 28)
root@mail:/usr/local/lib/mailinabox/env# bin/pip install bcrypt
Collecting bcrypt
  Using cached bcrypt-4.1.3.tar.gz (26 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: bcrypt
  Building wheel for bcrypt (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for bcrypt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [59 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-cpython-39
      creating build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/__init__.py -> build/lib.linux-armv7l-cpython-39/bcrypt
      running egg_info
      writing src/bcrypt.egg-info/PKG-INFO
      writing dependency_links to src/bcrypt.egg-info/dependency_links.txt
      writing requirements to src/bcrypt.egg-info/requires.txt
      writing top-level names to src/bcrypt.egg-info/top_level.txt
      reading manifest file 'src/bcrypt.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files found matching 'requirements.txt'
      warning: no previously-included files found matching 'release.py'
      warning: no previously-included files found matching 'mypy.ini'
      warning: no previously-included files matching '*' found under directory '.github'
      warning: no previously-included files found matching 'src/_bcrypt/target'
      warning: no previously-included files matching '*' found under directory 'src/_bcrypt/target'
      adding license file 'LICENSE'
      writing manifest file 'src/bcrypt.egg-info/SOURCES.txt'
      copying src/bcrypt/__init__.pyi -> build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/py.typed -> build/lib.linux-armv7l-cpython-39/bcrypt
      running build_ext
      running build_rust
      error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.
      help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

          =============================DEBUG ASSISTANCE=============================
          If you are seeing a compilation error please try the following steps to
          successfully install bcrypt:
          1) Upgrade to the latest pip and try again. This will fix errors for most
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) Ensure you have a recent Rust toolchain installed. bcrypt requires
             rustc >= 1.64.0. (1.63 may be used by setting the BCRYPT_ALLOW_RUST_163
             environment variable)

          Python: 3.9.2
          platform: Linux-6.7.12-edge-sunxi-armv7l-with-glibc2.31
          pip: n/a
          setuptools: 70.1.0
          setuptools_rust: 1.9.0
          rustc: n/a
          =============================DEBUG ASSISTANCE=============================

      error: can't find Rust compiler

      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.

      To update pip, run:

          pip install --upgrade pip

      and then retry package installation.

      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.

      This package requires Rust >=1.63.0.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bcrypt
Failed to build bcrypt
ERROR: Could not build wheels for bcrypt, which is required to install pyproject.toml-based projects

Is anyone able to tell me where to go from here.

I am not a Python Programmer but know the language same with Rust. I have no experience with either langauges development systems but do know the languages as I study languages, compilers, and VM’s. I have Linux experience running servers over years.

This seems to be the important problem you need to solve.

Yes I ran `rustup default stable’ before hand as I showed. I was hoping someone familiar with Rust extensions would give a response thats why I origibnally put it on the Python Development Forum rather than the Help forum @davidism. This is quite urgent I am working on a climate change related project.

Your rustup invocation is failing with:

error: failed to extract package: No space left on device (os error 28)

The “Core Development” section is for discussing the development of Python itself. It’s almost never the right place to post if you aren’t a Python core developer.

Anyway, it seems pretty clear what happened:

root@mail:/usr/local/lib/mailinabox/env# rustup default stable
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
info: latest update on 2024-06-13, rust version 1.79.0 (129f3b996 2024-06-10)
...
info: rolling back changes
error: failed to extract package: No space left on device (os error 28)

While trying to set up the Rust compiler, it ran out of space. (Did you make a small separate partition for your filesystem root, or deliberately mount /usr on a separate small partition? Check the space remaining and try to free something up.)

Therefore, when the Python setup tried to run, it couldn’t find rustc, because it didn’t get set up properly.

(Aside from that, the bcrypt documentation suggests a different route to setting up the compiler. But if the rustup command works at all for you then you should probably stick with it.)

Sorry ! Thanks alot under too much pressure. I have had other processes running on this device successfully and have had the Rust issue for several days now. And I have installed rustup from the curl bash script previously. So the out of storage issue maywell be not effect the actual issue at hand. Is there a rational C based extension for bcrypt that I can patch in somehow instead. I really hate this creeping rust into everything with no prior thought of the ramifications and consquences and no roadmap for other outside developers.

Okay I am going to have to install another larger uSDCard for my device and then try again.

solved, not sure what it was.