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 error: arguments to krun_set_exec are incorrect #62

Closed
marco-04 opened this issue Sep 19, 2024 · 3 comments
Closed

Build error: arguments to krun_set_exec are incorrect #62

marco-04 opened this issue Sep 19, 2024 · 3 comments

Comments

@marco-04
Copy link

I'm having this build error on Gentoo with rust-bin 1.80.1 and bindgen 0.69.4

error[E0308]: arguments to this function are incorrect
   --> crates/krun/src/bin/krun.rs:327:13
    |
327 |             krun_set_exec(
    |             ^^^^^^^^^^^^^
    |
note: types differ in mutability
   --> crates/krun/src/bin/krun.rs:330:17
    |
330 |                 krun_guest_args.as_ptr(),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: expected raw pointer `*const *mut u8`
               found raw pointer `*const *const u8`
note: types differ in mutability
   --> crates/krun/src/bin/krun.rs:331:17
    |
331 |                 env.as_ptr(),
    |                 ^^^^^^^^^^^^
    = note: expected raw pointer `*const *mut u8`
               found raw pointer `*const *const u8`
note: function defined here
   --> /home/marcosti/.git_repos/krun/target/debug/build/krun-sys-fa48eabac47ff4f2/out/bindings.rs:510:12
    |
510 |     pub fn krun_set_exec(
    |            ^^^^^^^^^^^^^

Looking at the definitions of the krun_guest_args and env variables as Vec<*const c_char> it seems that it could be an issue with bindgen, tho I'm not sure. By manually changing the generated bindings, it builds and seems to work fine

@teohhanhui
Copy link
Collaborator

@marco-04 I thought it was fixed on libkrun side long ago: containers/libkrun#181

@marco-04
Copy link
Author

Unless it's on another branch, cloning the repo and building on main doesn't work for me

@marco-04
Copy link
Author

I'm an idiot. For some reason I still had around an old libkrun.h header from a dirty installation. I got rid of it and now it works as expected. Thanks for the help!

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