tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Help with Python cffi module (for sysutils/py-augeas)



Hi!

I have prepared an update for sysutils/py-augeas to the current
version, 1.0.3. The patch I have so far is in
https://gist.github.com/bsiegert/4f39cf6ebb3e579ff4eaee3ea0d26e42.

The module has switched from rolling its own dlopen (for which we had
a patch) to the cffi module. Unfortunately, on my system (Linux), the
setup script does not find the library:

(cd /usr/local/pkgsrc/sysutils/py-augeas/work/python-augeas-1.0.3/ &&
/usr/bin/env USETOOLS=no PTHREAD_CFLAGS=\ -pthread\  PTHREAD_$
DFLAGS=\ -pthread PTHREAD_LIBS=-lpthread\ -lrt PTHREADBASE=/usr
DL_CFLAGS= DL_LDFLAGS= DL_LIBS= PYTHON=/usr/local/pkg/bin/python3.6
CC=cc CFLAGS=-O2\ -D_FORTIFY_SOURCE=2\ -I/usr/local/pkg/include\
-I/usr/include\ -I/usr/local/pkg/include/python3.6 CPPFLAGS=-I/usr$
local/pkg/include\ -I/usr/include\ -I/usr/local/pkg/include/python3.6
CXX=c++ CXXFLAGS=-O2\ -D_FORTIFY_SOURCE=2\ -I/usr/local/pkg/i$
clude\ -I/usr/include\ -I/usr/local/pkg/include/python3.6
COMPILER_RPATH_FLAG=-Wl,-R F77=gfortran FC=gfortran FFLAGS=-O LANG=C
LC_A$
L=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C
LC_TIME=C LDFLAGS=-L/usr/local/pkg/lib\ -Wl,-R/usr/local/pkg/l$
b\ -L/usr/lib64\ -Wl,-R/usr/lib64 LINKER_RPATH_FLAG=-R
PATH=/usr/local/pkgsrc/sysutils/py-augeas/work/.cwrapper/bin:/usr/local/pkgs$
c/sysutils/py-augeas/work/.buildlink/bin:/usr/local/pkgsrc/sysutils/py-augeas/work/.gcc/bin:/usr/local/pkgsrc/sysutils/py-augeas/wo$
k/.tools/bin:/usr/local/pkg/bin:/usr/local/pkg/sbin:/usr/local/pkg/bin:/usr/local/pkg/gnu/bin:/usr/local/pkg/sbin:/usr/local/pkg/bi$
:/usr/local/pkg/gnu/bin:/usr/local/pkg/sbin:/usr/local/pkg/bin:/usr/local/pkg/gnu/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/lo$
al/pkg/bin:/usr/local/pkg/bin PREFIX=/usr/local/pkg MAKELEVEL=0
CONFIG_SITE= PKG_SYSCONFDIR=/usr/local/pkg/etc CXXCPP=cpp HOME=/usr$
local/pkgsrc/sysutils/py-augeas/work/.home
CWRAPPERS_CONFIG_DIR=/usr/local/pkgsrc/sysutils/py-augeas/work/.cwrapper/config
CPP=cpp $
OCALBASE=/usr/local/pkg X11BASE=/usr/local/pkg PKGMANDIR=man
PKGINFODIR=info PKGGNUDIR=gnu/ MAKECONF=/dev/null OBJECT_FMT=ELF
USETO$
LS=no BSD_INSTALL_PROGRAM=/usr/bin/install\ -c\ -s\ -o\ chronos\ -g\
chronos\ -m\ 755 BSD_INSTALL_SCRIPT=/usr/bin/install\ -c\ -o\ $
hronos\ -g\ chronos\ -m\ 755 BSD_INSTALL_LIB=/usr/bin/install\ -c\ -o\
chronos\ -g\ chronos\ -m\ 755 BSD_INSTALL_DATA=/usr/bin/inst$
ll\ -c\ -o\ chronos\ -g\ chronos\ -m\ 644
BSD_INSTALL_MAN=/usr/bin/install\ -c\ -o\ chronos\ -g\ chronos\ -m\
644 BSD_INSTALL=/usr/b
in/install BSD_INSTALL_PROGRAM_DIR=/usr/bin/install\ -d\ -o\ chronos\
-g\ chronos\ -m\ 755 BSD_INSTALL_SCRIPT_DIR=/usr/bin/install\
-d\ -o\ chronos\ -g\ chronos\ -m\ 755
BSD_INSTALL_LIB_DIR=/usr/bin/install\ -d\ -o\ chronos\ -g\ chronos\
-m\ 755 BSD_INSTALL_DATA_D
IR=/usr/bin/install\ -d\ -o\ chronos\ -g\ chronos\ -m\ 755
BSD_INSTALL_MAN_DIR=/usr/bin/install\ -d\ -o\ chronos\ -g\ chronos\
-m\ 7
55 BSD_INSTALL_GAME=/usr/bin/install\ -c\ -s\ -o\ chronos\ -g\
chronos\ -m\ 0755 BSD_INSTALL_GAME_DATA=/usr/bin/install\ -c\ -o\ chr
onos\ -g\ chronos\ -m\ 0644 BSD_INSTALL_GAME_DIR=/usr/bin/install\ -d\
-o\ chronos\ -g\ chronos\ -m\ 0755 INSTALL_INFO= MAKEINFO=/us
r/local/pkgsrc/sysutils/py-augeas/work/.tools/bin/makeinfo FLEX=
BISON= PKG_CONFIG= PKG_CONFIG_LIBDIR=/usr/local/pkgsrc/sysutils/py-
augeas/work/.buildlink/lib64/pkgconfig:/usr/local/pkgsrc/sysutils/py-augeas/work/.buildlink/lib/pkgconfig:/usr/local/pkgsrc/sysutils
/py-augeas/work/.buildlink/share/pkgconfig
PKG_CONFIG_LOG=/usr/local/pkgsrc/sysutils/py-augeas/work/.pkg-config.log
PKG_CONFIG_PATH=
 CWRAPPERS_CONFIG_DIR=/usr/local/pkgsrc/sysutils/py-augeas/work/.cwrapper/config
/usr/local/pkg/bin/python3.6  setup.py  build )
Traceback (most recent call last):

  File "setup.py", line 23, in <module>
    url = "http://augeas.net/";,
  File "/usr/local/pkg/lib/python3.6/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/local/pkg/lib/python3.6/site-packages/setuptools/dist.py",
