Comments (10)
I believe I have up-to-date versions of the rust_icu_* crates:
: guran%; cargo tree -i rust_icu_sys
rust_icu_sys v2.0.0
├── rust_icu_common v2.0.0
│ ├── rust_icu_ucol v2.0.0
│ │ └── r4s v0.1.0 (/usr/home/kaj/proj/r4s)
│ ├── rust_icu_uenum v2.0.0
│ │ └── rust_icu_ucol v2.0.0 (*)
│ └── rust_icu_ustring v2.0.0
│ └── rust_icu_ucol v2.0.0 (*)
├── rust_icu_ucol v2.0.0 (*)
├── rust_icu_uenum v2.0.0 (*)
└── rust_icu_ustring v2.0.0 (*)
My rust toolchain is:
stable-x86_64-unknown-freebsd unchanged - rustc 1.58.0 (02072b482 2022-01-11)
from rust_icu.
It is unexpected that only some of the symbols in the ICU library are renamed and some not.
be changed to just
#[cfg(not(feature="renaming"))]
That should not be correct, as
is supposed to cover that feature combination.from rust_icu.
@filmil huh? It seems to be line 9 and and 22 is for when renaming
is enabled, so I think line 33 should cover both the cases when renaming
is not enabled.
renaming | icu_version_in_env | selected |
---|---|---|
enabled | enabled | line 22 |
enabled | disabled | line 9 |
disabled | disabled | line 33 |
disabled | enabled | ?? |
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.
from rust_icu.
I also tried to disable features by changing my dependency to:
rust_icu_ucol = { version = "2.0.0", default-features = false }
but then I got the message:
error: You must use `renaming` when not using `use-bindgen`
So I changed the dependency to:
rust_icu_ucol = { version = "2.0.0", default-features = false, features = ["use-bindgen"] }
... and then I got this error:
error: couldn't read /usr/home/kaj/proj/r4s/target/debug/build/rust_icu_sys-00ce2788a020995a/out/macros.rs: No such file or directory (os error 2)
--> /home/kaj/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_icu_sys-2.0.0/src/lib.rs:45:1
|
45 | include!(concat!(env!("OUT_DIR"), "/macros.rs"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
from rust_icu.
Some more info on this; checking out the rust_icu sources on my FreeBSD host, I find cargo test
works fine in rust_icu_sys
and rust_icu_common
, but fails on versioned functions as above for other crates, such as rust_icu_ucol
and rust_icu_uenum
. So my present guess is 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?
from rust_icu.
from rust_icu.
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 rust_icy_sys
makes availiable for all dependent packages.
from rust_icu.
from rust_icu.
Same problem on Gentoo, icu-i18n.pc looks like this:
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (C) 2010-2013, International Business Machines Corporation. All Rights Reserved.
# CFLAGS contains only anything end users should set
CFLAGS =
# CXXFLAGS contains only anything end users should set
CXXFLAGS =
# DEFS only contains those UCONFIG_CPPFLAGS which are not auto-set by platform.h
DEFS = -DU_DISABLE_RENAMING=1
prefix = /usr
exec_prefix = ${prefix}
#bindir = ${exec_prefix}/bin
libdir = /usr/lib
includedir = ${prefix}/include
baselibs = -lpthread -lm
#datarootdir = /usr/share
#datadir = /usr/share
#sbindir = ${exec_prefix}/sbin
#mandir = /usr/share/man
#sysconfdir = /etc
UNICODE_VERSION=14.0
ICUPREFIX=icu
ICULIBSUFFIX=
LIBICU=lib${ICUPREFIX}
#SHAREDLIBCFLAGS=-fPIC
pkglibdir=${libdir}/icu${ICULIBSUFFIX}/71.1
#pkgdatadir=${datadir}/icu${ICULIBSUFFIX}/71.1
ICUDATA_NAME = icudt71l
#ICUPKGDATA_DIR=/usr/lib
#ICUDATA_DIR=${pkgdatadir}
ICUDESC=International Components for Unicode
Version: 71.1
Cflags: -I${includedir}
# end of icu.pc.in
Description: International Components for Unicode: Internationalization library
Name: icu-i18n
Requires: icu-uc
Libs: -licui18n
I think icu_sys only checks --cflags
?
from rust_icu.
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 rust_icu
doesn't find the -DU_DISABLE_RENAMING=1
flag, but I don't know if it is a bug in the FreeBSD pkgconfig data that it is not included in cflags or a bug in rust_icu
that it doesn't look at --variable=DEFS.
The FreeBSD port of icu runs configure for icu with --disable-renaming
(and some other flags) and does not seem to mess with the icu-*.pc
files, so it seems that those are as intended by the icu project.
Looking some more, it seems that the omission of the U_DISABLE_RENAMING
flag from --cflags is intentional. Instead, it is defined like this in unicode/uconfig.h
:
/**
* \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.
from rust_icu.
Related Issues (20)
- normalize_ustring hard-codes the output capacity to 200 HOT 5
- Support UCPTrie and UMutableCPTrie HOT 5
- Better support for &[u16]
- Add a builder that tests `rust_icu` with the "future" release of ICU
- Add support for ICU 72.1
- Remove the mentions of now unsupported ICU versions
- Expose a few interesting symbols in rust_icu_sys HOT 1
- Does not build in OpenSuSe when versioned_function is used HOT 3
- SOLVED - Error building on macOS HOT 1
- Upgrade to ICU 73.1 HOT 1
- Update bindgen version HOT 2
- `make static-bindgen` failed HOT 8
- Upgrade the build environment to use rust 1.71.0 HOT 1
- make UDataMemory Sync and Send HOT 1
- Verify support for ICU v74
- Drop support for ICU v71
- Add an automated test for buildenv
- Re-enable test-static-linking macos-latest
- rust_icu_utrans-bda1006a1ca627ee: /src/icu/icu4c/source/common/uinvchar.cpp:210: void u_UCharsToChars_74(const char16_t *, char *, int32_t): Assertion `false' failed. HOT 1
- linking `icu` from vcpkg? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust_icu.