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

Getting error when running on macOS Monterey M1? #77

Closed
uzador opened this issue Dec 5, 2022 · 6 comments
Closed

Getting error when running on macOS Monterey M1? #77

uzador opened this issue Dec 5, 2022 · 6 comments
Labels
question Further information is requested

Comments

@uzador
Copy link
Contributor

uzador commented Dec 5, 2022

cargo build works fine

...
Finished dev [unoptimized + debuginfo] target(s) in 4.93s

When I run example cargo r --example simple_app then it fails :(

error: linking with cc failed: exit status: 1
|
= note: "cc" "-arch" "arm64" "/var/folders/75/zhdmjhsd4svgjtv3281gbcxm0000gp/T/rustchw5hAI/symbols.o" "/.../nacos-sdk-rust/target/debug/examples/simple_app-f81418a421323162.111jv2pm79r6org0.rcgu.o" "/.../nacos-sdk-rust/target/debug/examples/simple_app-f81418a421323162.11eq76cjlcfn2lm5.rcgu.o"
.
.
.
.
"/.../.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-d567ed3625eefebc.rlib" "-framework" "Security" "-framework" "CoreFoundation" "-lc++" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/.../rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/.../nacos-sdk-rust/target/debug/examples/simple_app-f81418a421323162" "-Wl,-dead_strip" "-nodefaultlibs"
= note: ld: warning: directory not found for option '-L/.../nacos-sdk-rust/target/debug/build/libz-sys-aa02c4250e7bfed2/out/build'
Undefined symbols for architecture arm64:
"_res_9_getservers", referenced from:
_init_by_resolv_conf in libgrpcio_sys-94980c6c5e8bf971.rlib(ares_init.c.o)
"_res_9_ndestroy", referenced from:
_init_by_resolv_conf in libgrpcio_sys-94980c6c5e8bf971.rlib(ares_init.c.o)
"_res_9_ninit", referenced from:
_init_by_resolv_conf in libgrpcio_sys-94980c6c5e8bf971.rlib(ares_init.c.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My env:

… % gcc --version
gcc (Homebrew GCC 12.2.0) 12.2.0
…

… % g++ --version
g++ (Homebrew GCC 12.2.0) 12.2.0
…

… % cmake --version
cmake version 3.24.2
…

.. % rustc --version
rustc 1.66.0-nightly (1898c34e9 2022-10-26)

Could you advice if I've missed anything?

@CherishCai
Copy link
Collaborator

Not M1 is OK, I will try in M1 tomorrow. @uzador I'm sorry I'm not professional enough

    Finished dev [unoptimized + debuginfo] target(s) in 0.49s
     Running `target/debug/examples/simple_app`
2022-12-05T15:22:48.233522Z DEBUG nacos_sdk::common::remote::grpc: register_bi_call_handler key=ConfigChangeNotifyRequest
2022-12-05T15:22:48.233687Z  INFO nacos_sdk::common::remote::grpc::grpc_client: init grpc client: 0.0.0.0:9848
^C
caihongwen@caidage [23:22:56] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
caihongwen@caidage [23:23:08] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
caihongwen@caidage [23:23:31] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % cmake --version
cmake version 3.23.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
caihongwen@caidage [23:23:43] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % rustc --version
rustc 1.64.0 (a55dd71d5 2022-09-19)

@CherishCai CherishCai added the question Further information is requested label Dec 5, 2022
@uzador
Copy link
Contributor Author

uzador commented Dec 5, 2022

Not M1 is OK, I will try in M1 tomorrow. @uzador I'm sorry I'm not professional enough

    Finished dev [unoptimized + debuginfo] target(s) in 0.49s
     Running `target/debug/examples/simple_app`
2022-12-05T15:22:48.233522Z DEBUG nacos_sdk::common::remote::grpc: register_bi_call_handler key=ConfigChangeNotifyRequest
2022-12-05T15:22:48.233687Z  INFO nacos_sdk::common::remote::grpc::grpc_client: init grpc client: 0.0.0.0:9848
^C
caihongwen@caidage [23:22:56] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
caihongwen@caidage [23:23:08] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
caihongwen@caidage [23:23:31] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % cmake --version
cmake version 3.23.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
caihongwen@caidage [23:23:43] [~/IdeaProjects/nacos-sdk-rust] [main]
-> % rustc --version
rustc 1.64.0 (a55dd71d5 2022-09-19)

@CherishCai if you could try it would be great!

@CherishCai
Copy link
Collaborator

CherishCai commented Dec 6, 2022

@uzador My M1 doesn't have this problem,Perhaps the impact is due to the gcc version?

warning: `nacos-sdk` (example "simple_app") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 17.16s
     Running `target/debug/examples/simple_app`
2022-12-06T02:30:25.042465Z DEBUG nacos_sdk::common::remote::grpc: register_bi_call_handler key=ConfigChangeNotifyRequest
2022-12-06T02:30:25.042709Z  INFO nacos_sdk::common::remote::grpc::grpc_client: init grpc client: 0.0.0.0:9848
Error: ClientUnhealthy("can't connect target server, please check network or the server address if it's wrong.")
[~/IdeaProjects/nacos-sdk-rust] [main]
-> % gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
[~/IdeaProjects/nacos-sdk-rust] [main]
-> % g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
[~/IdeaProjects/nacos-sdk-rust] [main]
-> % cmake --version
cmake version 3.24.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[~/IdeaProjects/nacos-sdk-rust] [main]
-> % rustc --version
rustc 1.65.0 (897e37553 2022-11-02)

image

@uzador
Copy link
Contributor Author

uzador commented Dec 6, 2022

@CherishCai It was my bad :) I even couldn't think that rust's nightly version could break the app. After changing to stable one I don't see any issues! Thanks.

@uzador uzador closed this as completed Dec 6, 2022
@shaodan
Copy link

shaodan commented Jan 16, 2023

current stable version is 1.66.1, I get the same error #92

@CherishCai
Copy link
Collaborator

tikv/grpc-rs#600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants