21157026 CFFI should be updated to >1.1.0
authorErik Trauschke <Erik.Trauschke@oracle.com>
Wed, 23 Sep 2015 14:00:51 -0700
changeset 4894 7219201c1b0d
parent 4893 95c28fe27246
child 4895 70e69d0e987e
21157026 CFFI should be updated to >1.1.0
components/python/cffi/Makefile
components/python/cffi/cffi-PYVER.p5m
components/python/cffi/cffi.license
components/python/cffi/patches/alloca.patch
components/python/cffi/patches/anonymous.patch
components/python/cffi/patches/backend.patch
components/python/cffi/patches/test.patch
components/python/cryptography/Makefile
components/python/cryptography/cryptography-PYVER.p5m
components/python/cryptography/depend.mk
components/python/cryptography/patches/dsa.patch
components/python/xattr/Makefile
components/python/xattr/patches/test.patch
components/python/xattr/xattr-PYVER.p5m
--- a/components/python/cffi/Makefile	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/cffi/Makefile	Wed Sep 23 14:00:51 2015 -0700
@@ -26,16 +26,16 @@
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cffi
-COMPONENT_VERSION=	0.8.2
+COMPONENT_VERSION=	1.1.2
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:8192393640f7bc304ce82669b35eb90592566a30abbb4924456f52079afc18e2
+    sha256:390970b602708c91ddc73953bb6929e56291c18a4d80f360afa00fad8b6f3339
 COMPONENT_ARCHIVE_URL=	$(call pypi_url)
 COMPONENT_PROJECT_URL=	http://cffi.readthedocs.org/
 COMPONENT_BUGDB=	python-mod/cffi
 
-TPNO=			16913
+TPNO=			24051
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/setup.py.mk
@@ -52,22 +52,17 @@
 COMPONENT_TEST_ARGS +=	-p no:codechecker
 COMPONENT_TEST_ARGS +=	$(TEST_SKIPS)
 COMPONENT_TEST_ARGS +=	c testing
-# The following tests cause core dumps on SPARC (bus error, illegal hardware
-# instruction).  We don't skip test_install_and_reload_module{,_package}, which
-# fail on both 64-bit platforms, since those don't cause the interpreter to
-# crash.
-$(BUILD_DIR)/sparcv7-%/.tested: TEST_SKIPS = -k "not test_callback_return_type and not test_struct_packed and not test_opaque_integer_as_function_result"
-$(BUILD_DIR)/sparcv9-%/.tested: TEST_SKIPS = -k "not test_callback and not test_a_lot_of_callbacks and not test_struct_packed and not test_opaque_integer_as_function_result and not test_wchar"
 
 # Copy the tests and a few of the source files they read into a scratch
 # directory so running the tests don't leave turds in the source directory.
 COMPONENT_PRE_TEST_ACTION = \
 	$(MKDIR) $(@D)/tests/doc/source; \
-	$(CP) -r $(SOURCE_DIR)/c $(SOURCE_DIR)/testing $(@D)/tests; \
+	$(CP) -r $(SOURCE_DIR)/c $(SOURCE_DIR)/testing $(SOURCE_DIR)/cffi $(@D)/tests; \
 	$(CP) $(SOURCE_DIR)/setup.py $(@D)/tests; \
 	$(CP) \
 	    $(SOURCE_DIR)/doc/source/conf.py \
 	    $(SOURCE_DIR)/doc/source/index.rst \
+	    $(SOURCE_DIR)/doc/source/installation.rst \
 	    $(@D)/tests/doc/source
 
 # common targets
--- a/components/python/cffi/cffi-PYVER.p5m	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/cffi/cffi-PYVER.p5m	Wed Sep 23 14:00:51 2015 -0700
@@ -44,23 +44,29 @@
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/PKG-INFO
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/SOURCES.txt
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/dependency_links.txt
+file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/entry_points.txt
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/not-zip-safe
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/requires.txt
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi-$(COMPONENT_VERSION)-py$(PYVER).egg-info/top_level.txt
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/__init__.py
+file path=usr/lib/python$(PYVER)/vendor-packages/cffi/_cffi_include.h
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/api.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/backend_ctypes.py
+file path=usr/lib/python$(PYVER)/vendor-packages/cffi/cffi_opcode.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/commontypes.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/cparser.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/ffiplatform.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/gc_weakref.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/lock.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/model.py
+file path=usr/lib/python$(PYVER)/vendor-packages/cffi/parse_c_type.h
+file path=usr/lib/python$(PYVER)/vendor-packages/cffi/recompiler.py
+file path=usr/lib/python$(PYVER)/vendor-packages/cffi/setuptools_ext.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/vengine_cpy.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/vengine_gen.py
 file path=usr/lib/python$(PYVER)/vendor-packages/cffi/verifier.py
 #
-license LICENSE license=MIT
+license cffi.license license=MIT
 #
 # force a dependency on the Python runtime
 depend type=require fmri=__TBD pkg.debug.depend.file=python$(PYVER) \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/cffi/cffi.license	Wed Sep 23 14:00:51 2015 -0700
@@ -0,0 +1,26 @@
+The MIT License
+
+Copyright (c) 1996-2003  Red Hat, Inc.
+Copyright (c) 2001  John Beniton
+Copyright (c) 2002  Bo Thorsen
+Copyright (c) 2002  Ranjit Mathew
+Copyright (c) 2002  Roger Sayle
+
+Permission is hereby granted, free of charge, to any person 
+obtaining a copy of this software and associated documentation 
+files (the "Software"), to deal in the Software without 
+restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or 
+sell copies of the Software, and to permit persons to whom the 
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included 
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+DEALINGS IN THE SOFTWARE.
--- a/components/python/cffi/patches/alloca.patch	Wed Sep 23 08:28:19 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-Need to include alloca.h when using alloca().  This is filed upstream as:
-
-    https://bitbucket.org/cffi/cffi/issue/144/fix-for-issue-128-is-incomplete
-
-and fixed in
-
-    https://bitbucket.org/cffi/cffi/commits/41b3ef920695
-
-diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
---- a/cffi/vengine_cpy.py
-+++ b/cffi/vengine_cpy.py
[email protected]@ -771,6 +771,10 @@
- typedef unsigned __int32 uint32_t;
- typedef unsigned __int64 uint64_t;
- typedef unsigned char _Bool;
-+#else
-+#if (defined (__SVR4) && defined (__sun)) || defined(_AIX)
-+#  include <alloca.h>
-+#endif
- #endif
- 
- #if PY_MAJOR_VERSION < 3
--- a/components/python/cffi/patches/anonymous.patch	Wed Sep 23 08:28:19 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-# HG changeset patch
-# User Armin Rigo <[email protected]>
-# Date 1396624834 -7200
-# Node ID facaf5de29c9e8cdaa148112ece17a4205cf2d84
-# Parent  0457fbb2d45243a93cb8ed242646d7487bd36dc4
-Issue #142: don't generate C files that use '$' in identifiers.
-
-diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
---- a/cffi/vengine_cpy.py
-+++ b/cffi/vengine_cpy.py
[email protected]@ -632,13 +632,18 @@
-     # ----------
-     # enums
- 
-+    def _enum_funcname(self, prefix, name):
-+        # "$enum_$1" => "___D_enum____D_1"
-+        name = name.replace('$', '___D_')
-+        return '_cffi_e_%s_%s' % (prefix, name)
-+
-     def _generate_cpy_enum_decl(self, tp, name, prefix='enum'):
-         if tp.partial:
-             for enumerator in tp.enumerators:
-                 self._generate_cpy_const(True, enumerator, delayed=False)
-             return
-         #
--        funcname = '_cffi_e_%s_%s' % (prefix, name)
-+        funcname = self._enum_funcname(prefix, name)
-         prnt = self._prnt
-         prnt('static int %s(PyObject *lib)' % funcname)
-         prnt('{')
-diff --git a/cffi/vengine_gen.py b/cffi/vengine_gen.py
---- a/cffi/vengine_gen.py
-+++ b/cffi/vengine_gen.py
[email protected]@ -410,13 +410,18 @@
-     # ----------
-     # enums
- 
-+    def _enum_funcname(self, prefix, name):
-+        # "$enum_$1" => "___D_enum____D_1"
-+        name = name.replace('$', '___D_')
-+        return '_cffi_e_%s_%s' % (prefix, name)
-+
-     def _generate_gen_enum_decl(self, tp, name, prefix='enum'):
-         if tp.partial:
-             for enumerator in tp.enumerators:
-                 self._generate_gen_const(True, enumerator)
-             return
-         #
--        funcname = '_cffi_e_%s_%s' % (prefix, name)
-+        funcname = self._enum_funcname(prefix, name)
-         self.export_symbols.append(funcname)
-         prnt = self._prnt
-         prnt('int %s(char *out_error)' % funcname)
[email protected]@ -453,7 +458,7 @@
-         else:
-             BType = self.ffi._typeof_locked("char[]")[0]
-             BFunc = self.ffi._typeof_locked("int(*)(char*)")[0]
--            funcname = '_cffi_e_%s_%s' % (prefix, name)
-+            funcname = self._enum_funcname(prefix, name)
-             function = module.load_function(BFunc, funcname)
-             p = self.ffi.new(BType, 256)
-             if function(p) < 0:
-diff --git a/testing/test_verify.py b/testing/test_verify.py
---- a/testing/test_verify.py
-+++ b/testing/test_verify.py
[email protected]@ -1,4 +1,4 @@
--import py
-+import py, re
- import sys, os, math, weakref
- from cffi import FFI, VerificationError, VerificationMissing, model
- from testing.support import *
[email protected]@ -29,6 +29,24 @@
- def setup_module():
-     import cffi.verifier
-     cffi.verifier.cleanup_tmpdir()
-+    #
-+    # check that no $ sign is produced in the C file; it used to be the
-+    # case that anonymous enums would produce '$enum_$1', which was
-+    # used as part of a function name.  GCC accepts such names, but it's
-+    # apparently non-standard.
-+    _r_comment = re.compile(r"/\*.*?\*/|//.*?$", re.DOTALL | re.MULTILINE)
-+    _r_string = re.compile(r'\".*?\"')
-+    def _write_source_and_check(self, file=None):
-+        base_write_source(self, file)
-+        if file is None:
-+            f = open(self.sourcefilename)
-+            data = f.read()
-+            f.close()
-+            data = _r_comment.sub(' ', data)
-+            data = _r_string.sub('"skipped"', data)
-+            assert '$' not in data
-+    base_write_source = cffi.verifier.Verifier._write_source
-+    cffi.verifier.Verifier._write_source = _write_source_and_check
- 
- 
- def test_module_type():
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/cffi/patches/backend.patch	Wed Sep 23 14:00:51 2015 -0700
@@ -0,0 +1,26 @@
+
+CFFI has some alignment issues on 64bit SPARC. This has been already fixed in
+the upstream gate but has not made it into a release yet.
+
+https://bitbucket.org/cffi/cffi/issues/217/get_unique_type-doesnt-respect-alignment
+
+--- cffi-1.1.2/c/_cffi_backend.c	2015-06-09 03:04:10.000000000 -0700
++++ cffi-1.1.2/c/_cffi_backend.c	2015-08-25 13:11:20.603298092 -0700
[email protected]@ -3410,7 +3410,6 @@
+            array      [ctype, length]
+            funcptr    [ctresult, ellipsis+abi, num_args, ctargs...]
+     */
+-    long i;
+     PyObject *key, *y;
+     const void **pkey;
+     int err;
[email protected]@ -3420,8 +3419,7 @@
+         goto error;
+ 
+     pkey = (const void **)PyBytes_AS_STRING(key);
+-    for (i = 0; i < keylength; i++)
+-        pkey[i] = unique_key[i];
++    memcpy(pkey, unique_key, keylength * sizeof(void *));
+ 
+     y = PyDict_GetItem(unique_cache, key);
+     if (y != NULL) {
--- a/components/python/cffi/patches/test.patch	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/cffi/patches/test.patch	Wed Sep 23 14:00:51 2015 -0700
@@ -1,52 +1,29 @@
+
 The testsuite makes some incorrect assumptions:
 
-  - we need to not assume "a standard gcc", so replace the -Werror flag
-    with -errwarn to turn on the warnings are expected to cause compilation
-    to fail.
-
-  - don't use the -pthread flag for compilation; as Studio doesn't have any
+  - Don't use the -pthread flag for compilation; as Studio doesn't have any
     clue what to do with it, and we don't need it on Solaris, anyway.
 
-  - don't force the use of gcc when compiling a test shared object; get
-    that passed in from the makefile.
-
-  - don't assume that stdin/stdout/stderr are changeable:
-
-        https://bitbucket.org/cffi/cffi/issue/145/solaris-stdout-and-stderr-not-in-libc-not
-
-    fixed in
-
-        https://bitbucket.org/cffi/cffi/commits/237031079adc
+  - We need to not assume "a standard gcc", so replace the -Werror flag
+    with -errwarn to turn on the warnings are expected to cause compilation
+    to fail. Also, there is no equivalent for -Wconversion in Studio, so turn
+    off testing for conversion errors.
 
   - don't assume that enums can be unsigned or are the same size as long:
 
     https://bitbucket.org/cffi/cffi/issue/143/test_enum_size-makes-invalid-assumptions
 
-Also fix a problem with some assignments to void*:
-
-    https://bitbucket.org/cffi/cffi/issue/146/incorrect-type-for-c_callback-variable
-
-fixed in
-
-    https://bitbucket.org/cffi/cffi/commits/51d87933eb4b
+  - There is one test helper in test_recompiler where we suddenly try to do C++
+    but without changing the compiler executable. This works in gcc but not with
+    Studio. Furthermore, this test seems to be still in debugging mode since it
+    is part of an "if 1:" loop.
 
---- cffi-0.8.2/testing/test_verify.py	Thu Mar  6 22:51:56 2014
-+++ cffi-0.8.2/testing/test_verify.py	Thu Mar 20 18:39:01 2014
[email protected]@ -18,8 +18,10 @@
-         extra_compile_args = [
-             '-Werror', '-Qunused-arguments', '-Wno-error=shorten-64-to-32']
-     else:
--        # assume a standard gcc
--        extra_compile_args = ['-Werror']
-+        extra_compile_args = [
-+          '-errtags=yes',
-+          '-errwarn=E_ASSIGNMENT_TYPE_MISMATCH,E_RETURN_VALUE_TYPE_MISMATCH'
-+        ]
- 
-     class FFI(FFI):
-         def verify(self, *args, **kwds):
---- cffi-0.8.2/testing/callback_in_thread.py	Fri Mar 21 15:58:21 2014
-+++ cffi-0.8.2/testing/callback_in_thread.py	Fri Mar 21 15:58:30 2014
+  - Don't force the use of gcc when compiling a test shared object; get
+    that passed in from the makefile.
+
+
+--- cffi-1.1.2/testing/cffi0/callback_in_thread.py	2015-06-09 03:04:07.000000000 -0700
++++ cffi-1.1.2/testing/cffi0/callback_in_thread.py	2015-08-11 10:56:22.822161292 -0700
 @@ -22,7 +22,7 @@
              pthread_create(&thread, NULL, my_wait_function, (void*)mycb);
              return 0;
@@ -56,68 +33,31 @@
      seen = []
      @ffi.callback('int(*)(int,int)')
      def mycallback(x, y):
---- cffi-0.8.2/testing/test_ownlib.py	Tue Oct  9 02:10:04 2012
-+++ cffi-0.8.2/testing/test_ownlib.py	Tue Mar 25 15:39:35 2014
[email protected]@ -1,4 +1,4 @@
--import py, sys
-+import os, py, sys
- import subprocess, weakref
- from cffi import FFI
- from cffi.backend_ctypes import CTypesBackend
[email protected]@ -28,7 +28,7 @@
-         from testing.udir import udir
-         udir.join('testownlib.c').write(SOURCE)
-         subprocess.check_call(
--            'gcc testownlib.c -shared -fPIC -o testownlib.so',
-+            os.getenv('TESTOWNLIB_CC') % ('testownlib.c', 'testownlib.so'),
-             cwd=str(udir), shell=True)
-         cls.module = str(udir.join('testownlib.so'))
- 
---- cffi-0.8.2/c/test_c.py	Thu Mar  6 22:51:56 2014
-+++ cffi-0.8.2/c/test_c.py	Mon Mar 24 14:53:27 2014
[email protected]@ -1102,7 +1102,7 @@
- def test_read_variable():
-     ## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard
-     ## https://bugs.pypy.org/issue1643
--    if sys.platform == 'win32' or sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
-+    if not sys.platform.startswith("linux"):
-         py.test.skip("untested")
-     BVoidP = new_pointer_type(new_void_type())
-     ll = find_and_load_library('c')
[email protected]@ -1112,7 +1112,7 @@
- def test_read_variable_as_unknown_length_array():
-     ## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard
-     ## https://bugs.pypy.org/issue1643
--    if sys.platform == 'win32' or sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
-+    if not sys.platform.startswith("linux"):
-         py.test.skip("untested")
-     BCharP = new_pointer_type(new_primitive_type("char"))
-     BArray = new_array_type(BCharP, None)
[email protected]@ -1124,7 +1124,7 @@
- def test_write_variable():
-     ## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard
-     ## https://bugs.pypy.org/issue1643
--    if sys.platform == 'win32' or sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
-+    if not sys.platform.startswith("linux"):
-         py.test.skip("untested")
-     BVoidP = new_pointer_type(new_void_type())
-     ll = find_and_load_library('c')
---- cffi-0.8.2/testing/test_verify.py	Thu Mar  6 22:51:56 2014
-+++ cffi-0.8.2/testing/test_verify.py	Mon Mar 24 15:03:49 2014
[email protected]@ -1472,8 +1474,8 @@
-     assert func() == 42
- 
- def test_FILE_stored_in_stdout():
--    if sys.platform == 'win32':
--        py.test.skip("MSVC: cannot assign to stdout")
-+    if not sys.platform.startswith("linux"):
-+        py.test.skip("likely, we cannot assign to stdout")
+--- cffi-1.1.2/testing/cffi0/test_verify.py	2015-06-09 03:04:07.000000000 -0700
++++ cffi-1.1.2/testing/cffi0/test_verify.py	2015-08-12 14:17:18.300215250 -0700
[email protected]@ -18,6 +18,9 @@
+         extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
+         # special things for clang
+         extra_compile_args.append('-Qunused-arguments')
++    elif (sys.platform == 'sunos5'):
++        extra_compile_args = ["-errtags=yes",
++            "-errwarn=E_ASSIGNMENT_TYPE_MISMATCH,E_RETURN_VALUE_TYPE_MISMATCH"]
+     else:
+         # assume a standard gcc
+         extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
[email protected]@ -95,6 +98,11 @@
+         py.test.skip("needs GCC or Clang")
      ffi = FFI()
-     ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);")
-     lib = ffi.verify("""
---- cffi-0.8.2/testing/test_verify.py	Thu Mar  6 22:51:56 2014
-+++ cffi-0.8.2/testing/test_verify.py	Mon Mar 24 15:06:23 2014
[email protected]@ -1598,13 +1598,13 @@
+     ffi.cdef(cdef)
++
++    if sys.platform == 'sunos5':
++        lib = ffi.verify(source, **kargs)
++        return lib
++
+     py.test.raises(VerificationError, ffi.verify, source, **kargs)
+     extra_compile_args_orig = extra_compile_args[:]
+     extra_compile_args.remove('-Wconversion')
[email protected]@ -1737,13 +1745,13 @@
               ('-123',          4, -1),
               ('-2147483647-1', 4, -1),
               ]
@@ -133,7 +73,7 @@
              continue   # skipped on Windows
          ffi = FFI()
          ffi.cdef("enum foo_e { AA, BB, ... };")
[email protected]@ -1629,7 +1627,7 @@
[email protected]@ -1768,7 +1776,7 @@
                          (maxulong, -1, ''),
                          (-1, 0xffffffff, 'U'),
                          (-1, maxulong, 'UL')]:
@@ -142,16 +82,140 @@
              continue     # enums may always be signed with MSVC
          ffi = FFI()
          ffi.cdef("enum foo_e { AA=%s };" % c1)
---- a/testing/test_verify.py
-+++ b/testing/test_verify.py
[email protected]@ -1656,8 +1656,8 @@
+--- cffi-1.1.2/testing/cffi1/test_new_ffi_1.py	2015-06-09 03:04:07.000000000 -0700
++++ cffi-1.1.2/testing/cffi1/test_new_ffi_1.py	2015-08-12 15:18:12.105387245 -0700
[email protected]@ -81,6 +81,10 @@
+         DEFS = DEFS.replace('data[0]', 'data[1]')   # not supported
+         CCODE = (DEFS + "\n#pragma pack(push,1)\n" + DEFS_PACKED +
+                  "\n#pragma pack(pop)\n")
++    elif sys.platform == "sunos5":
++        DEFS = DEFS.replace('data[0]', 'data[1]')   # not supported
++        CCODE = (DEFS +
++                 DEFS_PACKED.replace('/*here*/', '__attribute__((packed))'))
+     else:
+         CCODE = (DEFS +
+                  DEFS_PACKED.replace('/*here*/', '__attribute__((packed))'))
[email protected]@ -893,9 +897,9 @@
+         assert ffi.cast("enum foq", 0) != ffi.cast("enum bar", 0)
+         assert ffi.cast("enum bar", 0) != ffi.cast("int", 0)
+         assert repr(ffi.cast("enum bar", -1)) == "<cdata 'enum bar' -1: CC1>"
+-        assert repr(ffi.cast("enum foq", -1)) == (  # enums are unsigned, if
+-            "<cdata 'enum foq' 4294967295>") or (   # they contain no neg value
+-                sys.platform == "win32")            # (but not on msvc)
++        assert repr(ffi.cast("enum foq", -1)) == (   # enums are unsigned, if
++            "<cdata 'enum foq' 4294967295>") or (    # they contain no neg value
++                sys.platform in ("win32", "sunos5")) # (but not on msvc or SS)
+         # enum baz { A2=0x1000, B2=0x2000 };
+         assert ffi.string(ffi.cast("enum baz", 0x1000)) == "A2"
+         assert ffi.string(ffi.cast("enum baz", 0x2000)) == "B2"
[email protected]@ -1011,7 +1015,7 @@
+     def test_bitfield_enum(self):
+         # typedef enum { AA1, BB1, CC1 } foo_e_t;
+         # typedef struct { foo_e_t f:2; } bfenum_t;
+-        if sys.platform == "win32":
++        if sys.platform in ("win32", "sunos5"):
+             py.test.skip("enums are not unsigned")
+         s = ffi.new("bfenum_t *")
+         s.f = 2
[email protected]@ -1211,7 +1215,7 @@
+         assert repr(p.a).startswith("<cdata 'int[2]' 0x")
+ 
+     def test_struct_containing_array_varsize_workaround(self):
+-        if sys.platform == "win32":
++        if sys.platform in ("win32", "sunos5"):
+             py.test.skip("array of length 0 not supported")
+         # struct array0 { int len; short data[0]; };
+         p = ffi.new("char[]", ffi.sizeof("struct array0") + 7 * SIZE_OF_SHORT)
+--- cffi-1.1.2/testing/cffi1/test_recompiler.py	2015-06-09 03:04:10.000000000 -0700
++++ cffi-1.1.2/testing/cffi1/test_recompiler.py	2015-08-11 11:08:16.757848317 -0700
[email protected]@ -20,7 +20,7 @@
+     kwds.setdefault('undef_macros', ['NDEBUG'])
+     module_name = '_CFFI_' + module_name
+     ffi.set_source(module_name, source)
+-    if 1:     # test the .cpp mode too
++    if 0:     # test the .cpp mode too
+         kwds.setdefault('source_extension', '.cpp')
+         source = 'extern "C" {\n%s\n}' % (source,)
+     return recompiler._verify(ffi, module_name, source, *args, **kwds)
+--- cffi-1.1.2/testing/cffi1/test_verify1.py	2015-06-09 03:04:07.000000000 -0700
++++ cffi-1.1.2/testing/cffi1/test_verify1.py	2015-08-12 15:02:07.774160223 -0700
[email protected]@ -18,6 +18,9 @@
+         extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
+         # special things for clang
+         extra_compile_args.append('-Qunused-arguments')
++    elif (sys.platform == 'sunos5'):
++        extra_compile_args = ["-errtags=yes",
++            "-errwarn=E_ASSIGNMENT_TYPE_MISMATCH,E_RETURN_VALUE_TYPE_MISMATCH"]        
+     else:
+         # assume a standard gcc
+         extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
[email protected]@ -75,6 +77,10 @@
+         py.test.skip("needs GCC or Clang")
      ffi = FFI()
-     ffi.cdef("""
-         int (*python_callback)(int how_many, int *values);
--        void *const c_callback;   /* pass this ptr to C routines */
--        int some_c_function(void *cb);
-+        int (*const c_callback)(int,...);   /* pass this ptr to C routines */
-+        int some_c_function(int(*cb)(int,...));
-     """)
-     lib = ffi.verify("""
-         #include <stdarg.h>
+     ffi.cdef(cdef)
++    if sys.platform == 'sunos5':
++        lib = ffi.verify(source, **kargs)
++        return lib
++
+     py.test.raises(VerificationError, ffi.verify, source, **kargs)
+     extra_compile_args_orig = extra_compile_args[:]
+     extra_compile_args.remove('-Wconversion')
[email protected]@ -1726,13 +1732,13 @@
+              ('-123',          4, -1),
+              ('-2147483647-1', 4, -1),
+              ]
+-    if FFI().sizeof("long") == 8:
++    if FFI().sizeof("long") == 8 and sys.platform != 'sunos5':
+         cases += [('4294967296L',        8, 2**64-1),
+                   ('%dUL' % (2**64-1),   8, 2**64-1),
+                   ('-2147483649L',       8, -1),
+                   ('%dL-1L' % (1-2**63), 8, -1)]
+     for hidden_value, expected_size, expected_minus1 in cases:
+-        if sys.platform == 'win32' and 'U' in hidden_value:
++        if sys.platform in ('win32', 'sunos5') and 'U' in hidden_value:
+             continue   # skipped on Windows
+         ffi = FFI()
+         ffi.cdef("enum foo_e { AA, BB, ... };")
[email protected]@ -1740,7 +1746,7 @@
+         assert lib.AA == 0
+         assert lib.BB == eval(hidden_value.replace('U', '').replace('L', ''))
+         assert ffi.sizeof("enum foo_e") == expected_size
+-        if sys.platform != 'win32':
++        if sys.platform not in  ('win32', 'sunos5'):
+             assert int(ffi.cast("enum foo_e", -1)) == expected_minus1
+     # test with the large value hidden:
+     # disabled so far, doesn't work
[email protected]@ -1759,7 +1765,7 @@
+                     (0xffffffff, 'U'),
+                     (maxulong, 'UL'),
+                     (-int(maxulong / 3), 'L')]:
+-        if c2c and sys.platform == 'win32':
++        if c2c and sys.platform in ('win32', 'sunos5'):
+             continue     # enums may always be signed with MSVC
+         ffi = FFI()
+         ffi.cdef("enum foo_e { AA };")
+--- cffi-1.1.2/testing/cffi0/test_ownlib.py	2015-06-09 03:04:07.000000000 -0700
++++ cffi-1.1.2/testing/cffi0/test_ownlib.py	2015-08-12 13:55:21.239982926 -0700
[email protected]@ -1,4 +1,4 @@
+-import py, sys
++import os, py, sys
+ import subprocess, weakref
+ from cffi import FFI
+ from cffi.backend_ctypes import CTypesBackend
[email protected]@ -102,7 +102,6 @@
+         from testing.udir import udir
+         udir.join('testownlib.c').write(SOURCE)
+         if sys.platform == 'win32':
+-            import os
+             # did we already build it?
+             if os.path.exists(str(udir.join('testownlib.dll'))):
+                 cls.module = str(udir.join('testownlib.dll'))
[email protected]@ -129,7 +128,7 @@
+                 cls.module = str(udir.join('testownlib.dll'))
+         else:
+             subprocess.check_call(
+-                'gcc testownlib.c -shared -fPIC -o testownlib.so',
++                os.getenv('TESTOWNLIB_CC') % ('testownlib.c', 'testownlib.so'),
+                 cwd=str(udir), shell=True)
+             cls.module = str(udir.join('testownlib.so'))
+
--- a/components/python/cryptography/Makefile	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/cryptography/Makefile	Wed Sep 23 14:00:51 2015 -0700
@@ -43,26 +43,12 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-#
-# Until enum is available in the build environment, it needs to be built
-# in order for setuptools to work here.
-#
-ENUM=	$(WS_COMPONENTS)/python/enum/build/prototype/$(MACH)/$(PYTHON_LIB)
-
-$(ENUM):
-	(cd ../enum ; $(MAKE) install)
+# Use the CFFI version in the gate because if the CFFI version changes
+# everything using CFFI will break.
+CFFI = $(WS_COMPONENTS)/python/cffi/build/prototype/$(MACH)/$(PYTHON_LIB)
 
