Skip to content

Commit

Permalink
build: constrain cython for hidapi build in wine
Browse files Browse the repository at this point in the history
trezor/cython-hidapi#155
trezor/cython-hidapi#159
trezor/cython-hidapi@749da69#commitcomment-122264301

```
 error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      running bdist_wheel
      running build
      running build_ext
      c:\users\user\temp\pip-install-5h0utb8j\hidapi_8e4b6425e91e4c8db312715d87ffd81a\.eggs\cython-3.0.3-py3.11-win32.egg\Cython\Compiler\Main.py:381: FutureWarning: Cython directive 'l
anguage_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: C:\users\user\Temp\pip-install-5h0utb8j\hidapi_8e4b6425e91e4c8db312715d87ffd81a\hid.pyx

        tree = Parsing.p_module(s, pxd, full_module_name)
      Compiling hid.pyx because it changed.
      [1/1] Cythonizing hid.pyx
      building 'hid' extension
      error: Don't know how to compile chid.pxd
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for hidapi
  Running setup.py clean for hidapi
  Building wheel for pyscard (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      running bdist_wheel
      running build
      running build_py
      running build_ext
      building 'smartcard.scard._scard' extension
      swigging smartcard/scard/scard.i to smartcard/scard/scard_wrap.c
      swig.exe -python -outdir smartcard/scard -DWIN32 -o smartcard/scard/scard_wrap.c smartcard/scard/scard.i
      error: command 'swig.exe' failed: None
      [end of output]
```
  • Loading branch information
EchterAgo committed Dec 19, 2023
1 parent 30a4dd4 commit b47119c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/build-wine/_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ build_the_app() {
# Install frozen dependencies
info "Installing frozen dependencies ..."
$PYTHON -m pip install --no-deps --no-warn-script-location -r "$here"/../deterministic-build/requirements.txt || fail "Failed to install requirements"
$PYTHON -m pip install --no-deps --no-warn-script-location -r "$here"/../deterministic-build/requirements-hw.txt || fail "Failed to install requirements-hw"
# Temporary fix for hidapi incompatibility with Cython 3
# See https://github.com/trezor/cython-hidapi/issues/155
# We use PIP_CONSTRAINT as an environment variable instead of command line flag because it gets passed to subprocesses
# like the isolated build environment pip uses for dependencies.
PIP_CONSTRAINT="$here/../requirements/build-constraint.txt" $PYTHON -m pip install --no-deps --no-warn-script-location -r "$here"/../deterministic-build/requirements-hw.txt || fail "Failed to install requirements-hw"

pushd "$WINEPREFIX"/drive_c/electroncash
$PYTHON setup.py install || fail "Failed setup.py install"
Expand Down

0 comments on commit b47119c

Please sign in to comment.