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

link error on ios: undefined symbols _kSCNetworkInterfaceTypeIrDA #5140

Closed
saintEvol opened this issue Feb 4, 2024 · 14 comments
Closed

link error on ios: undefined symbols _kSCNetworkInterfaceTypeIrDA #5140

saintEvol opened this issue Feb 4, 2024 · 14 comments
Labels
kind/stale need/author-input Needs input from the original author

Comments

@saintEvol
Copy link

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

@dariusc93
Copy link
Member

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?

@saintEvol
Copy link
Author

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

@santoshakil
Copy link

I'm facing the same problem.

@thomaseizinger
Copy link
Contributor

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?

@thomaseizinger thomaseizinger added the need/author-input Needs input from the original author label Feb 12, 2024
@saintEvol
Copy link
Author

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.

@saintEvol
Copy link
Author

saintEvol commented Feb 17, 2024

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.

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

@thomaseizinger
Copy link
Contributor

PRs for bumping dependencies are welcome: https://github.com/mxinden/if-watch/

Copy link

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

Copy link

github-actions bot commented Mar 5, 2024

This issue was closed because it is missing author input.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@chanderlud
Copy link

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?

@kucaca
Copy link

kucaca commented Aug 21, 2024

I'm trying to solve it this way
1、download https://github.com/mxinden/if-watch
2、/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)

@liuxingyubm
Copy link

摘要

我尝试在ios上的项目中使用rust-libp2p,如下:

libp2p = { version = "0.53.2", features = ["tcp"]}

然后,当我尝试在ios或ios模拟器上运行应用程序时,会出现以下错误:

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)

在安卓/macos/windows上没问题。

我知道如何解决这个问题非常感谢

预期行为

在ios上成功运行

实际行为

链接错误显示如下:

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)

相关日志输出

没有回应

可能的解决方案

没有回应

版本

没有回应

你想努力修复这个错误吗?

Have you solved this problem? I will now use flutter_rust_bridge_codegen to generate the project, rely on libp2p, will not run, but have libp2p in the rs file, will report this error

@liuxingyubm
Copy link

我正试图用这种方式解决它1、下载https://github.com/mxinden/if-watch2、/生锈/Cargo.toml [path.crates-io] if-watch = {path = <localpath>}3、if-watch/src/apple.rs删除系统配置代码4、flutter_rust_bridge_codegen generate && flutter run -v(可以看到rust一些错误)

Have you solved this problem? I will now use flutter_rust_bridge_codegen to generate the project, rely on libp2p, will not run, but have libp2p in the rs file, will report this error

@kucaca
Copy link

kucaca commented Aug 31, 2024

我正试图用这种方式解决它1、下载https://github.com/mxinden/if-watch2、/生锈/Cargo.toml [path.crates-io] if-watch = {path = <localpath>}3、if-watch/src/apple.rs删除系统配置代码4、flutter_rust_bridge_codegen generate && flutter run -v(可以看到rust一些错误)

Have you solved this problem? I will now use flutter_rust_bridge_codegen to generate the project, rely on libp2p, will not run, but have libp2p in the rs file, will report this error

if-watch/src/apple.rs 删除system_configuration报错相关代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/stale need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

7 participants