-
Notifications
You must be signed in to change notification settings - Fork 29
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
Problem with versioned functions (FreeBSD) #236
Comments
I believe I have up-to-date versions of the rust_icu_* crates:
My rust toolchain is:
|
It is unexpected that only some of the symbols in the ICU library are renamed and some not.
That should not be correct, as
|
@filmil huh? It seems to be line 9 and and 22 is for when
But maybe icu_version_in_env is never enabled unless renaming is? It seems to me that renaming is enabled when building on FreeBSD but should not be. |
I also tried to disable features by changing my dependency to:
but then I got the message:
So I changed the dependency to:
... and then I got this error:
|
Some more info on this; checking out the rust_icu sources on my FreeBSD host, I find Thoughts on that? Any suggestions for things I can try? |
On Sun, Jan 16, 2022 at 11:33 AM Rasmus Kaj ***@***.***> wrote:
that rust_icu_sys detects the unversioned symbol fine and works with
them, but somehow fails to communicate this to downstream crates.
Thoughts on that? Any suggestions for things I can try?
This may well be. You must turn on the feature in *all* dependent crates
to have it actually be used, even in transient dependencies.
I am not quite sure why this is the case with cargo, but it seems to be.
Message ID: ***@***.***>
… |
It seems I was actually rather close above (#236 (comment)). If I edit the dependency like this it works: rust_icu_ucol = { version = "2.0.0", default-features = false, features = ["use-bindgen", "icu_config"] } ... but of course, like that it does not build on Linux anymore. So I really think these flags should not be cargo features to be enabled or not from the consuming package at all, but instead autodetected flags that |
On Sun, Jan 16, 2022 at 3:19 PM Rasmus Kaj ***@***.***> wrote:
... but of course, like that it does not build on Linux anymore. So I
really think these flags should not be cargo features to be enabled or not
from the consuming package at all, but instead autodetected flags that
rust_icy_sys makes availiable for all dependent packages.
rust_icu_sys does auto-detect the settings.
But, the auto-detection is only as good as the pkg-config data that the
system provides. If the pkg-config data is incorrect, and I have some
suspicion that it might not be on your system based on the prior
description of versioning, then one could expect issues. Since I don't have
a FreeBSD to try this on, may I ask you to figure out the full
configuration of ICU on your system and we could perhaps work from there.
To wit, what are the `--cflags` in use for the various ICU library
components?
Thanks!
Message ID: ***@***.***>
… |
Same problem on Gentoo, icu-i18n.pc looks like this:
I think icu_sys only checks |
Here's output from a bunch of pkg-config commands on my FreeBSD host: :; pkg-config icu-i18n --cflags
-I/usr/local/include
:; pkg-config icu-i18n --libs
-licui18n -L/usr/local/lib -licuuc -licudata
:; pkg-config icu-i18n --variable=DEFS
-DU_DISABLE_RENAMING=1
:;
:; pkg-config icu-i18n --print-requires
icu-uc
:;
:; pkg-config icu-uc --cflags
-I/usr/local/include
:; pkg-config icu-uc --libs
-L/usr/local/lib -licuuc -licudata
:; pkg-config icu-uc --variable=DEFS
-DU_DISABLE_RENAMING=1 I guess the problem is that The FreeBSD port of icu runs configure for icu with Looking some more, it seems that the omission of the /**
* \def U_DISABLE_RENAMING
* Determines whether to disable renaming or not.
* @internal
*/
#ifndef U_DISABLE_RENAMING
#define U_DISABLE_RENAMING 1
#endif So I guess the correct way of finding if renaming is enabled or not is to build and run a little program like this: #include <unicode/uconfig.h>
#include <stdio.h>
int main() {
if (U_DISABLE_RENAMING) {
printf("Renaming disabled");
} else {
printf("Renaming enabled");
}
} ... then compile that with proper flags from pkg-config, run it, and look at the output. |
Trying to build rust_icu_ustring on FreeBSD (after getting around #235), I get a bunch of errors like this:
I get eleven such errors, all for different function names
u_\w+_70
. Checking the actual library, (withnm --dynamic --defined-only (libfile)
it contains the symbols likeu_strFromUTF8
but no symbols ending with_70
(or any other _number). The same command on linux (Fedora 35) showsu_strFromUTF8_69
(but no unversioned symbols).The version number itself is correct,
libicuuc.so
on my FreeBSD host is a symlink tolibicuuc.so.70.1
. But the symbols in it are not versioned.In
rust_icu_sys/bindgen/macros.rs
, it seems that versioning can be disabled by not using therenaming
or theicu_version_in_env
feature, but apparently at least one or those gets defined in my build even though it should not. Or should the cfgrust_icu/rust_icu_sys/bindgen/macros.rs
Lines 32 to 39 in fc64773
be changed to just
#[cfg(not(feature="renaming"))]
?
The text was updated successfully, but these errors were encountered: