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

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

Closed
joshtriplett opened this issue Nov 16, 2020 · 4 comments
Closed

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

joshtriplett opened this issue Nov 16, 2020 · 4 comments

Comments

@joshtriplett
Copy link
Contributor

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 rust-lang/rust#79089 for a proposed lint that would have caught this.

@joshtriplett
Copy link
Contributor Author

Fixed in #19

@tailhook
Copy link
Owner

Merged PR. Thanks!

@joshtriplett
Copy link
Contributor Author

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

@tailhook
Copy link
Owner

Done!

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