Repository: seanmonstar/reqwest (language: rust)

Issue:
Apple linker errors in 0.11.22
Migrating from 0.11.20 to 0.11.22 unearths some linker issues when building a universal binary for macos/ios ([CI run](https://github.com/subconsciousnetwork/noosphere/actions/runs/6566865808/job/17840254182?pr=549)):

```
Undefined symbols for architecture x86_64:
  "_SCDynamicStoreCopyProxies", referenced from:
      __ZN20system_configuration13dynamic_store14SCDynamicStore11get_proxies17ha9cee4367b0c1fcbE in libnoosphere.a(system_configuration-46c6672ca6db6ca9.system_configuration.b48ec42a4ca5d16c-cgu.0.rcgu.o)
  "_SCDynamicStoreCreateWithOptions", referenced from:
      __ZN20system_configuration13dynamic_store14SCDynamicStore6create17he63aeeeb3840fdc4E in libnoosphere.a(system_configuration-46c6672ca6db6ca9.system_configuration.b48ec42a4ca5d16c-cgu.0.rcgu.o)
  "_SCNetworkInterfaceCopyAll", referenced from:
      __ZN20system_configuration21network_configuration14get_interfaces17ha41c0e3fd9b2cb6eE in libnoosphere.a(system_configuration-46c6672ca6db6ca9.system_configuration.b48ec42a4ca5d16c-cgu.0.rcgu.o)
  "_SCNetworkInterfaceGetBSDName", referenced from:
      __ZN20system_configuration21network_configuration18SCNetworkInterface8bsd_name17h45a02c56c7f559b2E in libnoosphere.a(system_configuration-46c6672ca6db6ca9.system_configuration.b48ec42a4ca5d16c-cgu.0.rcgu.o)
  "_SCNetworkInterfaceGetInterfaceType", referenced from:
      __ZN20system_configuration21network_configuration18SCNetworkInterface21interface_type_string17hd31e474b334507ecE in libnoosphere.a(system_configuration-46c6672ca6db6ca9.system_configuration.b48ec42a4ca5d16c-cgu.0.rcgu.o)
  "_SCNetworkInterfaceGetLocalizedDisplayName", referenced from:
      __ZN20system_configuration21network_configuration18SCNetworkInterface12display_name17h94d4d8074b27dd32E in libnoosphere.a(system_configuration-46c6672ca6db6ca9.system_configuration.b48ec42a4ca5d16c-cgu.0.rcgu.o)
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
```

This looks to be introduced by https://github.com/seanmonstar/reqwest/pull/1955 and the [system-configuration](https://github.com/mullvad/system-configuration-rs) dependency. Some [possibly related issues](https://github.com/mullvad/system-configuration-rs/issues/41)


Discussion / hints:
Would be nice if this dependency could be made optional, at least until upstream issue are fixed.
https://github.com/seanmonstar/reqwest/pull/2080 could circumvent this
add **SystemConfiguration.framework**

- [irondash/cargokit #52 -1883141494](https://github.com/irondash/cargokit/issues/52#issuecomment-1883141494)

- [irondash/cargokit #52 -1883205459](https://github.com/irondash/cargokit/issues/52#issuecomment-1883205459)


> add **SystemConfiguration.framework**
> 
>     * [irondash/cargokit #52 -1883141494](https://github.com/irondash/cargokit/issues/52#issuecomment-1883141494)
> 
>     * [irondash/cargokit #52 -1883205459](https://github.com/irondash/cargokit/issues/52#issuecomment-1883205459)

AFAICT, the underlying `system-configuration` lib is linking to SystemConfiguration:
https://github.com/mullvad/system-configuration-rs/blob/c8711c5c62e263fc00972164293118380df631af/system-configuration-sys/build.rs#L10-L12
```rs
fn main() {
    if std::env::var("TARGET").unwrap().contains("-apple") {
        println!("cargo:rustc-link-lib=framework=SystemConfiguration");
    }
}
```
It looks like we have a fix in `system-configuration` released in v0.6.0. Perhaps we could update the dependency to fix this?

I'm going to attempt it in a patch.

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 3e88a0e9e..6d681e6d5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -161,7 +161,7 @@ futures-util = { version = "0.3.0", default-features = false, features = ["std",
 winreg = "0.50.0"
 
 [target.'cfg(target_os = "macos")'.dependencies]
-system-configuration = "0.5.1"
+system-configuration = "0.6"
 
 # wasm
 


Test patch: