Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin requires marlin-binary-protocol, but it won't install: longintrepr.h: no such file or directory #355

Closed
salfter opened this issue Dec 29, 2023 · 4 comments
Labels

Comments

@salfter
Copy link

salfter commented Dec 29, 2023

Hardware Setup
BTT SKR 1.4 Turbo

Describe the problem
https://github.com/trippwill/marlin-binary-protocol was archived over two years ago. It doesn't build under current versions of Python. I had used it previously to upgrade firmware in my AM8 as the LPC176x support isn't suitable for my installation (UART connection to the printer, not USB). The firmware updater plugin still requires marlin-binary-protocol to support binary file transfers...or it says it does, anyway.

(More precisely, it looks like it's heatshrink that isn't building properly, but it's a dependency of marlin-binary-protocol, which in turn is a dependency of this plugin.)

Log Files

am8-alpine:~$ octoprint/bin/pip install marlin-binary-protocol
Collecting marlin-binary-protocol
  Downloading marlin_binary_protocol-0.0.7-py3-none-any.whl (7.2 kB)
Collecting heatshrink>=0.3.2 (from marlin-binary-protocol)
  Downloading Heatshrink-0.3.2.tar.gz (280 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 280.5/280.5 kB 624.9 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting heatshrink2>=0.9 (from marlin-binary-protocol)
  Downloading heatshrink2-0.12.0.tar.gz (111 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 111.3/111.3 kB 1.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pyserial>=3.4 in ./octoprint/lib/python3.11/site-packages (from marlin-binary-protocol) (3.5)
Building wheels for collected packages: heatshrink, heatshrink2
  Building wheel for heatshrink (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-311
      creating build/lib.linux-aarch64-cpython-311/heatshrink
      copying heatshrink/streams.py -> build/lib.linux-aarch64-cpython-311/heatshrink
      copying heatshrink/__init__.py -> build/lib.linux-aarch64-cpython-311/heatshrink
      running build_ext
      building 'heatshrink.core' extension
      creating build/temp.linux-aarch64-cpython-311
      creating build/temp.linux-aarch64-cpython-311/heatshrink
      creating build/temp.linux-aarch64-cpython-311/heatshrink/_heatshrink
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I./heatshrink/_heatshrink -I/home/salfter/octoprint/include -I/usr/include/python3.11 -c heatshrink/_heatshrink/heatshrink_decoder.c -o build/temp.linux-aarch64-cpython-311/heatshrink/_heatshrink/heatshrink_decoder.o -std=c99
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I./heatshrink/_heatshrink -I/home/salfter/octoprint/include -I/usr/include/python3.11 -c heatshrink/_heatshrink/heatshrink_encoder.c -o build/temp.linux-aarch64-cpython-311/heatshrink/_heatshrink/heatshrink_encoder.o -std=c99
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I./heatshrink/_heatshrink -I/home/salfter/octoprint/include -I/usr/include/python3.11 -c heatshrink/core.c -o build/temp.linux-aarch64-cpython-311/heatshrink/core.o -std=c99
      heatshrink/core.c:69:12: fatal error: longintrepr.h: No such file or directory
         69 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for heatshrink
  Running setup.py clean for heatshrink
  Building wheel for heatshrink2 (setup.py) ... done
  Created wheel for heatshrink2: filename=heatshrink2-0.12.0-cp311-cp311-linux_aarch64.whl size=298137 sha256=5ee0fe3dd1d79f41813a1abe962ec651928f93a0fecd399ff223b6246def829b
  Stored in directory: /home/salfter/.cache/pip/wheels/0f/65/28/f6fdb9477c6f0d7b788443c46c13b9d5e0c12f5bce5845df93
Successfully built heatshrink2
Failed to build heatshrink
ERROR: Could not build wheels for heatshrink, which is required to install pyproject.toml-based projects
@salfter
Copy link
Author

salfter commented Dec 29, 2023

Building from https://github.com/p3p/pyheatshrink/releases/download/0.3.3/pyheatshrink-pip.zip (as described in the docs) doesn't work either...same error. I tried making a tarball that included the missing header file (/usr/include/python3.11/cpython/longintrepr.h, which some pages, but wound up with a bunch more errors.

I'm beginning to think that Python 3.11 is to blame, based on similar issues with other projects. I'm going to try again with Python 3.10, which I've figured out how to get on the latest Alpine instead of 3.11.

@salfter salfter closed this as completed Dec 29, 2023
@salfter
Copy link
Author

salfter commented Dec 29, 2023

It looks like marlin-binary-protocol was never updated following the obsolescence of Python 2. I've fixed it to remove the heatshrink dependency...it'll only use heatshrink2 now. It builds just fine that way. I've forked it and pushed out a new release:

https://gitlab.alfter.us/salfter/marlin-binary-protocol/-/archive/v0.0.8/marlin-binary-protocol-v0.0.8.tar.gz

The plugin should work with this version, but I've not had a chance to test it just yet. If it does work, you might want to update the installation instructions accordingly.

@salfter salfter reopened this Dec 29, 2023
Copy link

This issue has been automatically marked as stale because it has not had any recent activity. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed in 5 days.

Copy link

github-actions bot commented Feb 8, 2024

This issue has been automatically locked because there was no further activity after it was closed. Please open a new issue for any related problems.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant