Closed adumbidiot closed 11 months ago
I edited the bottom case to instead be configure.arg(&format!("--prefix={}", install_dir.to_str().unwrap().replace('\', "/")));. I don't particularly understand the ramifications of this change, but it seems to fix my build. sanitize_sh seems to only be applicable for Mingw as it tries to change the paths from Windows style to Mingw style.
I am also facing the same issue, How did you do that ? How did you change your Cargo.toml to include your local copy and build that ?
i did this in Cargo.toml
env: using git-bash shell
on windows
targeting to cross-compile for android-linux
:
openssl-src::Build
target = aarch64-linux-android
host = x86_64-pc-windows-msvc
out_dir = D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-7f3055406159564a\out\openssl-build
build_dir = D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-7f3055406159564a\out\openssl-build\build
install_dir = D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-7f3055406159564a\out\openssl-build\install
is cfg Windows = false
...
# openssl-sys = { path = "../openssl-sys", features = ["vendored"], version = "0.9.58" }
openssl-sys = { version = "0.9.58", features = ["vendored"]}
[patch.crates-io]
openssl-src = { path = "../openssl-src" }
openssl-sys = { path = "../openssl-sys" }
and still
crypto/cversion.c:38:33: error: \U used with no following hex digits
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:23: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: warning: unknown escape sequence '\D' [-Wunknown-escape-sequence]
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:29: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: warning: unknown escape sequence '\G' [-Wunknown-escape-sequence]
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:39: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: warning: unknown escape sequence '\d' [-Wunknown-escape-sequence]
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:101: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: error: expected '{' after '\d' escape sequence
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:113: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: error: expected '{' after '\d' escape sequence
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:142: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: error: expected '{' after '\d' escape sequence
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:146: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
crypto/cversion.c:38:33: warning: unknown escape sequence '\i' [-Wunknown-escape-sequence]
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command line>:13:160: note: expanded from here
#define ENGINESDIR "D:\Users\Documents\GitHub\aw-android\aw-server-rust\target\aarch64-linux-android\debug\build\openssl-sys-ee67b57d3d3215a1\out\openssl-build\install/lib/engines-1.1"
^~
4 warnings and 4 errors generated.
make[3]: *** [crypto/cversion.o] Error 1
make[2]: *** [build_libs] Error 2
thread 'main' panicked at '
Error building OpenSSL:
Command: "make" "build_libs"
Exit status: exit code: 2
', C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.22.0+1.1.1q\src\lib.rs:490:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make[1]: *** [android] Error 101
make[1]: Leaving directory `D:/Users/Documents/GitHub/aw-android/aw-server-rust'
make: *** [aw-server-rust/target/armv7-linux-androideabi/debug/libaw_server.so] Error 2
C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.22.0+1.1.1q\src\lib.rs:490:13
- its still going somewhere else and not the ../openssl-src or ../openssl-sys
Not that good with rust building ( feels like shet :/ ) Can you spoonfeed a little please @adumbidiot 🥺 Edit: Thanks ! I was able to edit openssl-src now, and i fixed my build ty :3
Hello, I just ran into an issue trying to use the
vendored
feature to cross-compile from Windows 10 to a Raspberry Pi 2. I am using thenightly-x86_64-pc-windows-msvc
toolchain. The exact error can be seen in the captured stderr when the build fails:For my build, I specified the following environment variables:
I also set the linker through
RUSTFLAGS
asC:/SysGCC/raspberry/bin/arm-linux-gnueabihf-gcc
. I set my target asarmv7-unknown-linux-gnueabihf
.I tracked this down to
ENGINESDIR
having backslashes instead of forward slashes, and I tracked it back to the prefix option in the configure script. Currently, this library uses the following to set the prefix:I edited the bottom case to instead be
configure.arg(&format!("--prefix={}", install_dir.to_str().unwrap().replace('\\', "/")));
. I don't particularly understand the ramifications of this change, but it seems to fix my build.sanitize_sh
seems to only be applicable for Mingw as it tries to change the paths from Windows style to Mingw style. Could this be fixed by adding another case for windows msvc?