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

Not working ("Unsupported compression options") on armhf (e. g. Raspberry Pi) #11

Closed
superlupo12 opened this issue Aug 5, 2016 · 2 comments · Fixed by #12
Closed

Not working ("Unsupported compression options") on armhf (e. g. Raspberry Pi) #11

superlupo12 opened this issue Aug 5, 2016 · 2 comments · Fixed by #12

Comments

@superlupo12
Copy link
Contributor

I've tried using rust-lzma on my Raspberry Pi (Debian Jessie armhf), but unfortunately, it doesn't work, it always fails when writing with "Unsupported compression options".
My example:

extern crate lzma;

use lzma::LzmaWriter;
use std::io::prelude::*;
use std::fs::File;

fn main() {
    let f = File::create("foo.xz").unwrap();
    let mut f = LzmaWriter::new_compressor(f, 6).unwrap();

    match write!(f, "It's a small world!") {
        Ok(_) => println!("ok"),
        Err(err) => panic!("error writing: {}", err)
    }
    f.finish().unwrap();
}

When run, I get:

thread '<main>' panicked at 'error writing: Unsupported compression options', examples/compress.rs:13
stack backtrace:
   1: 0x54afc747 - sys::backtrace::tracing::imp::write::hf670d8b6386d22deJcv
   2: 0x54afed67 - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.44482
   3: 0x54afe8f3 - panicking::default_handler::h8779de026b877d91YTz
   4: 0x54af5dc3 - sys_common::unwind::begin_unwind_inner::h3b511d4750e909fd20t
   5: 0x54af602b - sys_common::unwind::begin_unwind_fmt::hfb02698582574ecb8Zt
   6: 0x54aeeab3 - main::h476f27c94c33d42diaa
                at /home/user/src/rust-lzma/<std macros>:8
   7: 0x54afe4bb - sys_common::unwind::try::try_fn::h5358980013828492550
   8: 0x54afbd23 - __rust_try
   9: 0x54afbd23 - __rust_try
...

Also, all tests fail on the same error:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: Other, error: Options }) }', ../src/libcore/result.rs:746
...

I've tried using 0, 6, and 9 as compression preset, no difference. I've looked into your code, but I couldn't find any clue what could be wrong.
It works on Debian Jessie x86_64 though.
Thanks

@superlupo12
Copy link
Contributor Author

Update: I've also tried on an older Ubuntu x86 32bit, and the same error happens. Could that be an 32bit (ARM is also 32) vs 64bit problem?

@superlupo12
Copy link
Contributor Author

superlupo12 commented Aug 6, 2016

I think I found it: xz/lzma changlog says

If any of the reserved members in lzma_stream are non-zero
    or non-NULL, LZMA_OPTIONS_ERROR is returned.

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

Successfully merging a pull request may close this issue.

1 participant