Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 782919 - Building dev-libs/libutf8proc-2.6.1 with USE="cjk" prevents dev-lang/julia from printing matrices
Summary: Building dev-libs/libutf8proc-2.6.1 with USE="cjk" prevents dev-lang/julia fr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Akinori Hattori
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-04-15 03:20 UTC by Jason Waataja
Modified: 2021-09-25 02:58 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_782919.txt,7.78 KB, text/plain)
2021-04-15 03:20 UTC, Jason Waataja
Details
C program to print value (test.c,124 bytes, text/x-csrc)
2021-04-15 03:21 UTC, Jason Waataja
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Waataja 2021-04-15 03:20:36 UTC
Created attachment 699906 [details]
emerge --info

When I build dev-libs/utf8proc-2.6.1 with the "cjk" flag, then julia can't print matrices or vectors. For example, entering "[1, 2]" into the julia repl gives

2-element Vector{Int64}:
Error showing value of type Vector{Int64}:
ERROR: AssertionError: textwidth(hdots) == textwidth(ddots)

I dug into into this a bit. The assertion fails because it believes the text width of the unicode characters 0x2026 and 0x22f1 differ.

The data containing the width of these characters comes from the utf8proc library. I've confirmed by compiling the attached C program with "gcc test.c -lutf8proc -o test" and then running "./test" that when compiling the library with the "cjk" flag, the result of printing the textwidth of the character 0x2026 is "2", but building without that flag gives the result "1", which is the same as when I use the version of the library on GitHub.

It seems that the cjk flag replaces one of the data files in the library. The fact that it changes the value for this character is odd, since 0x2026 represents three horizontal dots, which has nothing to do with cjk characters as far as I'm aware. If the change is correct, then this is a problem with julia. If it's an error with the patch, then I'm not sure how many other characters might be affected.
Comment 1 Jason Waataja 2021-04-15 03:21:12 UTC
Created attachment 699909 [details]
C program to print value
Comment 2 Akinori Hattori gentoo-dev 2021-04-20 13:52:48 UTC
Did you read the following message from the ebuild?

 * Modifying East Asian Ambiguous (A) as wide ...

It may cause some trouble with software that expect the width of ambiguous characters as halfwidth.

I recommend to disable the cjk USE flag if you don't know what that means. For more detail, please read the "UAX #11: East Asian Width".

https://www.unicode.org/reports/tr11/
Comment 3 Alessandro Barbieri 2021-04-21 00:31:53 UTC
This can be added in the julia ebuild
dev-libs/libutf8proc[-cjk]:0=
Comment 4 Jeffrey Lin 2021-04-21 01:41:16 UTC
Upstream discussion for context: https://github.com/JuliaStrings/utf8proc/pull/83

I've skimmed UAX #11 and the discussion above.
Akinori, when might someone want ambiguous characters set to wide? Is there a specific software that requires it? I couldn't find any out of the rdeps for libutf8proc. Should other rdeps also specify [-cjk]?
Comment 5 Larry the Git Cow gentoo-dev 2021-09-25 02:58:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d7d331f387dfcf804dc7d7915d57ec582af2312

commit 4d7d331f387dfcf804dc7d7915d57ec582af2312
Author:     Alessandro Barbieri <lssndrbarbieri@gmail.com>
AuthorDate: 2021-04-21 00:40:14 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-09-25 02:58:32 +0000

    dev-lang/julia: julia doesn't work if cjk is in utf8proc
    
    Closes: https://bugs.gentoo.org/782919
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/20479
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/julia/julia-1.6.0-r1.ebuild | 177 +++++++++++++++++++++++++++++++++++
 1 file changed, 177 insertions(+)