← All tasks
pythonpymssql/pymssql #273Not a task: not reproduced

running setup.py leaves garbage in source directory

envgap__pymssql__pymssql-273

01 / FAILURE SIGNATURE

As reported upstream

dpkg-source: error: cannot represent change to pymssql-2.1.0/a.out: binary file contents changed
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
dd42d5e962cd42eeb8e6ce24a0a09135e92ef990
Manifest
setup.py
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

pymssql/pymssql #273 · read the original issue
setup.py has the following lines:

``` pytnon
with stdchannel_redirected(sys.stderr, os.devnull):
    if compiler.has_function('clock_gettime', libraries=['rt']):
        libraries.append('rt')
```

The `has_function` call creates a `a.out` file in the source directory as well as `tmp` directory with a binary file. 
These files are not removed after the `python setup.py clean` call and do interfere with debian build system (namely `dpkg-source`) in a funny manner when one tries to debianize the latest pymssql via `stdeb`:

```
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building pymssql using existing ./pymssql_2.1.0.orig.tar.gz
dpkg-source: error: cannot represent change to pymssql-2.1.0/a.out: binary file contents changed
dpkg-source: error: add a.out in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: error: cannot represent change to pymssql-2.1.0/tmp/clock_gettime1qPymn.o: binary file contents changed
dpkg-source: error: add tmp/clock_gettime1qPymn.o in debian/source/include-binaries if you want to store the modified binary in the debian tarball
```

I've managed to temporarily work this around via an ugly patch:

``` patch
diff --git a/setup.py b/setup.py
index ef6895d..ed7da53 100755
--- a/setup.py
+++ b/setup.py
@@ -182,6 +182,9 @@ else:
     with stdchannel_redirected(sys.stderr, os.devnull):
         if compiler.has_function('clock_gettime', libraries=['rt']):
             libraries.append('rt')
+        import os;os.remove(fpath('a.out'))
+        import shutil; shutil.rmtree(fpath('tmp'))
+

 usr_local = '/usr/local'
 if osp.exists(usr_local):
```

But looks like there should be a better way of not-polluting the source dir with that kind of stuff
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]