-COMPONENT_BUILD_ENV +=		PYTHONPATH=$(ENUM)
-
-COMPONENT_INSTALL_ENV +=	PYTHONPATH=$(ENUM)
-
-$(BUILD_32_and_64):		$(ENUM)
-
-clean::
-	(cd ../enum ; $(MAKE) clean)
-
-clobber::
-	(cd ../enum ; $(MAKE) clobber)
+COMPONENT_BUILD_ENV +=		PYTHONPATH=$(CFFI)
+COMPONENT_INSTALL_ENV +=	PYTHONPATH=$(CFFI)
 
 # common targets
 build:		$(BUILD_32_and_64)
--- a/components/python/cryptography/cryptography-PYVER.p5m	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/cryptography/cryptography-PYVER.p5m	Wed Sep 23 14:00:51 2015 -0700
@@ -168,7 +168,7 @@
 license LICENSE license="Apache 2.0"
 
 # Dependencies on cffi must be incorporated.
-depend type=incorporate fmri=library/python/cffi-$(PYV)@0.8.2
+depend type=incorporate fmri=library/python/cffi-$(PYV)@1.1.2
 
 # force a dependency on the Python runtime
 depend type=require fmri=__TBD pkg.debug.depend.file=python$(PYVER) \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/cryptography/depend.mk	Wed Sep 23 14:00:51 2015 -0700
