rust-libp2p
rust-libp2p copied to clipboard
link error on ios: undefined symbols _kSCNetworkInterfaceTypeIrDA
Summary
I try to use rust-libp2p in my project on ios
as following:
libp2p = { version = "0.53.2", features = ["tcp"]}
then the following error appears when I try to run my app on ios or ios simulator:
ld: Undefined symbols:
_kSCNetworkInterfaceTypeIrDA, referenced from:
system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::hc44a3e2b89f201b4 in librust_lib.a[arm64][123](system_configuration-48a9d13717661e26.system_configuration.e30cfccd1f6797a8-cgu.0.rcgu.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
On android/macos/windows it's ok.
I 'd like to know how could I resolve this issue many thanks
Expected behavior
run on ios successfully
Actual behavior
link error appears as following:
ld: Undefined symbols:
_kSCNetworkInterfaceTypeIrDA, referenced from:
system_configuration::network_configuration::SCNetworkInterfaceType::from_cfstring::hc44a3e2b89f201b4 in librust_lib.a[arm64][123](system_configuration-48a9d13717661e26.system_configuration.e30cfccd1f6797a8-cgu.0.rcgu.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Relevant log output
No response
Possible Solution
No response
Version
No response
Would you like to work on fixing this bug ?
No
Hmm the last time ive ran libp2p on ios I never seen this error, though it been awhile. Could you describe your building environment like the version of macos youre using, etc?
Hmm the last time ive ran libp2p on ios I never seen this error, though it been awhile. Could you describe your building environment like the version of macos youre using, etc?
thanks for your reply, the building environment is as following:
macos: sonoma 14.2.1
xcode: 15.2
the libp2p is used in a project created by flutter_rust_bridge_codegen create
, as I know, in this case, rust is built by cargokit
I'm facing the same problem.
This is very likely an upstream bug of the system_configuration
crate (see the stack trace). Can you reproduce the problem if you just depend on that one?
This is very likely an upstream bug of the
system_configuration
crate (see the stack trace). Can you reproduce the problem if you just depend on that one?
i just tested with system-configuration = {version = "0.6.0"}
and successful on ios, before that I have updated the rust toolchain to the latest. But when I try to use libp2p
, the same problem still exist.
This is very likely an upstream bug of the
system_configuration
crate (see the stack trace). Can you reproduce the problem if you just depend on that one?i just tested with
system-configuration = {version = "0.6.0"}
and successful on ios, before that I have updated the rust toolchain to the latest. But when I try to uselibp2p
, the same problem still exist.
I just found that the libp2p-tcp
v0.41.0 depends on if-watch 3.2.0
which depends onsystem-configuration v0.5.1
via command cargo tree --all-features
and when I switch to that version, the problem is reproduced, so I guess that maybe the problem is that the libp2p-tcp
depends on the improper version of system-configuration
PRs for bumping dependencies are welcome: https://github.com/mxinden/if-watch/
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.
This issue was closed because it is missing author input.
Hello, the author of the if-watch
crate which is the source of this issue is no longer maintaining said crate which means that this issue is still unresolved and rust-libp2p
cannot compile for iOS. Are the maintainers of this library willing to migrate the if-watch
dependency to a new fork to resolve this issue?
I'm trying to solve it this way
1、download https://github.com/mxinden/if-watch
2、<flutterProject>/rust/Cargo.toml
[path.crates-io] if-watch = {path = <localpath>}
3、if-watch/src/apple.rs remove system-configuration code
4、flutter_rust_bridge_codegen generate && flutter run -v (can see rust some error)