gettext-rs icon indicating copy to clipboard operation
gettext-rs copied to clipboard

Build failed on macos

Open putao0525 opened this issue 1 year ago • 8 comments

image image

putao0525 avatar Jun 11 '24 02:06 putao0525

image

putao0525 avatar Jun 11 '24 03:06 putao0525

It's normal that you don't have TARGET in your shell; this variable is set by Cargo when running the build script: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

Can you show the build log so I can see what error you're getting?

Minoru avatar Jun 12 '24 14:06 Minoru

FWIW I can reproduce this as well. Build log attached. build.log

jelmer avatar Jun 17 '24 09:06 jelmer

I don't understand English very well. I've solved the problem。 This problem is because my macos is a newer version。 The system already has the library installed, but build.rs can't find the class for that system. My solution was to rebuild build.rs but , There are a lot of upwarps() in build.rs, which is not recommended

putao0525 avatar Jun 17 '24 09:06 putao0525

解决办法:
println!("cargo:rustc-link-lib=framework=CoreFoundation");
println!("cargo:rustc-link-lib=dylib=iconv");
println!("cargo:rustc-link-lib=static=intl");
println!("cargo:rustc-link-search=native={}/lib", "/opt/homebrew/opt/gettext");
println!("cargo:lib={}/lib", "opt/homebrew/opt/gettext");
println!("cargo:include={}/include", "/opt/homebrew/opt/gettext");
println!("cargo:bin={}/bin", "opt/homebrew/opt/gettext");
println!("cargo:root={}", "opt/homebrew/opt/gettext");

putao0525 avatar Jun 17 '24 09:06 putao0525

@jeimer Ah, it's the same failure at #114. I hope to go through all the issues in this repo in July and make a new release; I think I'll just disable that warning.

Minoru avatar Jun 17 '24 09:06 Minoru

@Minoru or apparently #119 resolves it as well? It would be good to get that merged.

jelmer avatar Jun 17 '24 10:06 jelmer

Can confirm that #119 addresses the issue.

jelmer avatar Jun 17 '24 13:06 jelmer

I just published gettext-sys 0.21.4 that includes a fix for this.

Minoru avatar Aug 30 '24 19:08 Minoru