@@ -0,0 +1,1 @@
+python/cryptography:	python/cffi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/cryptography/patches/dsa.patch	Wed Sep 23 14:00:51 2015 -0700
@@ -0,0 +1,22 @@
+Fix DSA double free. This has been fixed in newer versions of cryptography and
+will be part of a future update of the cryptography version in userland.
+
+https://github.com/pyca/cryptography/pull/2010
+
+--- cryptography-0.8.2/src/cryptography/hazmat/backends/openssl/dsa.py	2015-09-04 11:01:09.332591847 -0700
++++ cryptography-0.8.2/src/cryptography/hazmat/backends/openssl/dsa.py	2015-09-04 11:01:43.317323715 -0700
[email protected]@ -40,13 +40,10 @@
+         self._hash_ctx.update(data)
+ 
+     def verify(self):
+-        self._dsa_cdata = self._backend._ffi.gc(self._public_key._dsa_cdata,
+-                                                self._backend._lib.DSA_free)
+-
+         data_to_verify = self._hash_ctx.finalize()
+ 
+         data_to_verify = _truncate_digest_for_dsa(
+-            self._dsa_cdata, data_to_verify, self._backend
++            self._public_key._dsa_cdata, data_to_verify, self._backend
+         )
+ 
+         # The first parameter passed to DSA_verify is unused by OpenSSL but
--- a/components/python/xattr/Makefile	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/xattr/Makefile	Wed Sep 23 14:00:51 2015 -0700
@@ -43,11 +43,14 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-COMPONENT_INSTALL_ENV +=	PYTHONPATH=$(PROTO_DIR)/$(PYTHON_LIB)
-COMPONENT_TEST_ENV +=		PYTHONPATH=$(PROTO_DIR)/$(PYTHON_LIB)
+CFFI = $(WS_COMPONENTS)/python/cffi/build/prototype/$(MACH)/$(PYTHON_LIB)
+
+COMPONENT_BUILD_ENV +=          PYTHONPATH=$(CFFI)
+COMPONENT_INSTALL_ENV +=	PYTHONPATH=$(CFFI):$(PROTO_DIR)/$(PYTHON_LIB)
+COMPONENT_TEST_ENV +=		PYTHONPATH=$(CFFI):$(PROTO_DIR)/$(PYTHON_LIB)
 # The test suite wants to use some unicode filenames, which don't work in the C
 # locale.
