Skip to content

pendulum dependency cannot be installed on 32-bit arches #1451

Closed
@mgorny

Description

Description

The current version of pendulum is broken on 32-bit architectures, and prevents pgcli from being installed, e.g. on x86:

$ pip install pgcli
[…]
Building wheels for collected packages: pendulum
  Building wheel for pendulum (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pendulum (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [44 lines of output]
      Running `maturin pep517 build-wheel -i /tmp/venv/bin/python --compatibility off`
      🍹 Building a mixed python/rust project
      🔗 Found pyo3 bindings
      🐍 Found CPython 3.11 at /tmp/venv/bin/python
         Compiling target-lexicon v0.12.6
         Compiling python3-dll-a v0.2.9
         Compiling libc v0.2.139
         Compiling autocfg v1.1.0
         Compiling proc-macro2 v1.0.51
         Compiling once_cell v1.17.1
         Compiling unicode-ident v1.0.6
         Compiling quote v1.0.23
         Compiling syn v1.0.109
         Compiling parking_lot_core v0.9.7
         Compiling cc v1.0.79
         Compiling cfg-if v1.0.0
         Compiling scopeguard v1.1.0
         Compiling smallvec v1.10.0
         Compiling indoc v1.0.9
         Compiling unindent v0.1.11
         Compiling lock_api v0.4.9
         Compiling memoffset v0.9.0
         Compiling pyo3-build-config v0.19.1
         Compiling libmimalloc-sys v0.1.35
         Compiling parking_lot v0.12.1
         Compiling pyo3-ffi v0.19.1
         Compiling pyo3 v0.19.1
         Compiling mimalloc v0.1.39
         Compiling pyo3-macros-backend v0.19.1
         Compiling pyo3-macros v0.19.1
         Compiling _pendulum v3.0.0 (/tmp/pip-install-5opl0f4t/pendulum_6a9ca1944a154f03b7118e4016b5accf/rust)
      error: this arithmetic operation will overflow
        --> src/helpers.rs:59:20
         |
      59 |         seconds += ((146_097 - 10957) * SECS_PER_DAY as usize) as isize;
         |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `135140_usize * 86400_usize`, which would overflow
         |
         = note: `#[deny(arithmetic_overflow)]` on by default
      
      error: could not compile `_pendulum` (lib) due to previous error
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/tmp/venv/bin/python" PYTHON_SYS_EXECUTABLE="/tmp/venv/bin/python" "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-install-5opl0f4t/pendulum_6a9ca1944a154f03b7118e4016b5accf/rust/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pendulum
Failed to build pendulum
ERROR: Could not build wheels for pendulum, which is required to install pyproject.toml-based projects

The issue apparently affects all 32-bit architectures. It has been reported upstream two months ago but it has no received no attention. Additionally, the author does not have time to actively maintain the package since December 2021 (which makes the decision to rewrite it in Rust a bit surprising).

Given that it's only used to display human readable durations, could you please either make it optional or replace it with a portable package? FWICS it was introduced in #1199 but I don't really understand why — perhaps the change could be reverted.

Your environment

  • Please provide your OS and version information.

Gentoo/Linux x86

  • Please provide your CLI version.

pgcli-4.0.1-py3-none-any.whl.metadata

  • What is the output of pip freeze command.

Empty, since it didn't manage to install anything ;-).

Original bug report: https://bugs.gentoo.org/924881

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