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

lockf() is available now on Android API level 24, but the F_LOCK macro is not defined #72948

Closed
xdegaye mannequin opened this issue Nov 21, 2016 · 11 comments
Closed

lockf() is available now on Android API level 24, but the F_LOCK macro is not defined #72948

xdegaye mannequin opened this issue Nov 21, 2016 · 11 comments
Assignees
Labels
3.7 interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Nov 21, 2016

BPO 28762
Nosy @vstinner, @xdegaye, @yan12125
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • bpo-28762: Revert last commit (now using Android Unified Headers) #4488
  • Files
  • test_posix_flock.patch
  • test_posix_lockf_2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/xdegaye'
    closed_at = <Date 2017-11-23.11:02:01.392>
    created_at = <Date 2016-11-21.10:19:49.471>
    labels = ['interpreter-core', 'type-bug', '3.7']
    title = 'lockf() is available now on Android API level 24, but the F_LOCK macro is not defined'
    updated_at = <Date 2017-11-23.11:02:01.391>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2017-11-23.11:02:01.391>
    actor = 'xdegaye'
    assignee = 'xdegaye'
    closed = True
    closed_date = <Date 2017-11-23.11:02:01.392>
    closer = 'xdegaye'
    components = ['Interpreter Core']
    creation = <Date 2016-11-21.10:19:49.471>
    creator = 'xdegaye'
    dependencies = []
    files = ['45582', '45990']
    hgrepos = []
    issue_num = 28762
    keywords = ['patch']
    message_count = 11.0
    messages = ['281344', '283752', '283758', '283759', '283767', '283781', '283785', '283788', '283823', '306634', '306801']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'xdegaye', 'python-dev', 'yan12125']
    pr_nums = ['552', '4488']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28762'
    versions = ['Python 3.6', 'Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 21, 2016

    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'

    @xdegaye xdegaye mannequin added the 3.7 label Nov 21, 2016
    @xdegaye xdegaye mannequin self-assigned this Nov 21, 2016
    @xdegaye xdegaye mannequin added interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Nov 21, 2016
    @yan12125
    Copy link
    Mannequin

    yan12125 mannequin commented Dec 21, 2016

    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

    @vstinner
    Copy link
    Member

    vstinner commented Dec 21, 2016

    The patch fixes the following error:

    Do you mean that the patch adds posix.F_LOCK constant on Android?

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 21, 2016

    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.

    @vstinner
    Copy link
    Member

    vstinner commented Dec 21, 2016

    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.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 21, 2016

    Thanks for the review Victor.

    I have created bpo-29040: building Android with android-ndk-r14.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Dec 21, 2016

    New patch.
    Please use autoreconf before running the patch (autoreconf instead of autoconf because the description of HAVE_LOCKF has been updated).

    @xdegaye xdegaye mannequin changed the 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 Dec 21, 2016
    @vstinner
    Copy link
    Member

    vstinner commented Dec 21, 2016

    The new patch now looks good to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 22, 2016

    New changeset 51b09b10d4f8 by Xavier de Gaye in branch '3.6':
    Issue bpo-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 bpo-28762: Merge 3.6.
    https://hg.python.org/cpython/rev/146157d91283

    @xdegaye xdegaye mannequin closed this as completed Dec 22, 2016
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 21, 2017

    This change is not needed anymore now that Unified Headers are supported by android-ndk-r14 (see bpo-29040)

    @xdegaye xdegaye mannequin reopened this Nov 21, 2017
    @xdegaye xdegaye mannequin added the invalid label Nov 21, 2017
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 23, 2017

    New changeset 5ce1069 by xdegaye in branch 'master':
    bpo-28762: Revert last commit (now using Android Unified Headers) (GH-4488)
    5ce1069

    @xdegaye xdegaye mannequin closed this as completed Nov 23, 2017
    @xdegaye xdegaye mannequin removed the invalid label Nov 23, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant