differential-datalog icon indicating copy to clipboard operation
differential-datalog copied to clipboard

D3Log doesn't compile on Windows

Open Kixiron opened this issue 4 years ago • 3 comments

D3log has compile errors on Windows, which makes it really annoying to try and work on the whole of ddlog since it errors out constantly

Errors
error[E0433]: failed to resolve: could not find `unix` in `os`
 --> rust\template\distributed_datalog\src\tcp_channel\receiver.rs:9:14
  |
9 | use std::os::unix::io::AsRawFd;
  |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:18:14
   |
18 | use std::os::unix::io::AsRawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:19:14
   |
19 | use std::os::unix::io::FromRawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:20:14
   |
20 | use std::os::unix::io::IntoRawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:21:14
   |
21 | use std::os::unix::io::RawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
 --> rust\template\distributed_datalog\src\sources\file.rs:7:14
  |
7 | use std::os::unix::io::AsRawFd;
  |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
 --> rust\template\distributed_datalog\src\sources\file.rs:8:14
  |
8 | use std::os::unix::io::IntoRawFd;
  |              ^^^^ could not find `unix` in `os`

error[E0412]: cannot find type `socklen_t` in crate `libc`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:51:67
   |
51 | fn into_inner(addr: &SocketAddr) -> (*const libc::sockaddr, libc::socklen_t) {
   |                                                                   ^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `socklen_t` in crate `libc`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:55:47
   |
55 |             std::mem::size_of_val(a) as libc::socklen_t,
   |                                               ^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `socklen_t` in crate `libc`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:59:47
   |
59 |             std::mem::size_of_val(a) as libc::socklen_t,
   |                                               ^^^^^^^^^ not found in `libc`

error[E0412]: cannot find type `RawFd` in this scope
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:64:24
   |
64 | fn set_nonblocking(fd: RawFd, nonblocking: bool) -> Result<(), Error> {
   |                        ^^^^^ not found in this scope

error[E0425]: cannot find function `ioctl` in crate `libc`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:66:24
   |
66 |     cvt(unsafe { libc::ioctl(fd, libc::FIONBIO, &mut nonblocking) }).map(|_| ())
   |                        ^^^^^ not found in `libc`

error[E0425]: cannot find value `FIONBIO` in crate `libc`
  --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:66:40
   |
66 |     cvt(unsafe { libc::ioctl(fd, libc::FIONBIO, &mut nonblocking) }).map(|_| ())
   |                                        ^^^^^^^ not found in `libc`

error[E0422]: cannot find struct, variant or union type `pollfd` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:101:34
    |
101 |         let mut pollfds = [libc::pollfd {
    |                                  ^^^^^^ not found in `libc`

error[E0425]: cannot find value `POLLOUT` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:103:27
    |
103 |             events: libc::POLLOUT,
    |                           ^^^^^^^ not found in `libc`

error[E0425]: cannot find function `poll` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:113:34
    |
113 |             match unsafe { libc::poll(pollfds.as_mut_ptr(), count, timeout) } {
    |                                  ^^^^ not found in `libc`

error[E0425]: cannot find value `POLLHUP` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:133:51
    |
133 |                     if pollfds[0].revents & libc::POLLHUP != 0 {
    |                                                   ^^^^^^^ not found in `libc`

error[E0425]: cannot find function `shutdown` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:236:32
    |
236 |             cvt(unsafe { libc::shutdown(fd.try_into().unwrap(), libc::SHUT_RDWR) }).map(|_| ())
    |                                ^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SHUT_RDWR` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:236:71
    |
236 |             cvt(unsafe { libc::shutdown(fd.try_into().unwrap(), libc::SHUT_RDWR) }).map(|_| ())
    |                                                                       ^^^^^^^^^ not found in `libc`

error[E0405]: cannot find trait `AsRawFd` in this scope
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:245:6
    |
245 | impl AsRawFd for Fd {
    |      ^^^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:246:28
    |
246 |     fn as_raw_fd(&self) -> RawFd {
    |                            ^^^^^ not found in this scope

error[E0405]: cannot find trait `IntoRawFd` in this scope
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:255:6
    |
255 | impl IntoRawFd for Fd {
    |      ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:256:29
    |
256 |     fn into_raw_fd(self) -> RawFd {
    |                             ^^^^^ not found in this scope

error[E0425]: cannot find value `AF_INET` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:278:41
    |
278 |         let fd = cvt(libc::socket(libc::AF_INET, libc::SOCK_STREAM, 0))?;
    |                                         ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SOCK_STREAM` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:278:56
    |
278 |         let fd = cvt(libc::socket(libc::AF_INET, libc::SOCK_STREAM, 0))?;
    |                                                        ^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `fcntl` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:279:34
    |
279 |         let oldflags = cvt(libc::fcntl(fd, libc::F_GETFD, 0))?;
    |                                  ^^^^^ not found in `libc`

error[E0425]: cannot find value `F_GETFD` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:279:50
    |
279 |         let oldflags = cvt(libc::fcntl(fd, libc::F_GETFD, 0))?;
    |                                                  ^^^^^^^ not found in `libc`

error[E0425]: cannot find function `fcntl` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:280:27
    |
280 |         let _ = cvt(libc::fcntl(fd, libc::F_SETFD, oldflags | libc::O_CLOEXEC))?;
    |                           ^^^^^ not found in `libc`

error[E0425]: cannot find value `F_SETFD` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:280:43
    |
280 |         let _ = cvt(libc::fcntl(fd, libc::F_SETFD, oldflags | libc::O_CLOEXEC))?;
    |                                           ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `O_CLOEXEC` in crate `libc`
   --> rust\template\distributed_datalog\src\tcp_channel\socket.rs:280:69
    |
280 |         let _ = cvt(libc::fcntl(fd, libc::F_SETFD, oldflags | libc::O_CLOEXEC))?;
    |                                                                     ^^^^^^^^^ not found in `libc`

error: aborting due to 30 previous errors

Kixiron avatar Jan 31 '21 16:01 Kixiron

It should work with wsl. https://en.m.wikipedia.org/wiki/Windows_Subsystem_for_Linux

mihaibudiu avatar Jan 31 '21 17:01 mihaibudiu

Yah, my concern isn't actually using it (for now), it's the fact that I have to somehow remove d3log in order to work on the rest of ddlog, it's quite annoying

Kixiron avatar Jan 31 '21 17:01 Kixiron

@convolvatron

ryzhyk avatar Feb 24 '21 21:02 ryzhyk