Skip to content
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

2.094 fails to build on non-x86 architectures due to test failure (not ok 22 - rcols: types option) #502

Closed
sebastic opened this issue Nov 3, 2024 · 4 comments

Comments

@sebastic
Copy link
Contributor

sebastic commented Nov 3, 2024

The Debian package build for 2.094 failed on various non-x86 architectures due to test failures:

make[4]: Entering directory '/<<PKGBUILDDIR>>/Basic/IO-Misc'
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Misc.bs ../../blib/arch/auto/PDL/IO/Misc/Misc.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(1, '../../blib/lib', '../../blib/arch')" t/*.t

#   Failed test 'rcols: types option'
#   at t/misc.t line 172.
#     1/4 values do not match
#          got: Ushort   D [4]        (V    ) [1 3 0 7]
#     expected: Ushort   D [4]        (P    ) [1 3 65531 7]
# First <=5 values differ at: 
# [
#  [2]
# ]
# Those 'got' values: [0]
# Those 'expected' values: [65531]
# Looks like you failed 1 test of 31.
t/misc.t .. 
ok 1 - rcols with undefval and missing cols
ok 2 - rcols with filename
ok 3 - rcols with filename + pattern
ok 4 - rcols does not die on a used file handle
ok 5 - rgrep
ok 6 - bswap2
ok 7 - bswap4
ok 8 - bswap Type method
ok 9 - rasc on null ndarray
ok 10 - rasc on existing ndarray
ok 11 - rasc on non-existant file
ok 12 - rcols: default
ok 13 - rcols: default
ok 14 - rcols: fh
ok 15 - rcols: fh
ok 16 - rcols: include pattern
ok 17 - rcols: include pattern
ok 18 - rcols: lines option
ok 19 - rcols: lines option
ok 20 - rcols: deftype option
ok 21 - rcols: deftype option
not ok 22 - rcols: types option
ok 23 - rcols: types option
ok 24 - 'PDL::IO::Misc::deftype' isa 'PDL::Type'
ok 25 - PDL::IO::Misc::deftype check
ok 26 - rcols: can read in as 'short'
ok 27 - wcols
ok 28 - wcols FORMAT option
ok 29 - wcols format_string
ok 30 - wcols format_string override
ok 31 - wcols format_string obeyed
1..31
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/31 subtests 

Test Summary Report
-------------------
t/misc.t (Wstat: 256 (exited 1) Tests: 31 Failed: 1)
  Failed test:  22
  Non-zero exit status: 1
Files=1, Tests=31,  0 wallclock secs ( 0.08 usr  0.00 sys +  0.40 cusr  0.06 csys =  0.54 CPU)
Result: FAIL

Full buildlogs: arm64, armel, armhf, ppc64el, riscv64, s390x

@mohawk2
Copy link
Member

mohawk2 commented Nov 3, 2024

Thanks for the report! I've made my usual fatal mistake: adding a test. Here, the data includes -5, and the code wants to turn that into a ushort, an unsigned type. The test, until I changed it, just checked the number of elements and the type; now it checks the values too. I'd have to say that it's quite unexpected that PDL's convert code is turning that value into a 0, so that's a bug that needs fixing.

@mohawk2
Copy link
Member

mohawk2 commented Nov 3, 2024

That last commit made the test go from failing to passing on my qemu s390x, so I'll push out a 2.095.

@sebastic If you agree this has fixed things, could you in due course close this? Thank you again!

@mohawk2
Copy link
Member

mohawk2 commented Nov 3, 2024

If it's necessary, a micro-patch that should make 2.094 stop failing would be to patch Basic/IO-Misc/t/misc.t lines 171-2 to be:

($x,$y) = rcols $file, { TYPES => [ short ] };
is_pdl $x, short(1,3,-5,7), "rcols: types option";

which would mask the problem of negative numbers by using a signed type.

Obviously I believe 2.095 is a better solution, which I have just released.

@sebastic
Copy link
Contributor Author

sebastic commented Nov 4, 2024

2.095 builds are looking good: https://buildd.debian.org/status/package.php?p=pdl

@sebastic sebastic closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants