enarx-archive / sallyport

API for the hypervisor-microkernel boundary
Apache License 2.0
7 stars 6 forks source link

[Bug]: Compile error for sallyport ioctl #86

Closed haraldh closed 2 years ago

haraldh commented 2 years ago

Is there an existing issue for this?

Code of Conduct

Current Behaviour

hmmm... I get:

 Compiling sallyport v0.2.0 (https://github.com/enarx/sallyport?rev=3b87af8a0e63230103484f13efdff1d528e1af4a#3b87af8a)
  error[E0308]: mismatched types
     --> /home/harald/.cargo/git/checkouts/sallyport-87d2f89630049c63/3b87af8/src/v2/src/guest/handler.rs:224:60
      |
  223 |         match (fd, request) {
      |               ------------- this expression has type `(i32, u64)`
  224 |             (STDIN_FILENO | STDOUT_FILENO | STDERR_FILENO, TIOCGWINSZ) => {
      |                                                            ^^^^^^^^^^ expected `u64`, found `i32`
  error[E0308]: mismatched types
     --> /home/harald/.cargo/git/checkouts/sallyport-87d2f89630049c63/3b87af8/src/v2/src/guest/handler.rs:229:17
      |
  223 |         match (fd, request) {
      |               ------------- this expression has type `(i32, u64)`
  ...
  229 |             (_, FIONBIO | FIONREAD) => self.execute(syscall::Ioctl { fd, request, argp })?,
      |                 ^^^^^^^ expected `u64`, found `i32`
  error[E0308]: mismatched types
     --> /home/harald/.cargo/git/checkouts/sallyport-87d2f89630049c63/3b87af8/src/v2/src/guest/handler.rs:229:27
      |
  223 |         match (fd, request) {
      |               ------------- this expression has type `(i32, u64)`
  ...
  229 |             (_, FIONBIO | FIONREAD) => self.execute(syscall::Ioctl { fd, request, argp })?,
      |                           ^^^^^^^^ expected `u64`, found `i32`

Expected Behaviour

no error

Environment Information

enarx git repo updated to use sallyport 4819a862953c114a69f1ff7153b41bb558f96365 or

Steps To Reproduce

enarx git repo updated to use sallyport 4819a862953c114a69f1ff7153b41bb558f96365 or

$ cargo build

fails in shim-sev where we use --target x86_64-unknown-linux-musl

https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/musl/mod.rs#L27-L35

versus

https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/gnu/mod.rs#L7-L15