Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

string_init and ICU data directory

17 views
Skip to first unread message

Ron Blaschke

unread,
Feb 13, 2005, 6:50:28 AM2/13/05
to perl6-i...@perl.org
I'd like to clean up string_init, because it currently backfires
(segfaults) on Windows if parrot is installed (empty
DEFAULT_ICU_DATA_DIR ...).

Could someone please tell me what string_init is supposed to do, where
it _should_ look for the ICU data directory (if at all)?
...
build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
/*
* if the installed --prefix directory exists then use it
*/
prefix = Parrot_get_runtime_prefix(interpreter, NULL);
if (prefix) {
p = strstr(build_path, "blib"); /* .../blib/lib/... */
assert(p);
--p; /* slash or backslash */
data_dir = mem_sys_allocate(strlen(prefix) + strlen(p) + 1);
strcpy(data_dir, prefix);
strcat(data_dir, p);
free_data_dir = 1;
}
...

Ron


Leopold Toetsch

unread,
Feb 14, 2005, 6:07:51 AM2/14/05
to Ron Blaschke, perl6-i...@perl.org
Ron Blaschke <mailin...@rblasch.org> wrote:
> I'd like to clean up string_init, because it currently backfires
> (segfaults) on Windows if parrot is installed (empty
> DEFAULT_ICU_DATA_DIR ...).

Why is DEFAULT_ICU_DATA_DIR empty? Where is icu actually and which
config variable is pointing at it?

Is this happening with C<--prefix> set or not?

> Could someone please tell me what string_init is supposed to do, where
> it _should_ look for the ICU data directory (if at all)?
> ...
> build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
> /*
> * if the installed --prefix directory exists then use it
> */
> prefix = Parrot_get_runtime_prefix(interpreter, NULL);
> if (prefix) {
> p = strstr(build_path, "blib"); /* .../blib/lib/... */
> assert(p);

If there are other cases (system ICU or whatever) they should be
included here instead of the assert.

> Ron

leo

Ron Blaschke

unread,
Feb 14, 2005, 1:12:59 PM2/14/05
to Leopold Toetsch, perl6-i...@perl.org
Monday, February 14, 2005, 12:07:51 PM, Leopold Toetsch wrote:
> Ron Blaschke <mailin...@rblasch.org> wrote:
>> I'd like to clean up string_init, because it currently backfires
>> (segfaults) on Windows if parrot is installed (empty
>> DEFAULT_ICU_DATA_DIR ...).

> Why is DEFAULT_ICU_DATA_DIR empty? Where is icu actually and which
> config variable is pointing at it?

I've put the precompiled ICU into a directory, and supply the
--icushared and --icuheaders. This precompiled package contains only
the bin, include and lib. There's no data directory. This is because
the ICU built-in data gets compiled into binary form, the library is
named icudata.lib and icudt??.dll on Windows. If the data directory
is set to the empty string, the library is used.

"
The ICU data directory is determined as follows:
...
4. Otherwise, the ICU data directory is an empty string. This is the
default behavior for ICU using a shared library for its data and
provides the highest data loading performance.
...

The ICU data directory does not need to be set in order to reference
the standard built-in ICU data. Applications that just use standard
ICU capabilities (converters, locales, collation, etc.) but do not
build and reference their own data do not need to specify an ICU data
directory.
"
http://oss.software.ibm.com/icu/userguide/icudata.html


> Is this happening with C<--prefix> set or not?

No prefix, but it defaults to F</usr/local/parrot-0.1.1-devel>.


>> Could someone please tell me what string_init is supposed to do, where
>> it _should_ look for the ICU data directory (if at all)?
>> ...
>> build_path = data_dir = const_cast(DEFAULT_ICU_DATA_DIR);
>> /*
>> * if the installed --prefix directory exists then use it
>> */
>> prefix = Parrot_get_runtime_prefix(interpreter, NULL);
>> if (prefix) {
>> p = strstr(build_path, "blib"); /* .../blib/lib/... */
>> assert(p);

> If there are other cases (system ICU or whatever) they should be
> included here instead of the assert.

In my opinion, if only the built-in ICU data is used we should just
use the compiled library. If there are any modifications/extensions
(planned) I'll gladly provide a patch, including for F<README.win32>,
b/c C<--icudatadir> should be provided.

Ron


Leopold Toetsch

unread,
Feb 15, 2005, 3:54:46 AM2/15/05
to Ron Blaschke, perl6-i...@perl.org
Ron Blaschke <r...@rblasch.org> wrote:

> I've put the precompiled ICU into a directory, and supply the
> --icushared and --icuheaders. This precompiled package contains only
> the bin, include and lib. There's no data directory. This is because
> the ICU built-in data gets compiled into binary form, the library is
> named icudata.lib and icudt??.dll on Windows. If the data directory
> is set to the empty string, the library is used.

Ok. I've now put in a test for an empty string. Hope that works.

leo

Ron Blaschke

unread,
Feb 16, 2005, 4:01:52 AM2/16/05
to Leopold Toetsch, perl6-i...@perl.org

Thanks, parrot now runs, even if it is installed on Windows.

The install procedure needs some work, though, as a number of files is
not installed, eg parrot(.exe) and the dynclasses. But that's a
different story.

Ron

0 new messages