-COMPONENT_TEST_ENV +=	LC_CTYPE=en_US.UTF-8
+COMPONENT_TEST_ENV +=	LC_ALL=en_US.UTF-8
 COMPONENT_TEST_DIR =	$(@D)/tests
 COMPONENT_TEST_CMD =	$(PYTHON) setup.py
 COMPONENT_TEST_ARGS =	test
--- a/components/python/xattr/patches/test.patch	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/xattr/patches/test.patch	Wed Sep 23 14:00:51 2015 -0700
@@ -2,6 +2,10 @@
 them, we shouldn't fail.  Also, we don't support extended attributes on
 symlinks, so just quietly pass that test.
 
+Additionally, fix comparison of lists to dict_keys in Python 3. This has been
+fixed in newer versions of xattr which will be part of a future update of the
+userland version of xattr.
+
 Merged as of 0.7.6.
 
 diff --git a/xattr/tests/test_xattr.py b/xattr/tests/test_xattr.py
@@ -13,14 +17,14 @@
  from unittest import TestCase
  from tempfile import mkdtemp, NamedTemporaryFile
  
[email protected]@ -8,10 +9,19 @@
[email protected]@ -8,9 +9,18 @@
  class BaseTestXattr(object):
      def test_attr(self):
          x = xattr.xattr(self.tempfile)
 -        self.assertEqual(x.keys(), [])
 -        self.assertEqual(x.list(), [])
 -        self.assertEqual(dict(x), {})
