Skip to content
Snippets Groups Projects
Commit 9485e9c1 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

build: fix libcrypto renaming

Renaming libcrypto breaks the rebuid. Repro:

```bash
cargo build -vv
rm -rf target/debug/picodata-*
cargo build -vv
```

It results in

```
[build.rs:204] running ["cmake" "--build" "target/debug/build/tarantool-sys/tarantool-prefix/src/tarantool-build"]
gmake[2]: *** No rule to make target 'target/debug/build/tarantool-sys/openssl-prefix/lib/libcrypto.a', needed by 'src/tarantool'.  Stop.
```

Instead of renaming this patch makes a symlink.
parent b0470eb1
No related branches found
No related tags found
1 merge request!564build: fix libcrypto renaming
Pipeline #19230 failed
......@@ -302,16 +302,14 @@ fn build_tarantool(build_root: &Path) {
rustc::link_lib_static("cares");
// `openssl-prefix/lib/libcrypto.a` conflicts with
// `src/lib/crypto/libcrypto.a` by name when passed as `-lcrypto` link
// argument. So we rename one of the libraries, which seems to solve the
// problem.
// `src/lib/crypto/libcrypto.a` by name when passed as `-lcrypto`
// link argument. So we symlink it into `libcrypto-ssl.a` and pass
// as `-lcrypto-ssl`.
let openssl_dir = build_dir.join("openssl-prefix/lib");
let old_lib = openssl_dir.join("libcrypto.a");
let new_lib = openssl_dir.join("libcrypto-ssl.a");
let symlink = openssl_dir.join("libcrypto-ssl.a");
if old_lib.exists() {
std::fs::remove_file(&new_lib).ok();
std::fs::rename(old_lib, new_lib).unwrap();
if !symlink.exists() {
std::os::unix::fs::symlink("libcrypto.a", symlink).unwrap();
}
rustc::link_search(format!("{b}/openssl-prefix/lib"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment