spotify / dh-virtualenv

Python virtualenvs in Debian packages

Home Page:http://dh-virtualenv.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fix_shebangs() fails

steveo-at-bosch opened this issue · comments

Hi,

when calling dpkg-buildpackage -us -uc -b, it fails with

...
Successfully built ad-tools
sed: can't read debian/mypackage/opt/venvs/mypackage/bin/rst2xetex.py: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/dh_virtualenv", line 111, in <module>
    sys.exit(main() or 0)
  File "/usr/bin/dh_virtualenv", line 103, in main
    deploy.fix_shebangs()
  File "/usr/lib/python3/dist-packages/dh_virtualenv/deployment.py", line 234, in fix_shebangs
    subprocess.check_call(['sed', '-i', regex, f])
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)

here's the content of my rules

#!/usr/bin/make -f

%:
	dh $@ --with python-virtualenv

and control

Source: mypackage
Section: python
Priority: extra
Maintainer: None <None>
Build-Depends: debhelper (>= 9), python, dh-virtualenv (>= 0.7)
Standards-Version: 3.9.5

Package: mypackage
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python2.7-minimal | python2.6-minimal, ${misc:Pre-Depends}
Depends: ${python:Depends}, ${misc:Depends}
Description: mydescr
 mydescr

Environment:

Ubuntu 20.04
Debian dpkg-buildpackage version 1.19.7.
dh_virtualenv 1.2.2

I can reproduce the error with the documentation example from https://dh-virtualenv.readthedocs.io/en/1.2.1/

For anyone who stumbles across this from Google: this is a bug when sed interacts with VirtioFS (like Docker Desktop, see https://forums.docker.com/t/sed-couldnt-open-temporary-file-xyz-permission-denied-when-using-virtiofs/125473/5). The bug runs from sed 4.2.1 until 4.8. You can upgrade sed or use gRPC FUSE instead of VirtioFS.