line 338, in __init__
    _Distribution.__init__(self, attrs)
  File "/usr/local/pkg/lib/python3.6/distutils/dist.py", line 281, in __init__
    self.finalize_options()
  File "/usr/local/pkg/lib/python3.6/site-packages/setuptools/dist.py",
line 471, in finalize_options
    ep.load()(self, ep.name, value)
  File "/usr/local/pkg/lib/python3.6/site-packages/cffi/setuptools_ext.py",
line 188, in cffi_modules
    add_cffi_module(dist, cffi_module)
  File "/usr/local/pkg/lib/python3.6/site-packages/cffi/setuptools_ext.py",
line 49, in add_cffi_module
    execfile(build_file_name, mod_vars)
  File "/usr/local/pkg/lib/python3.6/site-packages/cffi/setuptools_ext.py",
line 25, in execfile
    exec(code, glob, glob)
  File "augeas/ffi.py", line 42, in <module>
    lib = ffi.dlopen("augeas")
  File "/usr/local/pkg/lib/python3.6/site-packages/cffi/api.py", line
141, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/usr/local/pkg/lib/python3.6/site-packages/cffi/api.py", line
795, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/usr/local/pkg/lib/python3.6/site-packages/cffi/api.py", line
790, in _load_backend_lib
    raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library
called 'augeas'
*** Error code 1

I am not familiar at all with cffi, and I am not confident this is not
just a local issue. FWIW, the library appears in work/.buildlink just
fine.

Ideas?

--Benny.


Home | Main Index | Thread Index | Old Index