GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — failure building Python 3.15.0a3 through 3.15.0 release on Alpine · Issue #143632 · python/cpython

failure building Python 3.15.0a3 through 3.15.0 release on Alpine #143632

New issue
Copy link
New issue
Copy link
Open
#143730
Open
failure building Python 3.15.0a3 through 3.15.0 release on Alpine#143632
#143730
Copy link
Labels
OS-unsupportedbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@yosifkit
yosifkit
opened on Jan 9, 2026
Issue body actions

When building Python 3.15.0a3 - 3.15.0 on Alpine Linux 3.23 (or 3.24) (musl libc) on certain architectures, the build fails with error: redefinition of 'struct prctl_mm_map' (full error below).

This is related to the changes added in #142079. TL;DR: in musl libc, some kernel structs are redefined in the musl-provided headers. In this case sys/prctl.h redefines a struct in linux/prctl.h; see also https://wiki.musl-libc.org/faq.html#Q:-Why-am-I-getting-.

Configure setup:

gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
./configure \
	--build="$gnuArch" \
	--enable-loadable-sqlite-extensions \
	--enable-option-checking=fatal \
	--enable-shared \
	--with-lto \
	--with-ensurepip

# --with-lto is not used on riscv64

Make lines, per architecture:

# nproc is used for the number of jobs, so it varies by system
# amd64 and arm64v8
make -j 8 'EXTRA_CFLAGS=-DTHREAD_STACK_SIZE=0x100000 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' 'LDFLAGS=-Wl,--strip-all'
# i386 (x86)
make -j 8 'EXTRA_CFLAGS=-DTHREAD_STACK_SIZE=0x100000' 'LDFLAGS=-Wl,--strip-all'
# arm32v6, arm32v7, ppc64le, riscv64, s390x
make -j 8 'EXTRA_CFLAGS=-DTHREAD_STACK_SIZE=0x100000 -fno-omit-frame-pointer' 'LDFLAGS=-Wl,--strip-all' 

When building on arm32v6, arm32v7, i386, and ppc64le, the configure check for PR_SET_VMA_ANON_NAME succeeds and so it is attempted to be used during build, but during build, it fails with the following error:

$ # configure line:
checking whether PR_SET_VMA_ANON_NAME is declared... yes
$ # build error during "make"
In file included from ./Include/internal/pycore_mmap.h:25,
                 from Objects/obmalloc.c:5:
/usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
   88 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~
In file included from ./Include/internal/pycore_mmap.h:24:
/usr/include/linux/prctl.h:134:8: note: originally defined here
  134 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~

But on amd64, arm64v8, riscv64, and s390x (or any arch on Alpine 3.22), the same error is encountered during the configure check, so the feature is disabled, and it doesn't cause a build error.

$ # configure.log
configure:23951: checking whether PR_SET_VMA_ANON_NAME is declared
configure:23951: gcc -c    conftest.c >&5
In file included from conftest.c:415:
/usr/include/sys/prctl.h:103:1: error: redefinition of struct or union 'struct prctl_mm_map'
  103 | };
      | ^
In file included from conftest.c:414:
/usr/include/linux/prctl.h:134:8: note: originally defined here
  134 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~
configure:23951: $? = 1

So, what is weird to me, is that the AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME], succeeded on some architectures and then the same set of includes failed when in Include/internal/pycore_mmap.h. But also, this new feature is silently disabled (even if available in the kernel headers) because the configure check fails on Alpine because of the redefined struct in musl libc.

I think an #ifdef __GLIBC__ or similar could be used to only include both headers when using glibc, but maybe it is more complex than that.


Full build setup: https://github.com/docker-library/python/blob/ac65a0ec34172eb865a8cef47fed3dc71a38d419/3.15-rc/alpine3.23/Dockerfile
Full build log: https://doi-janky.infosiftr.net/job/meta/view/builds/job/arm32v7/job/build/88902/console

Linked PRs

  • gh-143632: Disable PR_SET_VMA_ANON_NAME on musl libc #143730
  • gh-143632: Skip unittest for mmap.set_name at musl environment #143839
  • gh-143632: Detect availability of PR_SET_VMA at runtime (fixes build with musl libc) #148771
  • gh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME #159886
  • [3.15] gh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME (GH-159886) #159919

Activity

Next
  1. picnixz
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    buildThe build process and cross-buildThe build process and cross-build
    OS-unsupported
    on Jan 10, 2026
  2. github-project-automation
    added this to Unsupported platformson Jan 10, 2026
  3. corona10
    added 2 commits that reference this issue on Jan 14, 2026

    pythongh-143632: Skip unittest for mmap.set_name at musl environment

    995fbff

    gh-143632: Disable PR_SET_VMA_ANON_NAME on musl libc (gh-143730)

    14f96a8
  4. corona10
    closed this as completedin #143730on Jan 14, 2026
  5. github-project-automation
    moved this to Done in Unsupported platformson Jan 14, 2026
  6. corona10
    added a commit that references this issue on Jan 15, 2026

    gh-143632: Skip unittest for mmap.set_name at musl environment (gh-14…

    a73ba4d
  7. thunder-coding
    added 2 commits that reference this issue on Feb 15, 2026

    pythongh-143632: Disable PR_SET_VMA_ANON_NAME on musl libc (pythongh-…

    1a472c2

    pythongh-143632: Skip unittest for mmap.set_name at musl environment (p…

    8f8607a
  8. tianon commented on Mar 20, 2026

    @tianon
    tianon
    on Mar 20, 2026
    More actions

    We're still seeing failures that look like this while building python:3.15.0a7-alpine3.23 on arm32v6, arm32v7, i386, and ppc64le 🤔

    In file included from ./Include/internal/pycore_mmap.h:16,
                     from Objects/obmalloc.c:5:
    /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
       88 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    In file included from ./Include/internal/pycore_mmap.h:15:
    /usr/include/linux/prctl.h:134:8: note: originally defined here
      134 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
  9. yosifkit commented on Apr 8, 2026

    @yosifkit
    yosifkit
    on Apr 8, 2026
    Author
    More actions

    I'm still able to reproduce the issue on Python 3.15.0a4 through 3.15.0a8. The fix was applied to a6, a7, and a8, but it doesn't seem to be working since the failure is still happening.

    In file included from ./Include/internal/pycore_mmap.h:16,
                     from Objects/obmalloc.c:5:
    /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
       88 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    In file included from ./Include/internal/pycore_mmap.h:15:
    /usr/include/linux/prctl.h:134:8: note: originally defined here
      134 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
  10. vstinner commented on Apr 8, 2026

    @vstinner
    vstinner
    on Apr 8, 2026
    Member
    More actions

    The fix was applied to a6, a7, and a8, but it doesn't seem to be working since the failure is still happening.

    The fix uses $ac_cv_libc variable in configure.ac but this variable is unset: #143730 (comment).

    Reacted by yosifkit
  11. tianon commented on Jul 10, 2026

    @tianon
    tianon
    on Jul 10, 2026
    More actions

    Can this be reopened? 😅

  12. 1 remaining item

  13. yosifkit commented on Jul 10, 2026

    @yosifkit
    yosifkit
    on Jul 10, 2026
    Author
    More actions

    Yes, the current python 3.15.0b3 (and every version newer than 3.15.0a2) still fail to build within an Alpine environment on arm32v6, arm32v7, i386, and ppc64le with the same error. Perhaps #148771 is the possible fix for this?

    In file included from ./Include/internal/pycore_mmap.h:16,
                     from Objects/obmalloc.c:5:
    /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
       88 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    In file included from ./Include/internal/pycore_mmap.h:15:
    /usr/include/linux/prctl.h:134:8: note: originally defined here
      134 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
  14. vstinner commented on Jul 10, 2026

    @vstinner
    vstinner
    on Jul 10, 2026
    Member
    More actions

    Ok, I reopen the issue.

  15. vstinner
    reopened this on Jul 10, 2026
  16. yosifkit commented on Aug 13, 2026

    @yosifkit
    yosifkit
    on Aug 13, 2026
    Author
    More actions

    Just an update that the latest python versions, 3.15.0rc2, 3.15.0rc1, and 3.15.0b4, also fail to build within an Alpine environment on arm32v6, arm32v7, i386, and ppc64le with the same error.

    In file included from ./Include/internal/pycore_mmap.h:16,
                     from Objects/obmalloc.c:5:
    /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
       88 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    In file included from ./Include/internal/pycore_mmap.h:15:
    /usr/include/linux/prctl.h:134:8: note: originally defined here
      134 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
  17. vstinner commented on Aug 14, 2026

    @vstinner
    vstinner
    on Aug 14, 2026
    Member
    More actions

    cc @bitdancer @zware

  18. yosifkit
    changed the title [-]failure building Python 3.15.0a3 on Alpine[/-] [+]failure building Python 3.15.0a3 through 3.15.0 release on Alpine[/+] on Oct 13, 2026
  19. yosifkit commented on Oct 13, 2026

    @yosifkit
    yosifkit
    on Oct 13, 2026
    Author
    More actions

    Just an update that this is still a problem with the 3.15.0 GA release. It fails to build within an Alpine environment on arm32v6, arm32v7, i386, and ppc64le with the same error. A fix is available in #148771.

    In file included from ./Include/internal/pycore_mmap.h:16,
                     from Objects/obmalloc.c:5:
    /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
       88 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    In file included from ./Include/internal/pycore_mmap.h:15:
    /usr/include/linux/prctl.h:134:8: note: originally defined here
      134 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    make: *** [Makefile:3423: Objects/obmalloc.o] Error 1
  20. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
  21. github-project-automation
    moved this to Todo in Project_VKon Oct 18, 2026
  22. github-project-automation
    moved this from Todo to In progress in Project_VKon Oct 18, 2026
  23. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
  24. serhiy-storchaka
    added a commit that references this issue on Oct 20, 2026

    pythongh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME

    dd58805
  25. serhiy-storchaka commented on Oct 20, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Oct 20, 2026
    Member
    More actions

    The guard added in gh-143730 never takes effect: it tests $ac_cv_libc, which is not set anywhere in configure.ac, so AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME]) always runs.

    That is also what "certain architectures" comes down to. On x86_64 musl the conftest fails to compile by itself, so the macro stays undefined and the build works by accident. On i686 musl it compiles: uint64_t and __u64 are both unsigned long long there, and C23 tag compatibility allows the two identical definitions, since conftests use gcc's default -std=gnu23. The macro is then defined and the build fails, because CPython compiles with -std=c11, where the redefinition is an error.

    Workaround: ./configure ac_cv_have_decl_PR_SET_VMA_ANON_NAME=no.

    Reacted by Neko Asakura
  26. serhiy-storchaka
    added 2 commits that reference this issue on Oct 20, 2026

    gh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME (GH-159886)

    f37e821

    [3.15] gh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME (GH-159886

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Unsupported platforms
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.