Skip to content

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

Closed

Description

@xdegaye
mannequin
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']

    Activity

    1. xdegaye commented on Nov 21, 2016

      xdegayemannequin
      MannequinAuthor

      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'
    2. self-assigned this
      on Nov 21, 2016
    3. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-bugAn unexpected behavior, bug, or error
      on Nov 21, 2016
    4. yan12125 commented on Dec 21, 2016

      yan12125mannequin
      Mannequin

      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

    5. vstinner commented on Dec 21, 2016

      @vstinner
      Member

      The patch fixes the following error:

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

    6. xdegaye commented on Dec 21, 2016

      xdegayemannequin
      MannequinAuthor

      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.

    7. vstinner commented on Dec 21, 2016

      @vstinner
      Member

      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.

    8. xdegaye commented on Dec 21, 2016

      xdegayemannequin
      MannequinAuthor

      Thanks for the review Victor.

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

    9. xdegaye commented on Dec 21, 2016

      xdegayemannequin
      MannequinAuthor

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

    10. 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[/+] on Dec 21, 2016
    11. vstinner commented on Dec 21, 2016

      @vstinner
      Member

      The new patch now looks good to me.

    12. python-dev commented on Dec 22, 2016

      python-devmannequin
      Mannequin

      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

    13. xdegaye commented on Nov 21, 2017

      xdegayemannequin
      MannequinAuthor

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

    14. xdegaye commented on Nov 23, 2017

      xdegayemannequin
      MannequinAuthor

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

    15. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions