tailhook / unshare

The low-level linux containers creation library for rust
Apache License 2.0
124 stars 27 forks source link

Fails to build for target aarch64-unknown-linux-gnu #18

Closed joshtriplett closed 3 years ago

joshtriplett commented 3 years ago

On aarch64-unknown-linux-gnu, unshare fails to build with the following error:

error[E0308]: mismatched types
  --> src/child.rs:94:28
   |
94 |                 .copy_from(data.as_ptr() as *const i8, data.len());
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
   |
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`

error[E0308]: mismatched types
   --> src/child.rs:229:18
    |
229 |                  child.environ.as_ptr() as *const *const i8);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const *const u8`
               found raw pointer `*const *const i8`

You can reproduce this by installing the aarch64-unknown-linux-gnu target with rustup target add, then building with cargo build --target aarch64-unknown-linux-gnu.

See https://github.com/rust-lang/rust/issues/79089 for a proposed lint that would have caught this.

joshtriplett commented 3 years ago

Fixed in https://github.com/tailhook/unshare/pull/19

tailhook commented 3 years ago

Merged PR. Thanks!

joshtriplett commented 3 years ago

Much appreciated. Would you mind cargo publishing the current code as unshare 0.6?

tailhook commented 3 years ago

Done!