- 
++
 +        # Solaris 11 and forward contain system attributes (file flags) in
 +        # extended attributes present on all files, so cons them up into a
 +        # comparison dict.
@@ -29,13 +33,12 @@
 +            d['SUNWattr_ro'] = x['SUNWattr_ro']
 +            d['SUNWattr_rw'] = x['SUNWattr_rw']
 +
-+        self.assertEqual(x.keys(), d.keys())
-+        self.assertEqual(x.list(), d.keys())
++        self.assertEqual(x.keys(), list(d.keys()))
++        self.assertEqual(x.list(), list(d.keys()))
 +        self.assertEqual(dict(x), d)
-+
+ 
          x['user.sopal'] = b'foo'
          x['user.sop.foo'] = b'bar'
-         x[u'user.\N{SNOWMAN}'] = b'not a snowman'
 @@ -38,6 +48,9 @@
          self.assertTrue('user.sop.foo' not in x)
  
--- a/components/python/xattr/xattr-PYVER.p5m	Wed Sep 23 08:28:19 2015 -0700
+++ b/components/python/xattr/xattr-PYVER.p5m	Wed Sep 23 14:00:51 2015 -0700
@@ -46,12 +46,12 @@
 file path=usr/lib/python$(PYVER)/vendor-packages/xattr-$(COMPONENT_VERSION)-py$(PYVER).egg-info/not-zip-safe
 file path=usr/lib/python$(PYVER)/vendor-packages/xattr-$(COMPONENT_VERSION)-py$(PYVER).egg-info/requires.txt
 file path=usr/lib/python$(PYVER)/vendor-packages/xattr-$(COMPONENT_VERSION)-py$(PYVER).egg-info/top_level.txt
