Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

WIP: Fix compilation for windows #128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

WIP: Fix compilation for windows #128

wants to merge 3 commits into from

Conversation

jean-airoldie
Copy link
Owner

This fixes #127.

@hbgl
Copy link

hbgl commented Jan 18, 2020

pub const EBADF: c_int = 9; is missing from libzmq-rs/libzmq-sys/src/windows.rs

There are also Unix modules popping up in the Windows build:

Compiling libzmq v0.2.1 (C:\Dev\libzmq-rs\libzmq)
error[E0433]: failed to resolve: could not find `unix` in `os`
  --> libzmq\src\poll.rs:20:5
   |
20 |     unix::io::{AsRawFd, RawFd},
   |     ^^^^ could not find `unix` in `os`

error[E0412]: cannot find type `RawFd` in this scope
   --> libzmq\src\poll.rs:131:8
    |
131 |     Fd(RawFd),
    |        ^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
   --> libzmq\src\poll.rs:136:8
    |
136 |     T: AsRawFd,
    |        ^^^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
   --> libzmq\src\poll.rs:500:13
    |
500 |         fd: RawFd,
    |             ^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
   --> libzmq\src\poll.rs:607:33
    |
607 |     fn remove_fd(&mut self, fd: RawFd) -> Result<(), Error> {
    |                                 ^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
   --> libzmq\src\poll.rs:681:33
    |
681 |     fn modify_fd(&mut self, fd: RawFd, trigger: Trigger) -> Result<(), Error> {
    |                                 ^^^^^ not found in this scope

error: aborting due to 6 previous errors

@jean-airoldie
Copy link
Owner Author

I added EBADF and I think the RawFd import should be good now.

@hbgl
Copy link

hbgl commented Jan 18, 2020

The problem is that std::os::unix::io::AsRawFd and std::os::unix::io::RawFd are used in poll.rs and RawFd is part of the public interface.
I think somebody who is seriously interested in using libzmq on Windows should work with you on fixing the issue. I am not even sure if I will be using ZeroMQ for my own project so for now I will try out rust-zmq to learn more about ZeroMQ.

@jean-airoldie
Copy link
Owner Author

I think somebody who is seriously interested in using libzmq on Windows should work with you on fixing the issue.

Indeed, I don't use windows personally nor do I own a windows machine. Realistically a windows CI env should be setup etc.

I am not even sure if I will be using ZeroMQ for my own project so for now I will try out rust-zmq to learn more about ZeroMQ.

I'm personally not using ZeroMQ anymore due to the many issues it has. Checkout my comment in this issue: #125 (comment). This might save you some time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows build fails
2 participants