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

pybind: conditional compile the linux specific constant #12198

Merged
merged 1 commit into from Dec 27, 2016

Conversation

Projects
None yet
2 participants
@tchaikov
Contributor

tchaikov commented Nov 28, 2016

FreeBSD does not have ENODATA, let's follow the example in compat.h,
map ENOATTR to NoData.

Signed-off-by: Kefu Chai kchai@redhat.com

pybind: conditional compile the linux specific constant
FreeBSD does not have ENODATA, let's follow the example in compat.h,
map ENOATTR to NoData.

Signed-off-by: Kefu Chai <kchai@redhat.com>

@tchaikov tchaikov added the pybind label Nov 28, 2016

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Nov 28, 2016

@wjwithagen would you please test this change?

@tchaikov tchaikov referenced this pull request Nov 28, 2016

Merged

FreeBSD: do_freebsd.sh #12090

@wjwithagen

This comment has been minimized.

Contributor

wjwithagen commented Nov 28, 2016

@tchaikov
Day job is rather busy atm. So I'll have a look at it tonight@CET.

@wjwithagen

128: Traceback (most recent call last):
128: File "/home/wjw/wip/build/bin/ceph", line 106, in
128: import rados
128: File "rados.pyx", line 386, in init rados (/home/wjw/wip/build/src/pybind/rados/rados.c:50853)
128: NameError: name 'errno' is not defined

Runtime is not really happy ceph calls.... Not quite sure if it has to do with this patch...

@wjwithagen

This comment has been minimized.

Contributor

wjwithagen commented Nov 28, 2016

@tchaikov
I also needed to add ENOATTR to the cython errno.pxd file.
At my end it lives in:
/usr/local/lib/python2.7/site-packages/Cython/Includes/libc/errno.pxd
Which is about as bad as editing /usr/include/errno.h.

perhaps we can upstream this to Cython?
I have also submitted a patch to FreeBSD to add ENODATA, but progress there is slow. And it will take a long time until it is everywhere. Fortunately it is only important for those that compile themselves.

@wjwithagen

This comment has been minimized.

Contributor

wjwithagen commented Nov 28, 2016

@tchaikov
Other solution is to add compat.h to include/rados/librados.h
That file is included in rados.c
Could even conditionalize it on something like CYTHON_ABI

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Nov 29, 2016

Runtime is not really happy ceph calls.... Not quite sure if it has to do with this patch...

yes, as you noticed, i just realized that cpython does not expose errno.ENOATTR in errno module! see https://github.com/cython/cython/blob/master/Cython/Includes/libc/errno.pxd.

Other solution is to add compat.h to include/rados/librados.h

i don't think this would resolve the errno.ENODATA problem. and i don't really want to ship "compact.h" along with include/rados/librados.h, which is the public interface of librados. and it does not rely on compact.h.

I also needed to add ENOATTR to the cython errno.pxd file.
At my end it lives in:
/usr/local/lib/python2.7/site-packages/Cython/Includes/libc/errno.pxd

then we need to fix this in the Cython upstream, to enable it to work properly in FreeBSD.

@tchaikov tchaikov changed the title from pybind: conditional compile the linux specific constant to [DNM] pybind: conditional compile the linux specific constant Nov 29, 2016

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Nov 29, 2016

i am closing this PR, because we need to fix cython's libc module first.

@tchaikov tchaikov closed this Nov 29, 2016

@tchaikov tchaikov deleted the tchaikov:wip-pybind-freebsd branch Nov 29, 2016

@tchaikov tchaikov restored the tchaikov:wip-pybind-freebsd branch Dec 27, 2016

@tchaikov tchaikov reopened this Dec 27, 2016

@tchaikov tchaikov changed the title from [DNM] pybind: conditional compile the linux specific constant to pybind: conditional compile the linux specific constant Dec 27, 2016

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Dec 27, 2016

cython/cython#1535 got merged. reopening this PR.

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Dec 27, 2016

pushed to ceph-ci.git, shaman builders are happy.

@tchaikov tchaikov merged commit d0a2651 into ceph:master Dec 27, 2016

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@tchaikov tchaikov deleted the tchaikov:wip-pybind-freebsd branch Dec 27, 2016

@wjwithagen

This comment has been minimized.

Contributor

wjwithagen commented Dec 27, 2016

@tchaikov
Thanx, Saves me a patch on master in my builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment