Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols when archiving (release build) on iOS #41

Closed
tmpfs opened this issue Jul 1, 2023 · 8 comments
Closed

Undefined symbols when archiving (release build) on iOS #41

tmpfs opened this issue Jul 1, 2023 · 8 comments

Comments

@tmpfs
Copy link

tmpfs commented Jul 1, 2023

I just came across this error when compiling a release build for iOS:

Undefined symbols for architecture arm64:
  "_kSCNetworkInterfaceTypeIrDA", referenced from:
      system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::h2e804825311d5049 in libsos_native_bindings_static.a(system_configuration-f1f2543c1b6493c9.system_configuration.5fa3ee70-cgu.0.rcgu.o)

I am using this library as a transient dependency via if-watch and I wonder what the correct way to fix this is.

The documentation states that the field is deprecated and no longer exists after MacOS 12.0 what I don't understand is why it is affecting my iOS build (the MacOS build continues to work as expected).

Any ideas?

@tmpfs
Copy link
Author

tmpfs commented Jul 1, 2023

I have hacked this so i can keep publishing my app by removing the IrDA variant and using [patch.crates-io].

Is the proper fix to add #[cfg(not(target_os = "ios"))] for that variant maybe?

@Stormshield-robinc
Copy link

Hi,

I got the exact same issue on my project.

@omerfirmak
Copy link

@jplatte
Copy link

jplatte commented Oct 10, 2023

Lots of similar missing symbols here (since upgrading reqwest to a version that uses system-configuration), though for stable-x86_64-apple-darwin AFAICT: https://github.com/matrix-org/matrix-rust-sdk/actions/runs/6468437238/job/17560484887?pr=2688#step:10:129

Undefined symbols for architecture x86_64:
  "_SCDynamicStoreCopyProxies", referenced from:
      __ZN20system_configuration13dynamic_store14SCDynamicStore11get_proxies17h328064587f53a31aE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCDynamicStoreCreateWithOptions", referenced from:
      __ZN20system_configuration13dynamic_store14SCDynamicStore6create17hb2f29a47ef35d2b8E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkInterfaceCopyAll", referenced from:
      __ZN20system_configuration21network_configuration14get_interfaces17h5501126a03cf3389E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkInterfaceGetBSDName", referenced from:
      __ZN20system_configuration21network_configuration18SCNetworkInterface8bsd_name17h61f5852902f9e60eE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkInterfaceGetInterfaceType", referenced from:
      __ZN20system_configuration21network_configuration18SCNetworkInterface21interface_type_string17hea5dc86202a46775E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkInterfaceGetLocalizedDisplayName", referenced from:
      __ZN20system_configuration21network_configuration18SCNetworkInterface12display_name17hd81bc34f95e437a6E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      __ZN147_$LT$system_configuration..network_reachability..SCNetworkReachability$u20$as$u20$core..convert..From$LT$core..net..socket_addr..SocketAddr$GT$$GT$4from17hdca88e557691abfeE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkReachabilityCreateWithAddressPair", referenced from:
      __ZN20system_configuration20network_reachability21SCNetworkReachability14from_addr_pair17h9a8cc4700d1112ddE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkReachabilityCreateWithName", referenced from:
      __ZN20system_configuration20network_reachability21SCNetworkReachability9from_host17h3061bde5c6ca6858E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkReachabilityGetFlags", referenced from:
      __ZN20system_configuration20network_reachability21SCNetworkReachability12reachability17ha2b30b48b6ce607eE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      __ZN20system_configuration20network_reachability21SCNetworkReachability21schedule_with_runloop17h58917dadd326061dE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      __ZN20system_configuration20network_reachability21SCNetworkReachability23unschedule_from_runloop17h3842353e378da16eE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkServiceCopyAll", referenced from:
      __ZN20system_configuration21network_configuration16SCNetworkService12get_services17h9ce5d65f8c7d1d78E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkServiceGetEnabled", referenced from:
      __ZN20system_configuration21network_configuration16SCNetworkService7enabled17hd50d0336876ebacaE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkServiceGetInterface", referenced from:
      __ZN20system_configuration21network_configuration16SCNetworkService17network_interface17h20c195f2798848d1E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkServiceGetServiceID", referenced from:
      __ZN20system_configuration21network_configuration16SCNetworkService2id17hdbc788bbcc635a2eE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkSetCopyCurrent", referenced from:
      __ZN20system_configuration21network_configuration12SCNetworkSet3new17h1bacbcc8f63348f8E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_SCNetworkSetGetServiceOrder", referenced from:
      __ZN20system_configuration21network_configuration12SCNetworkSet13service_order17h3bc003a47dc61cdaE in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCDynamicStoreUseSessionKeys", referenced from:
      __ZN20system_configuration13dynamic_store30SCDynamicStoreBuilder$LT$T$GT$20create_store_options17h195319dda4f9137aE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
  "_kSCNetworkInterfaceType6to4", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeBluetooth", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeBond", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeBridge", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeEthernet", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeFireWire", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeIEEE80211", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeIPSec", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeIPv4", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeIrDA", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeL2TP", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeModem", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypePPP", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypePPTP", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeSerial", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeVLAN", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCNetworkInterfaceTypeWWAN", referenced from:
      __ZN20system_configuration21network_configuration22SCNetworkInterfaceType13from_cfstring17h8b3415946c6f3615E in libmatrix_sdk_ffi.a(system_configuration-ae13bd1fa583dace.system_configuration.49a668a74e63eff1-cgu.0.rcgu.o)
  "_kSCPropNetProxiesHTTPEnable", referenced from:
      __ZN7reqwest5proxy22get_from_platform_impl17h7f154cf7a0bf680cE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
  "_kSCPropNetProxiesHTTPPort", referenced from:
      __ZN7reqwest5proxy22get_from_platform_impl17h7f154cf7a0bf680cE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
  "_kSCPropNetProxiesHTTPProxy", referenced from:
      __ZN7reqwest5proxy22get_from_platform_impl17h7f154cf7a0bf680cE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
  "_kSCPropNetProxiesHTTPSEnable", referenced from:
      __ZN7reqwest5proxy22get_from_platform_impl17h7f154cf7a0bf680cE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
  "_kSCPropNetProxiesHTTPSPort", referenced from:
      __ZN7reqwest5proxy22get_from_platform_impl17h7f154cf7a0bf680cE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
  "_kSCPropNetProxiesHTTPSProxy", referenced from:
      __ZN7reqwest5proxy22get_from_platform_impl17h7f154cf7a0bf680cE in libmatrix_sdk_ffi.a(reqwest-95b392646e2de70e.reqwest.4c34a75e9d02bcf5-cgu.12.rcgu.o)
ld: symbol(s) not found for architecture x86_64

@dlon
Copy link
Member

dlon commented Dec 27, 2023

#43 has been merged, which should address this.

@dlon dlon closed this as completed Dec 27, 2023
@jplatte
Copy link

jplatte commented Jan 2, 2024

Is a new crates.io release with the fix coming?

@faern
Copy link
Member

faern commented Jan 31, 2024

This is now part of the just published 0.6.0 release.

@faern
Copy link
Member

faern commented Jan 31, 2024

The bindings to kSCNetworkInterfaceTypeIrDA are still left in system-configuration-sys. BUT it's not referenced from system-configuration so it should not trigger an error. It will only give an error if any code references that symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants