akiradeveloper / device-mapper-tests

Testing device-mapper targets. Rust! Rust! Rust!
MIT License
1 stars 0 forks source link

Update cmd_lib #2

Open akiradeveloper opened 2 years ago

akiradeveloper commented 2 months ago

Using cmd_lib=1.9 panics the mount with options="".

fn mount(s: &impl Stack, options: &str) -> String {
    let blk_dev = s.path();
    let mp = format!("/tmp/{}", rand_name());
    run_cmd!(rm -rf $mp).unwrap();
    run_cmd!(mkdir -p $mp).unwrap();
    run_cmd!(mount $options $blk_dev $mp).unwrap();

To narrow the problem, I wrote a small reproducer.

use cmd_lib::*;
fn main() {
    dbg!(run_cmd!(ls));
    let options = "";
    dbg!(run_cmd!(ls $options));
}

Conclusion:

akiradeveloper commented 1 month ago

For now, I updated cmd_lib to 0.9.

akiradeveloper commented 1 month ago

I think it is now fixed in the latest. https://github.com/rust-shell-script/rust_cmd_lib/commit/6572e896cfd00300b0d9b366588f669261f1facd

Once released, I will finish this task.