Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: struct stat: wrong size for field 'st_nlink' (cdef says 8, but C compiler says 4) #1372

Closed
andreas-schwab opened this issue Mar 26, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@andreas-schwab
Copy link

commented Mar 26, 2019

  • gevent version: 1.4.0
  • Python version: any
  • Operating System: GNU/Linux

The testsuite fails on riscv64-linux and aarch64-linux:

https://build.opensuse.org/package/live_build_log/openSUSE:Factory:ARM/python-gevent/standard/aarch64

| GEVENT_RESOLVER=thread /usr/bin/python2 -u -mgevent.tests.test__core_stat
  E.E
  ======================================================================
  ERROR: test_unlink (__main__.TestCoreStat)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 48, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 35, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/testing/testcase.py", line 88, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 114, in test_unlink
      self._check_attr('attr', True)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 53, in _check_attr
      x = getattr(self.watcher, name)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/libev/watcher.py", line 274, in attr
      if not self._watcher.attr.st_nlink:
  error: struct stat: wrong size for field 'st_nlink' (cdef says 8, but C compiler says 4). fix it or use "...;" in the cdef for struct stat to make it flexible
  
  ======================================================================
  ERROR: test_write (__main__.TestCoreStat)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 48, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 35, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/testing/testcase.py", line 88, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 106, in test_write
      self._check_attr('attr', False)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 53, in _check_attr
      x = getattr(self.watcher, name)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.aarch64/usr/lib64/python2.7/site-packages/gevent/libev/watcher.py", line 274, in attr
      if not self._watcher.attr.st_nlink:
  error: struct stat: wrong size for field 'st_nlink' (cdef says 8, but C compiler says 4). fix it or use "...;" in the cdef for struct stat to make it flexible
  
  ----------------------------------------------------------------------
  Ran 3 tests in 1.024s
  
  FAILED (errors=2)

https://build.opensuse.org/package/live_build_log/openSUSE:Factory:RISCV/python-gevent/standard/riscv64

| GEVENT_RESOLVER=thread /usr/bin/python2 -u -mgevent.tests.test__core_stat
  E.E
  ======================================================================
  ERROR: test_unlink (__main__.TestCoreStat)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 48, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 35, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/testing/testcase.py", line 88, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 114, in test_unlink
      self._check_attr('attr', True)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 53, in _check_attr
      x = getattr(self.watcher, name)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/libev/watcher.py", line 274, in attr
      if not self._watcher.attr.st_nlink:
  error: struct stat: wrong size for field 'st_nlink' (cdef says 8, but C compiler says 4). fix it or use "...;" in the cdef for struct stat to make it flexible
  
  ======================================================================
  ERROR: test_write (__main__.TestCoreStat)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 48, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/testing/errorhandler.py", line 35, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/testing/testcase.py", line 88, in wrapper
      return method(self, *args, **kwargs)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 106, in test_write
      self._check_attr('attr', False)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/tests/test__core_stat.py", line 53, in _check_attr
      x = getattr(self.watcher, name)
    File "/home/abuild/rpmbuild/BUILDROOT/python-gevent-1.4.0-3.1.riscv64/usr/lib64/python2.7/site-packages/gevent/libev/watcher.py", line 274, in attr
      if not self._watcher.attr.st_nlink:
  error: struct stat: wrong size for field 'st_nlink' (cdef says 8, but C compiler says 4). fix it or use "...;" in the cdef for struct stat to make it flexible
  
  ----------------------------------------------------------------------
  Ran 3 tests in 1.094s
  
  FAILED (errors=2)

jamadden added a commit that referenced this issue Mar 27, 2019

libev-cffi: Use nlink_t and let the compiler fill in the definition.
Fixes #1372.

This may require a slightly stricter adherance to POSIX? It is defined by IEEE Std 1003.1 2004 (http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/types.h.html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.