tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Rust build failure on Darwin




> Am 18.06.2023 um 00:14 schrieb Havard Eidnes <he%NetBSD.org@localhost>:
> 
>> while in a pkg_rolling-replace, I noticed that both lang/rust
>> and wip/rust fail to compile on Darwin (on macOS 14 Beta,
>> arm64) with a very similar error about not being able to find
>> OpenSSL:
>> 
>> error: linking with `cc` failed: exit status: 1
>>  |
> ...
>>  = note: ld: library not found for -lssl
> ...
>> Any ideas? Apologies for the long build log excerpt.
> 
> No, sorry, I'll have to admit that I do not have a testing rig
> for building rust on Darwin / MacOS…

This seems like a straightforward patch to avoid pulling in libs from Homebrew:

$NetBSD$

--- vendor/openssl-sys/build/find_normal.rs.orig        2023-05-31 21:44:49.000000000 +0000
+++ vendor/openssl-sys/build/find_normal.rs
@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir:
 fn find_openssl_dir(target: &str) -> OsString {
     let host = env::var("HOST").unwrap();
  -    if host == target && target.ends_with("-apple-darwin") {
-        let homebrew_dir = match target {
-            "aarch64-apple-darwin" => "/opt/homebrew",
-            _ => "/usr/local",
-        };
-
-        if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
-            return dir.into();
-        } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
-            // pkgsrc
-            return dir.into();
-        } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
-            // MacPorts
-            return dir.into();
-        }
-    }
-
     try_pkg_config();
     try_vcpkg();

OK to commit?

I think this will be an uphill battle in the future though, with any app that includes the openssl-sys crate. Maybe I should open an issue upstream. 

— 
Benny



Home | Main Index | Thread Index | Old Index