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

Build of the crate fails on big-endian architecture #24

Open
Laiot opened this issue May 3, 2022 · 5 comments
Open

Build of the crate fails on big-endian architecture #24

Laiot opened this issue May 3, 2022 · 5 comments

Comments

@Laiot
Copy link

Laiot commented May 3, 2022

The build fails for the s390x architecture, might be a problem with any big-endian architecture.

failures:
---- fixed_tests::tests::test_i16_enc stdout ----
thread 'fixed_tests::tests::test_i16_enc' panicked at 'assertion failed: `(left == right)`
  left: `[128, 0]`,
 right: `[0, 128]`', src/fixed_tests.rs:26:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- fixed_tests::tests::test_i32_enc stdout ----
thread 'fixed_tests::tests::test_i32_enc' panicked at 'assertion failed: `(left == right)`
  left: `[255, 255, 128, 1]`,
 right: `[1, 128, 255, 255]`', src/fixed_tests.rs:31:9
---- fixed_tests::tests::test_i32_enc_light stdout ----
thread 'fixed_tests::tests::test_i32_enc_light' panicked at 'assertion failed: `(left == right)`
  left: `[255, 255, 128, 1]`,
 right: `[1, 128, 255, 255]`', src/fixed_tests.rs:48:9
---- fixed_tests::tests::test_u16_enc stdout ----
thread 'fixed_tests::tests::test_u16_enc' panicked at 'assertion failed: `(left == right)`
  left: `[1, 0]`,
 right: `[0, 1]`', src/fixed_tests.rs:21:9
---- fixed_tests::tests::test_u32_enc stdout ----
thread 'fixed_tests::tests::test_u32_enc' panicked at 'assertion failed: `(left == right)`
  left: `[0, 0, 0, 32]`,
 right: `[32, 0, 0, 0]`', src/fixed_tests.rs:16:9
failures:
    fixed_tests::tests::test_i16_enc
    fixed_tests::tests::test_i32_enc
    fixed_tests::tests::test_i32_enc_light
    fixed_tests::tests::test_u16_enc
    fixed_tests::tests::test_u32_enc
test result: FAILED. 18 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
@dermesser
Copy link
Owner

Ah well, the time has come... so far, for simplicity and laziness reasons, I've simply not bothered about BE architectures. If this issue is more than "it doesn't build, shrug" (i.e. "I need this to build!"), please let me know and I will investigate ways to implement this properly.

@Laiot
Copy link
Author

Laiot commented May 5, 2022

I wanted to make a Fedora package of this crate because many other crates depend on this one (eg message-io). One of the review tests we run before approving a package is indeed on an s390x machine.

dermesser added a commit that referenced this issue May 21, 2022
@dermesser
Copy link
Owner

I've implemented fixes for fixed-width integers. I believe that all important tests are updated accordingly, but could you run the build process again before I publish a new version before reporting back? That would be very helpful!

dermesser added a commit that referenced this issue May 22, 2022
@Laiot
Copy link
Author

Laiot commented May 26, 2022

I'm sorry it took me so long to reply and thank you for your work.
Unfortunately, neither of the two patches works, the build on the s390x architecture keeps failing.
Also the last patch (46f5f3e40c7d4819f7e8484cb58a571caa22c3b4) makes builds on standard architectures fail too.

@dermesser
Copy link
Owner

This is unfortunate - especially as the tests pass on x86 (Github CI and locally). Can you post the specific errors for the respective architecture, so I can better understand what is going wrong? They should at least be different from the ones you posted initially.

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