rocky/python-xdis

Installed via pip, can't execute pydisasm

Marrin opened this issue · 2 comments

I'm using the Ubuntu 18.04 supplied Python 3.6.6 and the latest pip to install xdis globally:

$ python3 --version
Python 3.6.6
$ python3 -m pip --version
pip 18.0 from /home/bj/.local/lib/python3.6/site-packages/pip (python 3.6)
$ pydisasm
bash: /usr/local/bin/pydisasm: /home/rocky/.pyenv/versions/3.6.6/bin/python: bad interpreter: No such file or directory
$ head -1 /usr/local/bin/pydisasm
#!/home/rocky/.pyenv/versions/3.6.6/bin/python

That she bang line is already in the wheel file and definately not portable. :-)

rocky commented

What was in git in fact did not have a "she bang" that is wrong. Wheel building helpfully changed something that was reasonable into something that was not. I find Python is often too clever by a half, or clumsy by design forcing being too clever by a half.

Until another release goes out, I think you can install via tarball which doesn't have the additional cleverness, or as you probably have done, modify the first line.

jwilk commented

adf4fdb doesn't fix the problem because:

  • the pydisasm shell script is not being installed;
  • the pydisasm.py script can't be used directly, because it has no shebang.

Python scripts in the wheels should have #!python shebang, which would then be expanded by the wheel installer (such as pip).
But there's evidently a bug in the wheel generation code; pypa/wheel#278 perhaps?

I recommend reverting adf4fdb and removing broken wheels from PyPI for the time being.