google / rust_icu

rust_icu: rust bindings for ICU (International Components for Unicode) library
Apache License 2.0
117 stars 28 forks source link

Add `static` feature flag #255

Closed SabrinaJewson closed 1 year ago

SabrinaJewson commented 2 years ago

This is not the same solution as in #228, but it works perfectly fine for me. Also, note that I’m not too well-versed in linking so I may have made a mistake here.

Closes: #228

filmil commented 2 years ago

Thank you for this contribution and the other PRs you sent. Please allow me some time to get around to reviewing them. Thanks for your patience!

SabrinaJewson commented 2 years ago

Ah, I just realized that while my distribution has the system ICU compiled with -fPIC (so it works perfectly fine with Rust), some distributions don’t (like Ubuntu) — that means static linking won’t work for them, and we’ll have to add another feature flag to enable building from source. So I’ll convert this to a draft for now.

filmil commented 2 years ago

OK, let me know what you want to do with the PR once it's ready.

filmil commented 1 year ago

Ping?

SabrinaJewson commented 1 year ago

Right, sorry, I forgot to update this. So I tried adding automatic building of ICU to the build script via another feature flag, but the thing is that turns out to be very slow and also annoying because it doesn’t give any output during the build process. I think the best course of action here is to merge this for the use case where people do have a prebuilt PIC ICU available, and then figure out what to do about building from source separately.

mpalmer commented 1 year ago

This PR landed at a really great time, as I'm in need of static-linked ICU in a Rust project. Thanks for putting it together, @SabrinaJewson. Do you have any indication, @filmil, of when this PR is likely to make it into a release?

filmil commented 1 year ago

I'm afk for the next 3-4 days but and will try to release thereabouts.