-$(PYTHON_2.6_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/64/_cffi__x65092e53xe621c3cb.so
-$(PYTHON_3.4_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/64/_cffi__x7a875355xe621c3cb.so
-$(PYTHON_2.7_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/64/_cffi__x93e1032axe621c3cb.so
+$(PYTHON_2.7_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/64/_cffi__x422b51e3xe621c3cb.so
+$(PYTHON_3.4_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/64/_cffi__xab4d019cxe621c3cb.so
+$(PYTHON_2.6_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/64/_cffi__xb4c37c9axe621c3cb.so
 file path=usr/lib/python$(PYVER)/vendor-packages/xattr/__init__.py
-$(PYTHON_2.6_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/_cffi__x65092e53xe621c3cb.so
-$(PYTHON_2.7_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/_cffi__x93e1032axe621c3cb.so
+$(PYTHON_2.7_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/_cffi__x422b51e3xe621c3cb.so
+$(PYTHON_2.6_ONLY)file path=usr/lib/python$(PYVER)/vendor-packages/xattr/_cffi__xb4c37c9axe621c3cb.so
 file path=usr/lib/python$(PYVER)/vendor-packages/xattr/lib.py
 # The bypass for zlib is temporary until pkgdepend learns about PEP 3149,
 # new in Python 3.x; see 19510349.
@@ -61,7 +61,7 @@
 license LICENSE.txt license=MIT
 
 # Dependencies on cffi must be incorporated.
-depend type=incorporate fmri=library/python/cffi-$(PYV)@0.8.2
+depend type=incorporate fmri=library/python/cffi-$(PYV)@1.1.2
 
 # force a dependency on cffi; pkgdepend work is needed to flush this out.
 depend type=require fmri=library/python/cffi-$(PYV)