Issue 28762: lockf() is available now on Android API level 24, but the F_LOCK macro is not defined (original) (raw)

Created on 2016-11-21 10:19 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_posix_flock.patch xdegaye,2016-11-21 10:19 review
test_posix_lockf_2.patch xdegaye,2016-12-21 21:09 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft,2017-03-31 16:36
PR 4488 merged xdegaye,2017-11-21 09:05
Messages (11)
msg281344 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-11-21 10:19
The patch fixes the following error: ====================================================================== ERROR: test_lockf (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_posix.py", line 195, in test_lockf posix.lockf(fd, posix.F_LOCK, 4) AttributeError: module 'posix' has no attribute 'F_LOCK'
msg283752 - (view) Author: (yan12125) * Date: 2016-12-21 12:36
FYI: Since Android NDK r14 beta1, F_LOCK is defined in unified headers. [1] In $ANDROID_NDK/sysroot/usr/include/bits/lockf.h: #define F_ULOCK 0 #define F_LOCK 1 #define F_TLOCK 2 #define F_TEST 3 [1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md
msg283758 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-12-21 14:54
> The patch fixes the following error: Do you mean that the patch adds posix.F_LOCK constant on Android?
msg283759 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-12-21 15:12
No, the patch prevents posix.flock() to be defined on Android API 24 with android-ndk-r13. But I plan to change it so that the test is skipped when posix does not have the F_LOCK attribute as this problem is not worth a change in the build machinery. It makes even more sense now that android-ndk-r14 will be released with "Unified Headers". BTW thanks Chi Hsuan Yen for this important information.
msg283767 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-12-21 16:28
Oh ok, the issue is more subtle than what I understood. I reviewed test_posix_flock.patch and proposed some changes to the comment/doc.
msg283781 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-12-21 20:33
Thanks for the review Victor. I have created issue 29040: building Android with android-ndk-r14.
msg283785 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-12-21 21:09
New patch. Please use autoreconf before running the patch (autoreconf instead of autoconf because the description of HAVE_LOCKF has been updated).
msg283788 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-12-21 21:57
The new patch now looks good to me.
msg283823 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-12-22 09:41
New changeset 51b09b10d4f8 by Xavier de Gaye in branch '3.6': Issue #28762: lockf() is available on Android API level 24, but the https://hg.python.org/cpython/rev/51b09b10d4f8 New changeset 146157d91283 by Xavier de Gaye in branch 'default': Issue #28762: Merge 3.6. https://hg.python.org/cpython/rev/146157d91283
msg306634 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-21 09:06
This change is not needed anymore now that Unified Headers are supported by android-ndk-r14 (see issue 29040)
msg306801 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-23 11:01
New changeset 5ce1069a6ff0d5443074d33ba1d403ccd2eaf3d3 by xdegaye in branch 'master': bpo-28762: Revert last commit (now using Android Unified Headers) (GH-4488) https://github.com/python/cpython/commit/5ce1069a6ff0d5443074d33ba1d403ccd2eaf3d3
History
Date User Action Args
2022-04-11 14:58:39 admin set github: 72948
2017-11-23 11:02:01 xdegaye set status: open -> closedresolution: not a bug -> fixedstage: patch review -> resolved
2017-11-23 11:01:43 xdegaye set messages: +
2017-11-21 09:07:00 xdegaye set status: closed -> openresolution: fixed -> not a bugmessages: + stage: resolved -> patch review
2017-11-21 09:05:27 xdegaye set pull_requests: + <pull%5Frequest4426>
2017-03-31 16:36:07 dstufft set pull_requests: + <pull%5Frequest829>
2016-12-22 11:28:02 xdegaye set status: open -> closedresolution: fixedstage: patch review -> resolved
2016-12-22 09:41:19 python-dev set nosy: + python-devmessages: +
2016-12-21 21:57:17 vstinner set messages: +
2016-12-21 21:09:38 xdegaye set files: + test_posix_lockf_2.patchmessages: + title: configure links with lockf and F_LOCK is not declared in Android API 24 -> lockf() is available now on Android API level 24, but the F_LOCK macro is not defined
2016-12-21 20:33:03 xdegaye set messages: +
2016-12-21 16:28:18 vstinner set messages: +
2016-12-21 15:12:02 xdegaye set messages: +
2016-12-21 14:54:58 vstinner set nosy: + vstinnermessages: +
2016-12-21 12:36:55 yan12125 set nosy: + yan12125messages: +
2016-11-21 15:40:04 xdegaye link issue26865 dependencies
2016-11-21 10:19:49 xdegaye create