Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

How to install package using branch fix-large-decode #9

Open
SmileSydney opened this issue Jan 16, 2020 · 6 comments
Open

How to install package using branch fix-large-decode #9

SmileSydney opened this issue Jan 16, 2020 · 6 comments

Comments

@SmileSydney
Copy link

I've been using the master branch installed via pip but I'm hitting the xdelta3.XDeltaError.

I tried installing via pip install -e git+https://github.com/samuelcolvin/xdelta3-python.git@fix-large-decode but getting this error:

xdelta3/_xdelta3.c:3:10: fatal error: xdelta3.h: No such file or directory                                                                                       3 | #include "xdelta3.h"
        |          ^~~~~~~~~~~
  compilation terminated.

Any tips on how to build with the original xdelta libraries via pip install?

@samuelcolvin
Copy link
Owner

did you clone recursively to include the xdelta submodule?

@SmileSydney
Copy link
Author

I believe the pip clones recursively by default.

I get this error on both branches: fix-large-decode and master

This is the output from pip install -e git+https://github.com/samuelcolvin/xdelta3-python.git@fix-large-decode:

Collecting xdelta3
  Cloning https://github.com/samuelcolvin/xdelta3-python.git (to revision fix-large-decode) to /tmp/pip-install-_2q86lxq/xdelta3
  Running command git clone -q https://github.com/samuelcolvin/xdelta3-python.git /tmp/pip-install-_2q86lxq/xdelta3
  Running command git checkout -b fix-large-decode --track origin/fix-large-decode
  Switched to a new branch 'fix-large-decode'
  Branch 'fix-large-decode' set up to track remote branch 'fix-large-decode' from 'origin'.
  Running command git submodule update --init --recursive -q
Building wheels for collected packages: xdelta3
  Building wheel for xdelta3 (setup.py): started
  Building wheel for xdelta3 (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_2q86lxq/xdelta3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_2q86lxq/xdelta3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-_1h2i_gv --python-tag cp37
       cwd: /tmp/pip-install-_2q86lxq/xdelta3/
  Complete output (20 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/xdelta3
  copying xdelta3/__init__.py -> build/lib.linux-x86_64-3.7/xdelta3
  copying xdelta3/version.py -> build/lib.linux-x86_64-3.7/xdelta3
  copying xdelta3/main.py -> build/lib.linux-x86_64-3.7/xdelta3
  copying xdelta3/_xdelta3.c -> build/lib.linux-x86_64-3.7/xdelta3
  running build_ext
  building '_xdelta3' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/xdelta3
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DSIZEOF_SIZE_T=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DXD3_USE_LARGEFILE64=1 -I./xdelta3/lib -I/usr/local/include/python3.7m -c xdelta3/_xdelta3.c -o build/temp.linux-x86_64-3.7/xdelta3/_xdelta3.o
  xdelta3/_xdelta3.c:3:10: fatal error: xdelta3.h: No such file or directory
   #include "xdelta3.h"
            ^~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for xdelta3
  Running setup.py clean for xdelta3
Failed to build xdelta3

@samuelcolvin
Copy link
Owner

then perhaps you need xdelta3 installed locally before attempting to install xdelta3-python. I'm afraid I haven't work on this for a long time, so can't really help.

@SmileSydney
Copy link
Author

Thanks for looking at it - I wouldn't remember what I ate for breakfast yesterday.

This is what I found so far:

  • After the failed package install using -e, the git repo is cloned under src/xdelta3 folder. If I first run make in that folder (this copies in the c header files) then python setup.py develop (this is the command that is failing in pip install) it works.
  • How do I make the package installation issue make before python setup.py develop?

@samuelcolvin
Copy link
Owner

samuelcolvin commented Jan 16, 2020

You can't I'm afraid. So your options are:

  • Fix wheel build in Travis and I'll release a new version with binaries. cibuildwheel will be your friend here.
  • Clone the repo and build the wheel you need. You can then, install that locally or distribute the file to install elsewhere.

@samuelcolvin
Copy link
Owner

Or in theory you could edit setup.py to do what make prepare does, but that's pretty ugly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants