-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 #90548
Comments
I'm getting multiple test failures with latest Alpine 3.15 and musl-1.2.2-r7. Some test failures may be caused by wrong assumptions in our tests, some might be bugs in musl lib.c 9 tests failed: I have attached the output of ./python -m test -v test__locale test_c_locale_coercion test_cmd_line test_gdb test_locale test_os test_posix test_re test_selectors 2>&1 | tee alpine315-tests.txt You can use my container to reproduce the test failures: $ podman run --privileged -ti --rm -v $(pwd):/cpython:Z quay.io/tiran/cpythonbuild:alpine-3.15 /bin/sh
# /cmd.sh
# cd /cpython/builddep/alpine-3.15-x86_64/
# make test |
These tests seems to be expected to fail on alpine. |
I would put it differently: The package maintainer of Python on Alpine decided to ignore all test failures in these test modules. |
The first alpine315-tests.txt appears to be a truncated version of the second. Were you expecting the first to be automatically replaced? Should it be unlinked? https://www.alpinelinux.org "Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox." Fron the doc linked above: # Maintainer: Natanael Copa <[email protected]> ## I nosied Natanael at his CLA-signed Alpine id. Should we change CPython tests to accommodate things that are missing (versus buggy). Should the tests requiring sched_[gs]etscheduler be skipped if missing? Or are they required to be 'posix' and is test_posix meant to test completeness as well as correctness of what is present? |
In my opinion we should treat these issues as Alpine / musl libc platform bugs and ask the Alpine maintainers to look into the issue. The tests are passing on Linux with glibc and BSD platforms (FreeBSD, macOS, ...) with BSD libc. It is reasonable to assume that failing test are caused by incompatibilities or deficiencies in musl libc, or by a different interpretation of POSIX and Open Group standards. I would not ignore or skip any test unless we have a thorough understanding of the problem and the deviation is documented. The issue can also affect user code. Python's test suite is exhaustive. Our tests have found a fair amount of problems in e.g, libm. A couple of years ago ine of my AF_ALG socket tests even found a Kernel bug by triggered a Kernel fault. |
The comment about sched_[gs]etscheduler seems to be outdated. For one CPython's test suite has a @requires_sched decorator that performs a check for sched_getscheduler and the Kernel syscall. musl libc in Alpine 3.13 and 3.15 have sched_setscheduler. |
BTW, we do have an Alpine buildbot worker in the unstable set, running only on the |
GH-92826 is a compiler or musl libc issue on Alpine that manifests on PPC64LE platforms. |
FYI neither Alpine nor musl are covered by PEP 11 (PPC64LE is tier-2, though). |
FWIW, I visually spot-checked each instance of If we ignore the Locale-related failures, here are the two failures I'm seeing that remain:
These certainly seem worrying, but not "the build is totally invalid and shouldn't exist" levels of worrying (which is what I was looking at this to evaluate -- namely whether https://github.com/docker-library/python can reasonably continue to provide Alpine-based builds or whether we should deprecate and remove them). To be very clear, I don't have any good opinions on what CPython maintainers should do here (and in fact would love to follow any recommendations, including deprecating these builds anyhow, if that's the consensus), but I went through some of the data and figured it'd be worth noting the data points I found. 🙇 ❤️ |
FWIW I'm invested in keeping python working on alpine. I'll propose it for tier 3 when the tests actually pass ;) test_fma is dealt with and I've proposed PR gh-131313 that will fix some other test failures by building on the parallel musl "fixes" for emscripten/wasi (including test_fpathconf, which is arguably not a musl bug), but there are more to go ;) |
* Make musl test skips smarter (fixes Alpine errors) A relatively small number of tests fail when the underlying c library is provided by musl. This was originally reported in bpo-46390 by Christian Heimes. Among other changes, these tests were marked for skipping in gh-31947/ef1327e3 as part of bpo-40280 (emscripten support), but the skips were conditioned on the *platform* being emscripten (or wasi, skips for which ere added in 9b50585). In gh-131071 Victor Stinner added a linked_to_musl function to enable skipping a test in test_math that fails under musl, like it does on a number of other platforms. This check can successfully detect that python is running under musl on Alpine, which was the original problem report in bpo-46390. This PR replaces Victor's solution with an enhancement to platform.libc_ver that does the check more cheaply, and also gets the version number. The latter is important because the math test being skipped is due to a bug in musl that has been fixed, but as of this checkin date has not yet been released. When it is, the test skip can be fixed to check for the minimum needed version. The enhanced version of linked_to_musl is also used to do the skips of the other tests that generically fail under musl, as opposed to emscripten or wasi only failures. This will allow these tests to be skipped automatically on Alpine. This PR does *not* enhance libc_ver to support emscripten and wasi, as I'm not familiar with those platforms; instead it returns a version triple of (0, 0, 0) for those platforms. This means the musl tests will be skipped regardless of musl version, so ideally someone will add support to libc_ver for these platforms. * Platform tests and bug fixes. In adding tests for the new platform code I found a bug in the old code: if a valid version is passed for version and it is greater than the version found for an so *and* there is no glibc version, then the version from the argument was returned. The code changes here fix that. * Add support docs, including for some preexisting is_xxx's. * Add news item about libc_ver enhancement. * Prettify platform re expression using re.VERBOSE.
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:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: