Bug 1078997 - libstorage-ng fails to build on armv6 and armv7
libstorage-ng fails to build on armv6 and armv7
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: YaST2
Current
armv7 Other
: P3 - Medium : Major (vote)
: ---
Assigned To: Arvin Schnell
Jiri Srain
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-02 08:34 UTC by Guillaume GARDET
Modified: 2018-02-12 10:30 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume GARDET 2018-02-02 08:34:13 UTC
As reported on github: https://github.com/openSUSE/libstorage-ng/issues/440

armv7l and armv6l fails in OBS: https://build.opensuse.org/package/show/openSUSE:Factory:ARM/libstorage-ng
Because humanstring.test fails in 'make check-TESTS'.

Here is the testsuite/Utils/humanstring.log:
Running 4 test cases...
humanstring.cc(139): error: in "test_big_numbers": check test("en_GB.UTF-8", 16 * EiB - 1 * B, true, 2, true) == "16.00 EiB" has failed [16 EiB != 16.00 EiB]
humanstring.cc(143): error: in "test_big_numbers": exception OverflowException expected but not raised
humanstring.cc(144): error: in "test_big_numbers": exception OverflowException expected but not raised

*** 3 failures are detected in the test module "libstorage"
FAIL humanstring.test (exit status: 201)


This is very annoying since YaST modules using libstorage-ng are not buildable. We are not able to build new ARM images.
Comment 1 Ancor Gonzalez Sosa 2018-02-02 09:27:12 UTC
Arvin, can you take a look? I assume it would be relatively easy to fix. If not, I will create a Trello card for it.
Comment 2 Guillaume GARDET 2018-02-02 10:40:12 UTC
For the 1st error, I think the root problem comes from 
byte_to_humanstring function when you do the conversion 'long double f = size;'. See line in code here [1].
For the broken test, I get
f = 18446744073709551616.000000 	 size = 18446744073709551615
So, we clearly loose the required precision for this test on arm 32 bits!
Then, you probably want to rework the "omit_zero" management.

[1]: https://github.com/openSUSE/libstorage-ng/blob/6d88d4152aa5aa20920c392bc5d2d1e0a10cc6d5/storage/Utils/HumanString.cc#L142
Comment 3 Arvin Schnell 2018-02-02 11:22:59 UTC
Maybe no support for 'long double' on ARM?
Comment 4 Guillaume GARDET 2018-02-02 12:45:04 UTC
(In reply to Arvin Schnell from comment #3)
> Maybe no support for 'long double' on ARM?

I think double and long double are the same on 32-bits ARM.

The NonOverflow errors (2nd and 3rd errors) are probably also due to this low precision.

What would be the fix/workaround?
Comment 5 Arvin Schnell 2018-02-02 15:27:30 UTC
(In reply to Guillaume GARDET from comment #4)

> What would be the fix/workaround?

Admitting that arm cannot handle big numbers and disable the test cases.
Comment 6 Guillaume GARDET 2018-02-02 16:44:42 UTC
(In reply to Arvin Schnell from comment #5)
> (In reply to Guillaume GARDET from comment #4)
> 
> > What would be the fix/workaround?
> 
> Admitting that arm cannot handle big numbers and disable the test cases.

Must all the tests be disabled for arm 32 or could you disable only the big numbers tests for arm 32?
Comment 7 Arvin Schnell 2018-02-02 18:06:54 UTC
With the correct pre processor defines it should be able to disable only
the problematic tests. But I do not know the arm defines to use. I saw
a __NO_LONG_DOUBLE_MATH define being used, maybe that would be perfect.
Comment 8 Guillaume GARDET 2018-02-03 13:12:23 UTC
(In reply to Arvin Schnell from comment #7)
> With the correct pre processor defines it should be able to disable only
> the problematic tests. But I do not know the arm defines to use. I saw
> a __NO_LONG_DOUBLE_MATH define being used, maybe that would be perfect.

Indeed, it seems to do the trick. I created a pull request on github.
Comment 9 Swamp Workflow Management 2018-02-06 13:40:11 UTC
This is an autogenerated message for OBS integration:
This bug (1078997) was mentioned in
https://build.opensuse.org/request/show/573303 Factory:ARM / libstorage-ng
Comment 10 Arvin Schnell 2018-02-06 21:14:11 UTC
I am working on convert functions that work with 'double' and pass the
testsuite.
Comment 11 Arvin Schnell 2018-02-09 16:22:47 UTC
PR: https://github.com/openSUSE/libstorage-ng/pull/459
Comment 12 Arvin Schnell 2018-02-12 10:30:23 UTC
Works now for armv7l. For armv6l the build does not even start due to
unrelated problems.