grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
61 stars 22 forks source link

test fails on s390x: 64-bit integer attributes are not read correctly #138

Open tillea opened 10 months ago

tillea commented 10 months ago

Hi, admittedly s390x is an architecture that will probably not run rhdf5 in practical cases. Anyway, the Debian package is built and tested as any other Debian package on this architecture and the test suite has uncovered an issue that might be worth investigating: Here you can see the full build log featuring all versions of packages that are used. The actual error is:

...
`actual`:   FALSE
`expected`: TRUE  
── Failure ('test_h5writeAttributes.R:65:5'): Adding attribute to group ────────
attr_back$char_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:66:5'): Adding attribute to group ────────
attr_back$int_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:67:5'): Adding attribute to group ────────
attr_back$numeric_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:93:5'): Adding attribute to dataset ──────
`attr_back` has length 0, not length 4.
── Failure ('test_h5writeAttributes.R:95:5'): Adding attribute to dataset ──────
attr_back$char_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:96:5'): Adding attribute to dataset ──────
attr_back$int_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:97:5'): Adding attribute to dataset ──────
attr_back$numeric_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:130:5'): Checking other string options when adding attributes ──
`attr_back` has length 0, not length 4.
── Failure ('test_h5writeAttributes.R:133:5'): Checking other string options when adding attributes ──
sort(expected) not identical to sort(names(attr_back)).
Types not compatible: character is not NULL
── Failure ('test_h5writeAttributes.R:134:5'): Checking other string options when adding attributes ──
unname(unlist(attr_back[expected])) not identical to c("blah", "blah2", "blah3", "blah4").
target is NULL, current is character
── Failure ('test_h5writeAttributes.R:149:5'): Overwrite exisiting attribute ───
attr_list$char_attr[1] not identical to "new_character".
target is NULL, current is character

[ FAIL 39 | WARN 0 | SKIP 4 | PASS 1033 ]

Kind regards, Andreas.

mr-c commented 2 months ago

Hello, any thoughts on how to add big-endian compatibility for rhdf5?

If that is not desired, please let us know and we'll stop building rhdf5 for s390x in Debian (and likewise for the other r packages that depends on rhdf5: alabaster.base, alabaster.matrix, bsseq, dropletutils, hdf5array, dss, glmgampoi, gsva, demixt)

grimbough commented 2 months ago

Are the test failures reported by @tillea due to endianess then?

Many of the internal HDF5 datatypes should have explicit endianess assigned e.g. H5T_STD_I32LE is little-endian although there's also lots of places we use the H5T_NATIVE_INT32 style, which I though meant HDF5 would sort out the endianess for the specific platform.

I believe I looked into trying to use an s390x docker image to test this when the initial issue was filed, but I guess I didn't get very far as I have no recollection of the results.

mr-c commented 2 months ago

Are the test failures reported by @tillea due to endianess then?

That's my guess, but I haven't dug into them

Here's a fresh log: https://ci.debian.net/packages/r/r-bioc-rhdf5/unstable/s390x/51476144/#S5

I believe I looked into trying to use an s390x docker image to test this when the initial issue was filed, but I guess I didn't get very far as I have no recollection of the results.

Here's a Dockerfile, I named it r-bioc-rhdf5.Dockerfile

FROM docker.io/debian:sid-slim

WORKDIR /build

RUN apt-get update && apt-get dist-upgrade -y \
    && apt-get install -y --no-install-recommends \
        curl \
        devscripts \
        debian-keyring \
        r-bioc-rhdf5 \
        pkg-r-autopkgtest \
        r-cran-bit64 \
        r-bioc-biocstyle \
        r-cran-knitr \
        r-cran-rmarkdown \
        r-cran-testthat \
        r-cran-bench \
        r-cran-dplyr \
        r-cran-ggplot2 \
        r-cran-mockery \
        r-bioc-biocparallel
RUN dget https://deb.debian.org/debian/pool/main/r/r-bioc-rhdf5/r-bioc-rhdf5_2.48.0+dfsg-1.dsc
WORKDIR /build/r-bioc-rhdf5-2.48.0+dfsg
RUN /usr/share/dh-r/pkg-r-autopkgtest

and then in an empty directory I run podman build -f ../r-bioc-rhdf5.Dockerfile --platform linux/s390x . (docker build … should also work)