-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error Cross compiling for x86_64-pc-windows-gnu from Linux #40
Comments
So sorry, took me two days and a GitHub workflow run to realize that the cross compilation of libevent from arm to x64 is responsible for this error, the crate has nothing to do with it. Works all fine in a Docker Container on a x64 AMD VPS. #12 is probably the same thing, caused by an apple arm processor. |
It looks like libevent is building fine (albeit with a few warnings), but then tor doesn't like to link with it. I don't have an arm laptop, I'll see if I can get my hands on one to try and reproduce the error, because I would like to see exactly why tor doesn't want to link with libevent. Maybe it's something we can fix |
If you want, I could run some tests if you tell me what to do. |
I don't remember how to do this, but there should be a way to get the full log of all the checks run by |
Do you mean this?
|
No these are just warnings, they shouldn't make it all fail. There's a log somewhere that lists all the "checks" run by configure to figure out the right compiling flags. There should be one or more for libevent where it tries to link with it and fails. Those logs would help try figuring out why it doesn't want to use the libevent we provide |
I've been having an issue with libevent too when cross compiling for android on linux. I get this warning and error:
I'm using this command:
I get the same error if i use "vendored-openssl" in Config.toml and only use the |
The same project builds fine when i remove libtor from Cargo.toml, so all other cross compiling configs are okay. |
configure: error: "You must specify an explicit --with-libevent-dir=x option when using --enable-static-libevent" Does the --enable-static-libevent flag force it to use a local libevent? |
I made some progress by adding features = ["vendored-lzma","vendored-zstd"] } to the dependency in Cargo.toml |
Got it working. Cargo.toml
cargo build --target aarch64-linux-android --release No flags required. With windows I would assume the same should work. |
This still errors out when compiling from linux-aarch64 to windwos-x64. |
Sorry i just noticed your Have you tried adding the other two vendored libs in --features in the above command? |
@i5hi if you are targeting android I think your Btw your final configuration should be equivalent to just including libtor with |
Yes. After changing that I could run cargo run --release android without needing to use flags. I was using my local gcc instead of the target clang. Now i just let it chose the right linkers that i set in .cargo/config
Yes, that makes sense but I get errors when i use |
That's interesting, let me know if you figure out why that's happening. |
Will do. On an aside, @afilini, what is the best rust http client that allows me to configure a socks5 port to make normal http requests over tor? |
Not sure exactly what's best because I haven't compared many of them, but we've been using |
For anybody who is interested, I have tested this again and on commit 7309e85 this still fails to cross compile. |
I have the following docker image for testing the compilation.
I am on the master branch of version 46.9.1+0.4.6.9 with commit ID 19bae62.
There seams to be a problem with libevent, it errors out when checking the dependency:
Error
Here is a full log of the build:
log.txt
I would be very grade full if somebody could help me with this issue
The text was updated successfully, but these errors were encountered: