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
musslinux: Always (un)pack structs as little endian #473
Conversation
Fixes problems on big endian architectures -- native order is used by default otherwise. Fixes pypa#472
Disclaimer: I have no idea if this works if a musl binary for big endian system exists (ever). But it fixes the current test failures. |
I have no idea what a musl binary should look like on BE either, but judging from how If my assumption is correct (no guarantees), the current implementation is probably correct (without this PR), and it's the test binaries we're using that need fixing. |
Converted to draft then. |
I tested this change on Debian unstable/s390x and it introduces a number of regressions:
|
@glaubitz If you have access to a Big Endian machine, could you compile the test binaries (see |
I do. Will give it a try. |
--- a/tests/musllinux/build.sh
+++ b/tests/musllinux/build.sh
@@ -18,23 +18,20 @@ build_one_in_ubuntu () {
}
build_one_in_alpine () {
- $1 "multiarch/alpine:${2}-${ALPINE_VERSION}" \
+ $1 "s390x/alpine" \
sh "/home/hello-world/musllinux/build.sh" musl "musl-${2}"
}
build_in_container () {
local SOURCE="$(dirname $(dirname $(realpath ${BASH_SOURCE[0]})))"
- DOCKER="docker run --rm -v ${SOURCE}:/home/hello-world"
+ DOCKER="podman run --security-opt label=disable --rm -v ${SOURCE}:/home/hello-world"
if [[ $# -ne 0 ]]; then
"build_one_in_${1}" "$DOCKER" "$2"
return
fi
- build_one_in_alpine "$DOCKER" x86_64
- build_one_in_alpine "$DOCKER" i386
- build_one_in_alpine "$DOCKER" aarch64
- build_one_in_ubuntu "$DOCKER" x86_64
+ build_one_in_alpine "$DOCKER" s390x
} |
FWIW I can run that script like that from an s390x machine as well as from an x86_64 machine and the result is identical. |
Yup the executable is in BE. It seems that the part getting the interpreter string isn’t quite right, I’ll submit a patch later for it. The problem is how we can structure the tests so they cover both endians. Do we need to? |
@hroncok did you want to handle the merge conflicts and take this out of draft? |
Honestly, I don't know what this is about any more. I'll try to check it out, but there's always too many things to care about :( |
I think #538 covers this one (with a different approach but the same result) |
@hroncok I'm going to go ahead and close this then with the assumption that Tzu-Ping is right that it's already fixed. Thanks for trying to fix the issue! |
Verified in #472 (comment) |
Fixes problems on big endian architectures --
native order is used by default otherwise.
Fixes #472