-
Notifications
You must be signed in to change notification settings - Fork 44
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
Torrust-Tracker won't compile on Windows #325
Comments
Found the problem why it won't compile on Windows. |
Thank you @Power2All. I have to spend some time to understand the problem. Rigth now I only know:
I think we should:
I guess we want to support Windows unless there is a major performance issue or something like that. I think there is no active contributor using Windows for development right now. |
I tried this too, but didn't work out as expected, as it's force to use MSVC, which you definitely don't want to use for compiling. I've fixed all the issues on my end by skipping most of these -sys libraries it tries to use.
Before most of the changes, I was the one using Windows, with CLion as IDE. |
I investigated one of the 5 current test problems. It seems that reqwest behaves differently under windows because of the way ports are managed. Impacted test function: let status = client.announce(&announce_query).await.unwrap().status() ; More information coming soon. |
I've discovered that, for some unknown reason (yet), on Windows you can't use bind (it works using new). Edit: |
Hi @GGLinnk, can you paste the code that is not working? I don't know what "bind" or "new" methods you are referring to. Also, what LAN IP is not working? You can also add links to resources, related problems, or whatever you think might be helpful to help with this task. |
Ok, for the context, I'm working on this part of the code : torrust-tracker/tests/servers/http/v1/contract.rs Lines 734 to 760 in b92401f
This test creates a client using a bind method :
It uses two variables:
The bind methods creates a Client (Self) with the following reqwest builder :
I've tried using the
I'm wondering what is the purpose to manually precise the local address here ? Is that required ? |
Hi @GGLinnk I don't remember very well that part but I think I bound the local IP because I wanted to add this assert:
The only way to know the client IP was to bind to a specific one. If I remember well, the client sometimes used different IPs. Maybe when you run it with docker (E2E tests), you get a different IP than the one you get running it directly. It seems that in Windows, you cannot bind the client to the port returned using the /// Retrieves the local IPv4 address of the machine in the local network from
/// the `AF_INET` family.
///
/// A different approach is taken based on the operative system.
///
/// For linux based systems the Netlink socket communication is used to
/// retrieve the local network interface.
///
/// For BSD-based systems the `getifaddrs` approach is taken using `libc`
///
/// For Windows systems Win32's IP Helper is used to gather the Local IP
/// address
pub fn local_ip() -> Result<IpAddr, Error> { The test passes because the client's IP is the same as the one returned by You can try to run the E2E test in Windows to check if the tests also pass with cargo run --bin e2e_tests_runner ./share/default/config/tracker.e2e.container.sqlite3.toml We could try to find a different way to know which IP the client is using instead of binding to a specific one. Maybe we can make another request before, and the server can return the client's IP, but I would not like to make this test depend on another feature. |
Just tried to compile this on Windows CLion with Rust.
These modules are not compatible with Windows:
You might want to look into replacing these, or looking to remove them.
Unless of course, you won't want to support multi-platforms.
The text was updated successfully, but these errors were encountered: