- update to 1.10.0: * Issue #295: use calloc() directly instead of PyObject_Malloc()+memset() to handle ffi.new() with a default allocator. Speeds up ffi.new(large-array) where most of the time you never touch most of the array. * Some OS/X build fixes (“only with Xcode but without CLT”). * Improve a couple of error messages: when getting mismatched versions of cffi and its backend; and when calling functions which cannot be called with libffi because an argument is a struct that is “too complicated” (and not a struct pointer, which always works). * Add support for some unusual compilers (non-msvc, non-gcc, non-icc, non-clang) * Implemented the remaining cases for ffi.from_buffer. Now all buffer/memoryview objects can be passed. The one remaining check is against passing unicode strings in Python 2. (They support the buffer interface, but that gives the raw bytes behind the UTF16/UCS4 storage, which is most of the times not what you expect. In Python 3 this has been fixed and the unicode strings don’t support the memoryview interface any more.) * The C type _Bool or bool now converts to a Python boolean when reading, instead of the content of the byte as an integer. The potential incompatibility here is what occurs if the byte contains a value different from 0 and 1. Previously, it would just return it; with this change, CFFI raises an exception in this case. But this case means “undefined behavior” in C; if you really have to interface with a library relying on this, don’t use bool in the CFFI side. Also, it is still valid to use a byte string as initializer for a bool[], but now it must only contain \x00 or \x01. As an aside, ffi.string() no longer works on bool[] (but it never made much sense, as this function stops at the first zero). * ffi.buffer is now the name of cffi’s buffer type, and ffi.buffer() works like before but is the constructor of that type. * ffi.addressof(lib, "name") now works also in in-line mode, not only in out-of-line mode. This is useful for taking the address of global variables. OBS-URL: https://build.opensuse.org/request/show/507126 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=35
408 lines
21 KiB
Plaintext
408 lines
21 KiB
Plaintext
-------------------------------------------------------------------
|
||
Thu Jun 29 16:03:46 UTC 2017 - tbechtold@suse.com
|
||
|
||
- update to 1.10.0:
|
||
* Issue #295: use calloc() directly instead of PyObject_Malloc()+memset()
|
||
to handle ffi.new() with a default allocator. Speeds up ffi.new(large-array)
|
||
where most of the time you never touch most of the array.
|
||
* Some OS/X build fixes (“only with Xcode but without CLT”).
|
||
* Improve a couple of error messages: when getting mismatched versions of
|
||
cffi and its backend; and when calling functions which cannot be called with
|
||
libffi because an argument is a struct that is “too complicated” (and not
|
||
a struct pointer, which always works).
|
||
* Add support for some unusual compilers (non-msvc, non-gcc, non-icc, non-clang)
|
||
* Implemented the remaining cases for ffi.from_buffer. Now all
|
||
buffer/memoryview objects can be passed. The one remaining check is against
|
||
passing unicode strings in Python 2. (They support the buffer interface, but
|
||
that gives the raw bytes behind the UTF16/UCS4 storage, which is most of the
|
||
times not what you expect. In Python 3 this has been fixed and the unicode
|
||
strings don’t support the memoryview interface any more.)
|
||
* The C type _Bool or bool now converts to a Python boolean when reading,
|
||
instead of the content of the byte as an integer. The potential
|
||
incompatibility here is what occurs if the byte contains a value different
|
||
from 0 and 1. Previously, it would just return it; with this change, CFFI
|
||
raises an exception in this case. But this case means “undefined behavior”
|
||
in C; if you really have to interface with a library relying on this,
|
||
don’t use bool in the CFFI side. Also, it is still valid to use a byte
|
||
string as initializer for a bool[], but now it must only contain \x00 or
|
||
\x01. As an aside, ffi.string() no longer works on bool[] (but it never made
|
||
much sense, as this function stops at the first zero).
|
||
* ffi.buffer is now the name of cffi’s buffer type, and ffi.buffer() works
|
||
like before but is the constructor of that type.
|
||
* ffi.addressof(lib, "name") now works also in in-line mode, not only in
|
||
out-of-line mode. This is useful for taking the address of global variables.
|
||
* Issue #255: cdata objects of a primitive type (integers, floats, char) are
|
||
now compared and ordered by value. For example, <cdata 'int' 42> compares
|
||
equal to 42 and <cdata 'char' b'A'> compares equal to b'A'. Unlike C,
|
||
<cdata 'int' -1> does not compare equal to ffi.cast("unsigned int", -1): it
|
||
compares smaller, because -1 < 4294967295.
|
||
* PyPy: ffi.new() and ffi.new_allocator()() did not record “memory pressure”,
|
||
causing the GC to run too infrequently if you call ffi.new() very often
|
||
and/or with large arrays. Fixed in PyPy 5.7.
|
||
* Support in ffi.cdef() for numeric expressions with + or -. Assumes that
|
||
there is no overflow; it should be fixed first before we add more general
|
||
support for arbitrary arithmetic on constants.
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Mar 27 11:50:31 UTC 2017 - jmatejek@suse.com
|
||
|
||
- do not generate HTML documentation for packages that are indirect
|
||
dependencies of Sphinx
|
||
(see docs at https://cffi.readthedocs.org/ )
|
||
|
||
-------------------------------------------------------------------
|
||
Thu Mar 16 17:33:16 UTC 2017 - jmatejek@suse.com
|
||
|
||
- update to 1.9.1
|
||
- Structs with variable-sized arrays as their last field: now we track the
|
||
length of the array after ffi.new() is called, just like we always tracked
|
||
the length of ffi.new("int[]", 42). This lets us detect out-of-range
|
||
accesses to array items. This also lets us display a better repr(), and
|
||
have the total size returned by ffi.sizeof() and ffi.buffer(). Previously
|
||
both functions would return a result based on the size of the declared
|
||
structure type, with an assumed empty array. (Thanks andrew for starting
|
||
this refactoring.)
|
||
- Add support in cdef()/set_source() for unspecified-length arrays in
|
||
typedefs: typedef int foo_t[...];. It was already supported for global
|
||
variables or structure fields.
|
||
- I turned in v1.8 a warning from cffi/model.py into an error: 'enum xxx' has
|
||
no values explicitly defined: refusing to guess which integer type it is
|
||
meant to be (unsigned/signed, int/long). Now I’m turning it back to a
|
||
warning again; it seems that guessing that the enum has size int is a
|
||
99%-safe bet. (But not 100%, so it stays as a warning.)
|
||
- Fix leaks in the code handling FILE * arguments. In CPython 3 there is a
|
||
remaining issue that is hard to fix: if you pass a Python file object to a
|
||
FILE * argument, then os.dup() is used and the new file descriptor is only
|
||
closed when the GC reclaims the Python file object—and not at the earlier
|
||
time when you call close(), which only closes the original file descriptor.
|
||
If this is an issue, you should avoid this automatic convertion of Python
|
||
file objects: instead, explicitly manipulate file descriptors and call
|
||
fdopen() from C (...via cffi).
|
||
- When passing a void * argument to a function with a different pointer type,
|
||
or vice-versa, the cast occurs automatically, like in C. The same occurs
|
||
for initialization with ffi.new() and a few other places. However, I
|
||
thought that char * had the same property—but I was mistaken. In C you get
|
||
the usual warning if you try to give a char * to a char ** argument, for
|
||
example. Sorry about the confusion. This has been fixed in CFFI by giving
|
||
for now a warning, too. It will turn into an error in a future version.
|
||
- Issue #283: fixed ffi.new() on structures/unions with nested anonymous
|
||
structures/unions, when there is at least one union in the mix. When
|
||
initialized with a list or a dict, it should now behave more closely like
|
||
the { } syntax does in GCC.
|
||
- CPython 3.x: experimental: the generated C extension modules now use the
|
||
“limited API”, which means that, as a compiled .so/.dll, it should work
|
||
directly on any version of CPython >= 3.2. The name produced by distutils
|
||
is still version-specific. To get the version-independent name, you can
|
||
rename it manually to NAME.abi3.so, or use the very recent setuptools 26.
|
||
- Added ffi.compile(debug=...), similar to python setup.py build --debug but
|
||
defaulting to True if we are running a debugging version of Python itself.
|
||
- Removed the restriction that ffi.from_buffer() cannot be used on byte
|
||
strings. Now you can get a char * out of a byte string, which is valid as
|
||
long as the string object is kept alive. (But don’t use it to modify the
|
||
string object! If you need this, use bytearray or other official
|
||
techniques.)
|
||
- PyPy 5.4 can now pass a byte string directly to a char * argument (in older
|
||
versions, a copy would be made). This used to be a CPython-only
|
||
optimization.
|
||
- ffi.gc(p, None) removes the destructor on an object previously created by
|
||
another call to ffi.gc()
|
||
- bool(ffi.cast("primitive type", x)) now returns False if the value is zero
|
||
(including -0.0), and True otherwise. Previously this would only return
|
||
False for cdata objects of a pointer type when the pointer is NULL.
|
||
- bytearrays: ffi.from_buffer(bytearray-object) is now supported. (The reason
|
||
it was not supported was that it was hard to do in PyPy, but it works since
|
||
PyPy 5.3.) To call a C function with a char * argument from a buffer
|
||
object—now including bytearrays—you write lib.foo(ffi.from_buffer(x)).
|
||
Additionally, this is now supported: p[0:length] = bytearray-object. The
|
||
problem with this was that a iterating over bytearrays gives numbers
|
||
instead of characters. (Now it is implemented with just a memcpy, of
|
||
course, not actually iterating over the characters.)
|
||
- C++: compiling the generated C code with C++ was supposed to work, but
|
||
failed if you make use the bool type (because that is rendered as the C
|
||
_Bool type, which doesn’t exist in C++).
|
||
- help(lib) and help(lib.myfunc) now give useful information, as well as
|
||
dir(p) where p is a struct or pointer-to-struct.
|
||
- drop upstreamed python-cffi-avoid-bitshifting-negative-int.patch
|
||
|
||
-------------------------------------------------------------------
|
||
Tue Dec 6 14:39:52 UTC 2016 - jmatejek@suse.com
|
||
|
||
- update for multipython build
|
||
|
||
-------------------------------------------------------------------
|
||
Sun May 29 05:23:27 UTC 2016 - badshah400@gmail.com
|
||
|
||
- Add python-cffi-avoid-bitshifting-negative-int.patch to actually
|
||
fix the "negative left shift" warning by replacing bitshifting
|
||
in appropriate places by bitwise and comparison to self; patch
|
||
taken from upstream git. Drop cffi-1.5.2-wnoerror.patch: no
|
||
longer required.
|
||
|
||
-------------------------------------------------------------------
|
||
Fri May 27 13:00:22 UTC 2016 - jmatejek@suse.com
|
||
|
||
- disable "negative left shift" warning in test suite to prevent
|
||
failures with gcc6, until upstream fixes the undefined code
|
||
in question (boo#981848, cffi-1.5.2-wnoerror.patch)
|
||
|
||
-------------------------------------------------------------------
|
||
Thu May 26 02:33:02 UTC 2016 - badshah400@gmail.com
|
||
|
||
- Update to version 1.6.0:
|
||
* ffi.list_types()
|
||
* ffi.unpack()
|
||
* extern “Python+C”
|
||
* in API mode, lib.foo.__doc__ contains the C signature now.
|
||
* Yet another attempt at robustness of ffi.def_extern() against
|
||
CPython’s interpreter shutdown logic.
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Apr 11 14:45:11 UTC 2016 - jmatejek@suse.com
|
||
|
||
- update to 1.5.2
|
||
* support for cffi-based embedding
|
||
* more robustness for shutdown logic
|
||
|
||
-------------------------------------------------------------------
|
||
Sat Jan 9 17:18:52 UTC 2016 - michael@stroeder.com
|
||
|
||
- update to version 1.4.2:
|
||
* Nothing changed from v1.4.1.
|
||
- changes from version 1.4.1:
|
||
* Fix the compilation failure of cffi on CPython 3.5.0. (3.5.1
|
||
works; some detail changed that makes some underscore-starting
|
||
macros disappear from view of extension modules, and I worked
|
||
around it, thinking it changed in all 3.5 versions—but no: it was
|
||
only in 3.5.1.)
|
||
- changes from version 1.4.0:
|
||
* A better way to do callbacks has been added (faster and more
|
||
portable, and usually cleaner). It is a mechanism for the
|
||
out-of-line API mode that replaces the dynamic creation of
|
||
callback objects (i.e. C functions that invoke Python) with the
|
||
static declaration in cdef() of which callbacks are needed. This
|
||
is more C-like, in that you have to structure your code around the
|
||
idea that you get a fixed number of function pointers, instead of
|
||
creating them on-the-fly.
|
||
* ffi.compile() now takes an optional verbose argument. When True,
|
||
distutils prints the calls to the compiler.
|
||
* ffi.compile() used to fail if given sources with a path that
|
||
includes "..". Fixed.
|
||
* ffi.init_once() added. See docs.
|
||
* dir(lib) now works on libs returned by ffi.dlopen() too.
|
||
* Cleaned up and modernized the content of the demo subdirectory in
|
||
the sources (thanks matti!).
|
||
* ffi.new_handle() is now guaranteed to return unique void * values,
|
||
even if called twice on the same object. Previously, in that case,
|
||
CPython would return two cdata objects with the same void *
|
||
value. This change is useful to add and remove handles from a
|
||
global dict (or set) without worrying about duplicates. It already
|
||
used to work like that on PyPy. This change can break code that
|
||
used to work on CPython by relying on the object to be kept alive
|
||
by other means than keeping the result of ffi.new_handle()
|
||
alive. (The corresponding warning in the docs of ffi.new_handle()
|
||
has been here since v0.8!)
|
||
- changes from version 1.3.1:
|
||
* The optional typedefs (bool, FILE and all Windows types) were not
|
||
always available from out-of-line FFI objects.
|
||
* Opaque enums are phased out from the cdefs: they now give a
|
||
warning, instead of (possibly wrongly) being assumed equal to
|
||
unsigned int. Please report if you get a reasonable use case for
|
||
them.
|
||
* Some parsing details, notably volatile is passed along like const
|
||
and restrict. Also, older versions of pycparser mis-parse some
|
||
pointer-to-pointer types like char * const *: the “const” ends up
|
||
at the wrong place. Added a workaround.
|
||
- changes from version 1.3.0:
|
||
* Added ffi.memmove().
|
||
* Pull request #64: out-of-line API mode: we can now declare
|
||
floating-point types with typedef float... foo_t;. This only works
|
||
if foo_t is a float or a double, not long double.
|
||
* Issue #217: fix possible unaligned pointer manipulation, which
|
||
crashes on some architectures (64-bit, non-x86).
|
||
* Issues #64 and #126: when using set_source() or verify(), the
|
||
const and restrict keywords are copied from the cdef to the
|
||
generated C code; this fixes warnings by the C compiler. It also
|
||
fixes corner cases like typedef const int T; T a; which would
|
||
previously not consider a as a constant. (The cdata objects
|
||
themselves are never const.)
|
||
* Win32: support for __stdcall. For callbacks and function pointers;
|
||
regular C functions still don’t need to have their calling
|
||
convention declared.
|
||
* Windows: CPython 2.7 distutils doesn’t work with Microsoft’s
|
||
official Visual Studio for Python, and I’m told this is not a
|
||
bug. For ffi.compile(), we removed a workaround that was inside
|
||
cffi but which had unwanted side-effects. Try saying import
|
||
setuptools first, which patches distutils...
|
||
|
||
-------------------------------------------------------------------
|
||
Thu Sep 17 11:28:00 UTC 2015 - p.drouand@gmail.com
|
||
|
||
- Update to version 1.2.1
|
||
* No changes entry for this version
|
||
- Changes from version 1.2.0
|
||
* Out-of-line mode: ``int a[][...];`` can be used to declare a structure
|
||
field or global variable which is, simultaneously, of total length
|
||
unknown to the C compiler (the ``a[]`` part) and each element is
|
||
itself an array of N integers, where the value of N *is * known to the
|
||
C compiler (the ``int`` and ``[...]`` parts around it). Similarly,
|
||
``int a[5][...];`` is supported (but probably less useful: remember
|
||
that in C it means ``int (a[5])[...];``).
|
||
* PyPy: the ``lib.some_function`` objects were missing the attributes
|
||
``__name__``, ``__module__`` and ``__doc__`` that are expected e.g. by
|
||
some decorators-management functions from ``functools``.
|
||
* Out-of-line API mode: you can now do ``from _example.lib import x``
|
||
to import the name ``x`` from ``_example.lib``, even though the
|
||
``lib`` object is not a standard module object. (Also works in ``from
|
||
_example.lib import *``, but this is even more of a hack and will fail
|
||
if ``lib`` happens to declare a name called ``__all__``. Note that
|
||
`` *`` excludes the global variables; only the functions and constants
|
||
make sense to import like this.)
|
||
* ``lib.__dict__`` works again and gives you a copy of the
|
||
dict---assuming that ``lib`` has got no symbol called precisely
|
||
``__dict__``. (In general, it is safer to use ``dir(lib)``.)
|
||
* Out-of-line API mode: global variables are now fetched on demand at
|
||
every access. It fixes issue #212 (Windows DLL variables), and also
|
||
allows variables that are defined as dynamic macros (like ``errno``)
|
||
or ``__thread`` -local variables. (This change might also tighten
|
||
the C compiler's check on the variables' type.)
|
||
* Issue #209: dereferencing NULL pointers now raises RuntimeError
|
||
instead of segfaulting. Meant as a debugging aid. The check is
|
||
only for NULL: if you dereference random or dead pointers you might
|
||
still get segfaults.
|
||
* Issue #152: callbacks__: added an argument ``ffi.callback(...,
|
||
onerror=...)``. If the main callback function raises an exception
|
||
and ``onerror`` is provided, then ``onerror(exception, exc_value,
|
||
traceback)`` is called. This is similar to writing a ``try:
|
||
except:`` in the main callback function, but in some cases (e.g. a
|
||
signal) an exception can occur at the very start of the callback
|
||
function---before it had time to enter the ``try: except:`` block.
|
||
* Issue #115: added ``ffi.new_allocator()``, which officializes
|
||
support for `alternative allocators`__.
|
||
.. __: using.html#callbacks
|
||
.. __: using.html#alternative-allocators
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Jun 1 18:13:10 UTC 2015 - benoit.monin@gmx.fr
|
||
|
||
- update to version 1.1.0 (fate#318838):
|
||
* Out-of-line API mode: we can now declare integer types with
|
||
typedef int... foo_t;. The exact size and signedness of foo_t
|
||
is figured out by the compiler.
|
||
* Out-of-line API mode: we can now declare multidimensional
|
||
arrays (as fields or as globals) with int n[...][...]. Before,
|
||
only the outermost dimension would support the ... syntax.
|
||
* Out-of-line ABI mode: we now support any constant declaration,
|
||
instead of only integers whose value is given in the cdef. Such
|
||
“new” constants, i.e. either non-integers or without a value
|
||
given in the cdef, must correspond to actual symbols in the
|
||
lib. At runtime they are looked up the first time we access
|
||
them. This is useful if the library defines extern const
|
||
sometype somename;.
|
||
* ffi.addressof(lib, "func_name") now returns a regular cdata
|
||
object of type “pointer to function”. You can use it on any
|
||
function from a library in API mode (in ABI mode, all functions
|
||
are already regular cdata objects). To support this, you need
|
||
to recompile your cffi modules.
|
||
* Issue #198: in API mode, if you declare constants of a struct
|
||
type, what you saw from lib.CONSTANT was corrupted.
|
||
* Issue #196: ffi.set_source("package._ffi", None) would
|
||
incorrectly generate the Python source to package._ffi.py
|
||
instead of package/_ffi.py. Also fixed: in some cases, if the C
|
||
file was in build/foo.c, the .o file would be put in
|
||
build/build/foo.o.
|
||
- additional changes from version 1.0.3:
|
||
* Same as 1.0.2, apart from doc and test fixes on some platforms
|
||
- additional changes from version 1.0.2:
|
||
* Variadic C functions (ending in a ”...” argument) were not
|
||
supported in the out-of-line ABI mode. This was a bug—there was
|
||
even a (non-working) example doing exactly that!
|
||
- additional changes from version 1.0.1:
|
||
* ffi.set_source() crashed if passed a sources=[..] argument.
|
||
Fixed by chrippa on pull request #60.
|
||
* Issue #193: if we use a struct between the first cdef() where
|
||
it is declared and another cdef() where its fields are defined,
|
||
then this definition was ignored.
|
||
* Enums were buggy if you used too many ”...” in their definition
|
||
- additional changes from version 1.0.0:
|
||
* The main news item is out-of-line module generation:
|
||
+ for ABI level, with ffi.dlopen()
|
||
+ for API level, which used to be with ffi.verify(), now
|
||
deprecated
|
||
- add python-cffi-rpmlintrc: cffi specifically installs C headers
|
||
in site-packages
|
||
- add new test dependency gcc-c++
|
||
- skip the tests on SLE11 since they fail on i586
|
||
|
||
-------------------------------------------------------------------
|
||
Thu Apr 23 06:33:12 UTC 2015 - mcihar@suse.cz
|
||
|
||
- Update to 0.9.2
|
||
* No upstream changelog
|
||
See https://bitbucket.org/cffi/cffi/commits/all for a list of
|
||
commits
|
||
|
||
-------------------------------------------------------------------
|
||
Tue Aug 26 12:40:34 UTC 2014 - toddrme2178@gmail.com
|
||
|
||
- Update to 0.8.6
|
||
* No upstream changelog
|
||
See https://bitbucket.org/cffi/cffi/commits/all for a list of
|
||
commits
|
||
|
||
-------------------------------------------------------------------
|
||
Mon May 19 16:35:30 UTC 2014 - jmatejek@suse.com
|
||
|
||
- update to 0.8.2
|
||
* minor bugfixes
|
||
- remove cffi-pytest-integration.patch as it is no longer necessary
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Mar 31 14:18:44 UTC 2014 - speilicke@suse.com
|
||
|
||
- Require libffi43-devel on SLE_11_SP2 instead of using pkg-config to fix build
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Feb 24 12:09:15 UTC 2014 - mvyskocil@suse.com
|
||
|
||
- update to 0.8.1
|
||
* fixes on Python 3 on OS/X, and some FreeBSD fixes (thanks Tobias)
|
||
- added a note wrt disabled tests
|
||
- add cffi-pytest-integration.patch: allowinf call pytest from setup.py
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Nov 18 14:33:39 UTC 2013 - mvyskocil@suse.com
|
||
|
||
- update to 0.8
|
||
* integrated support for C99 variable-sized structures
|
||
* multi-thread safety
|
||
* ffi.getwinerror()
|
||
* a number of small fixes
|
||
|
||
-------------------------------------------------------------------
|
||
Thu Oct 24 10:59:45 UTC 2013 - speilicke@suse.com
|
||
|
||
- Require python-setuptools instead of distribute (upstreams merged)
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Sep 30 07:51:11 UTC 2013 - mvyskocil@suse.com
|
||
|
||
- use pkgconfig(libffi) to get the most recent ffi
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Aug 19 13:27:16 UTC 2013 - mvyskocil@suse.com
|
||
|
||
- Update to 0.7.2
|
||
* add implicit bool
|
||
* standard names are handled as defaults in cdef declarations
|
||
* enum types follow GCC rules and not just int
|
||
* supports simple slices x[start:stop]
|
||
* enums are handled like ints
|
||
* new ffi.new_handle(python_object)
|
||
* and various bugfixes
|
||
|
||
-------------------------------------------------------------------
|
||
Sun Feb 10 09:28:56 UTC 2013 - saschpe@suse.de
|
||
|
||
- Initial version
|
||
|