Missing entry in "setup.py install --record"

33 views
Skip to first unread message

Matthias Geier

unread,
Feb 5, 2018, 7:45:49 AM2/5/18
to pytho...@googlegroups.com
Dear CFFI list.

I've received a bug report for a Python module that uses CFFI:
https://github.com/spatialaudio/python-sounddevice/issues/116.

This can be easily reproduced by running this command:

python3 setup.py install \
--record file-list.txt \
--root=/tmp/staging

The problem is that the "hidden" file generated by the build process
(in my case _sounddevice.py) is not listed in file-list.txt, although
it is correctly generated and copied to the target directory.

This problem appears in out-of-line ABI mode but it seems to work fine
in out-of-line API mode.

Is there something I'm doing wrong or is there a bug in CFFI or
setuptools or ...?

cheers,
Matthias

Armin Rigo

unread,
Feb 6, 2018, 10:03:31 AM2/6/18
to pytho...@googlegroups.com
Hi Matthias,

On 5 February 2018 at 13:45, Matthias Geier <matthia...@gmail.com> wrote:
> python3 setup.py install \
> --record file-list.txt \
> --root=/tmp/staging
>
> The problem is that the "hidden" file generated by the build process
> (in my case _sounddevice.py) is not listed in file-list.txt, although
> it is correctly generated and copied to the target directory.

I failed to reproduce; it works fine for me. Can you give a complete
step-by-step example including the source code of all files? Thanks!


A bientôt,

Armin.

Matthias Geier

unread,
Feb 6, 2018, 10:24:12 AM2/6/18
to pytho...@googlegroups.com
Hi Armin.

Thanks for trying!

Here's the full step-by-step example:

git clone https://github.com/spatialaudio/python-sounddevice.git
cd python-sounddevice
python3 setup.py install --record file-list.txt --root=/tmp/staging

After that, the file "file-list.txt" should have an entry for
"_sounddevice.py", but when I try it, this is missing.

BTW, I'm using Linux and the same error was reported for FreeBSD, see
https://github.com/spatialaudio/python-sounddevice/issues/116.

cheers,
Matthias
> --
> -- python-cffi: To unsubscribe from this group, send email to python-cffi...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/python-cffi?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "python-cffi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to python-cffi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Armin Rigo

unread,
Feb 11, 2018, 4:27:15 AM2/11/18
to pytho...@googlegroups.com
Hi,

On 6 February 2018 at 16:23, Matthias Geier <matthia...@gmail.com> wrote:
> git clone https://github.com/spatialaudio/python-sounddevice.git
> cd python-sounddevice
> python3 setup.py install --record file-list.txt --root=/tmp/staging

Ok, reproduced. Note that if you don't give the "--root" option, then
the file-list.txt will be correct. In order to debug why, I found out
that the code that writes file-list.txt exists in two places(!),
distutils and setuptools. If you run without the "--root" option then
it's going to be written by setuptools, and if you give the "--root"
option then it's going to be written by distutils. In the first case
it's done by listing the files that exist in the build directories; in
the second case it's done by enumerating all files that should
theoretically be there (missing the one just generated).

Fixed in e59662b013b4. Thanks!

Note also that this command line should give the same result as a
working "--record" option on Linux or OS X:

(cd /tmp/staging; find . -type f) | cut -c 2-


A bientôt,

Armin.

Matthias Geier

unread,
Feb 11, 2018, 6:24:06 AM2/11/18
to pytho...@googlegroups.com
Hi Armin.

Thanks a lot for the quick fix!

cheers,
Matthias

Matthias Geier

unread,
May 14, 2018, 12:52:37 PM5/14/18
to pytho...@googlegroups.com
Hi Armin, hi list.

The problem that should have been fixed in
https://bitbucket.org/cffi/cffi/commits/e59662b013b4b00b410d2df645837d9cf3ad5b52
still doesn't seem to have gone away in CFFI 1.11.5.

Here are again the steps to reproduce:

git clone https://github.com/spatialaudio/python-sounddevice.git
cd python-sounddevice
python3 setup.py install --record file-list.txt --root=/tmp/staging

After that, the file "file-list.txt" should have an entry for
"_sounddevice.py", but when I try it, this is missing.

cheers,
Matthias

Armin Rigo

unread,
May 19, 2018, 2:28:19 PM5/19/18
to pytho...@googlegroups.com
Hi Matthias,

On 14 May 2018 at 18:52, Matthias Geier <matthia...@gmail.com> wrote:
> Hi Armin, hi list.
>
> The problem that should have been fixed in
> https://bitbucket.org/cffi/cffi/commits/e59662b013b4b00b410d2df645837d9cf3ad5b52
> still doesn't seem to have gone away in CFFI 1.11.5.

Indeed. If you never do a ``python setup.py build_ext --inplace``,
then the generated Python module only lives inside the ``build/lib/``
directory, and then we run into a distutils problem: it won't look
there for the file. See check_module() in
distutils/command/build_py.py. I'm unsure how to fix that. Unless we
have another idea, I fear it's not going to be fixed.


A bientôt,

Armin.
Reply all
Reply to author
Forward
0 new messages