cloudflare / boring

BoringSSL bindings for the Rust programming language.
367 stars 114 forks source link

fix: invalid -L path for build artifact search #223

Closed poliorcetics closed 4 days ago

poliorcetics commented 9 months ago

I haven't managed to link boring for either Linux, windows or macOS without this modification recently, which I find strange

Do you have any idea of what could be happening ?

rushilmehra commented 9 months ago

What's the build error? And what version of boringssl are you building with?

Guiguiprim commented 8 months ago

The error is error: could not find native static librarycrypto, perhaps an -L flag is missing? when building an app using boring 4.5.0 on windows.

PaulDance commented 1 month ago

@rushilmehra would it be possible to review this again, please? I haven't tested recently, but I'm pretty sure we still have the issue. Thanks in advance.

PaulDance commented 1 week ago

Just tested it under 4.12.0 from crates.io and the issue persists.

PaulDance commented 1 week ago

Considering the patch on our end is now simply:

diff --git a/boring-sys/build/main.rs b/boring-sys/build/main.rs
index 86075d3c..3ff818b3 100644
--- a/boring-sys/build/main.rs
+++ b/boring-sys/build/main.rs
@@ -663,6 +663,10 @@ fn main() {
             bssl_dir.display(),
             build_path
         );
+        println!(
+            "cargo:rustc-link-search=native={}/build",
+            bssl_dir.display(),
+        );
     }

     if config.features.fips_link_precompiled {

this should probably be closed and re-opened @rushilmehra, as I have neither the possibility to change the source branch nor close this PR.