Bug#1030676: pysdl2: autopkgtest failure on s390x

2023-02-09 Thread James Addison
Source: pysdl2
Followup-For: Bug #1030676

On Tue, 07 Feb 2023 at 21:07:50 +, Simon McVittie wrote:
> I have intentionally not uploaded those versions to unstable when doing
> team-uploads to stop it from regressing and blocking libsdl2, because
> I have no good way to test them: nothing in Debian depends on pysdl2,
> and I'm not actively using it for any non-Debian software.

Thanks, Simon - I hadn't considered the reasons why it might make sense _not_
for more recent versions to have been uploaded, and wanted to ensure that your
investigation work upstream (which I read through) was linked from the bug.

Agreed that RC this probably was not (although who knows, perhaps we'll learn
of an appreciative s390x gamer some day).



Bug#1030676: pysdl2: autopkgtest failure on s390x

2023-02-07 Thread Simon McVittie
On Mon, 06 Feb 2023 at 13:00:22 +0100, Gianfranco Costamagna wrote:
> Hello, as shown in e.g. 
> https://ci.debian.net/data/autopkgtest/unstable/s390x/p/pysdl2/30731752/log.gz
> autopkgtests are failing probably due to a Big Endian issue

I don't think this is a real regression: the tests haven't passed on
s390x since 2021, at which point they were much shorter (30 seconds
rather than 2 minutes) and presumably had less coverage.

Given that pysdl2 is a game-related library and s390x machines are
~ $15K mainframes not known for their suitability for gaming, I'm not
convinced this should be RC.

On Tue, 07 Feb 2023 at 11:06:56 +, James Addison wrote:
> It looks like this has been fixed upstream in version 0.9.12 of the library.

I have intentionally not uploaded those versions to unstable when doing
team-uploads to stop it from regressing and blocking libsdl2, because
I have no good way to test them: nothing in Debian depends on pysdl2,
and I'm not actively using it for any non-Debian software.

Unfortunately backporting test fixes from newer versions tends to be a
pain because upstream have re-indented all the tests, but I'll see what
I can do.

smcv



Bug#1030676: pysdl2: autopkgtest failure on s390x

2023-02-07 Thread James Addison
Source: pysdl2
Followup-For: Bug #1030676
Control: forwarded -1 https://github.com/py-sdl/py-sdl2/issues/227
Control: tags -1 fixed-upstream

It looks like this has been fixed upstream in version 0.9.12 of the library.



Bug#1030676: pysdl2: autopkgtest failure on s390x

2023-02-06 Thread Gianfranco Costamagna

Source: pysdl2
Version: 0.9.9+dfsg1-5
Severity: serious

Hello, as shown in e.g. 
https://ci.debian.net/data/autopkgtest/unstable/s390x/p/pysdl2/30731752/log.gz
autopkgtests are failing probably due to a Big Endian issue


=== FAILURES ===
 TestSDLPixels.test_SDL_MasksToPixelFormatEnum _

self = 

def test_SDL_MasksToPixelFormatEnum(self):
if sys.byteorder == "little":
val = pixels.SDL_MasksToPixelFormatEnum(32,
0xFF00,
0x00FF,
0xFF00,
0x00FF)
else:
val = pixels.SDL_MasksToPixelFormatEnum(32,
   0x00FF,
   0xFF00,
   0x00FF,
   0xFF00)

  assert val == pixels.SDL_PIXELFORMAT_RGBA

E   assert 376840196 == 373694468
E+  where 373694468 = pixels.SDL_PIXELFORMAT_RGBA

sdl2/test/pixels_test.py:175: AssertionError
 TestSDLPixels.test_SDL_PixelFormatEnumToMasks _

self = 

def test_SDL_PixelFormatEnumToMasks(self):
bpp = c_int()
r, g, b, a = Uint32(), Uint32(), Uint32(), Uint32()
pixels.SDL_PixelFormatEnumToMasks(pixels.SDL_PIXELFORMAT_INDEX1LSB,
  byref(bpp), byref(r), byref(g),
  byref(b), byref(a))
assert (bpp.value, r.value, g.value, b.value, a.value) == \
   (1, 0, 0, 0, 0)
pixels.SDL_PixelFormatEnumToMasks(pixels.SDL_PIXELFORMAT_INDEX1MSB,
  byref(bpp), byref(r), byref(g),
  byref(b), byref(a))
assert (bpp.value, r.value, g.value, b.value, a.value) == \
   (1, 0, 0, 0, 0)

pixels.SDL_PixelFormatEnumToMasks(pixels.SDL_PIXELFORMAT_RGBA,

  byref(bpp), byref(r), byref(g),
  byref(b), byref(a))
if sys.byteorder == "little":
assert (bpp.value, r.value, g.value, b.value, a.value) == \
   (32, 0xFF00, 0x00FF, 0xFF00, 0x00FF)
else:

  assert (bpp.value, r.value, g.value, b.value, a.value) == \

   (32, 0x00FF, 0xFF00, 0x00FF, 0xFF00)
E   assert (32, 42781900...0, 65280, 255) == (32, 255, 652...0, 
4278190080)
E At index 1 diff: 4278190080 != 255
E Full diff:
E - (32, 255, 65280, 16711680, 4278190080)
E + (32, 4278190080, 16711680, 65280, 255)

sdl2/test/pixels_test.py:217: AssertionError
 TestSDL2ExtArray.test_CTypesView__doublebytes _

self = 

def test_CTypesView__doublebytes(self):
buf1 = sdlextarray.CTypesView(doublebyteseq, USHORT_SIZE, docopy=True)
buf2 = sdlextarray.CTypesView(doublebytebuf, USHORT_SIZE, docopy=False)
for singlebytes, shared in ((buf1, False), (buf2, True)):
assert isinstance(singlebytes, sdlextarray.CTypesView)
assert singlebytes.is_shared == shared
assert singlebytes.bytesize == len(doublebyteseq) * 2
offset = 0
cnt = 0
for val in singlebytes.to_bytes():
if cnt > 0:
assert val == hibyte16(doublebyteseq[offset])
cnt = 0
offset += 1
else:

  assert val == lobyte16(doublebyteseq[offset])

E   assert 0 == 1
E+  where 1 = lobyte16(1)

sdl2/test/sdl2ext_array_test.py:199: AssertionError
_ TestSDL2ExtArray.test_CTypesView__quadbytes __

self = 

def test_CTypesView__quadbytes(self):
buf1 = sdlextarray.CTypesView(quadbyteseq, UINT_SIZE, docopy=True)
buf2 = sdlextarray.CTypesView(quadbytebuf, UINT_SIZE, docopy=False)
for singlebytes, shared in ((buf1, False), (buf2, True)):
assert isinstance(singlebytes, sdlextarray.CTypesView)
assert singlebytes.is_shared == shared
assert singlebytes.bytesize == len(quadbyteseq) * 4
offset = 0
cnt = 0
for val in singlebytes.to_bytes():
assert val == ltrbyte32(quadbyteseq[offset], cnt)
if cnt == 3:
offset += 1
cnt = 0
else:
cnt += 1

cnt = 0

offset = 0
for val in singlebytes.to_uint16():
if cnt > 0: