https://bugs.kde.org/show_bug.cgi?id=444579

            Bug ID: 444579
           Summary: Exception when running fetchpo.rb script from cmake
           Product: kdesdk-scripts
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: cmake
          Assignee: neund...@kde.org
          Reporter: ash...@linuxcomp.ru
  Target Milestone: ---

Trying to configure an application with KDE_L10N_SYNC_TRANSLATIONS option. The
underlying scripts fails, and translations are not downloaded.


STEPS TO REPRODUCE
1. git clone https://invent.kde.org/pim/zanshin.git
2. mkdir build
3. cd build
4. LC_ALL=C cmake -B . -S ../zanshin -DBUILD_TESTING=OFF
-DKDE_L10N_SYNC_TRANSLATIONS=ON
--trace-source=/usr/share/ECM/kde-modules/KDECMakeSettings.cmake --trace-expand 

OBSERVED RESULT
There is an error in downloading translations. The relevant part of output:

```
Cloning into 'releaseme'...
/usr/share/ECM/kde-modules/KDECMakeSettings.cmake(376): 
execute_process(COMMAND;ruby;/home/andrew/Development/Lab/build/releaseme/fetchpo.rb;--origin;trunk;--project;pim/zanshin;--output-dir;/home/andrew/Development/Lab/build/po;--output-poqm-dir;/home/andrew/Development/Lab/build/poqm;/home/andrew/Development/Lab/zanshin
)
INFO -- ReleaseMe::L10n: Downloading translations for
/home/andrew/Development/Lab/zanshin
#<Thread:0x000055f78c23c268
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:109
run> terminated with exception (report_on_exception is true):
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n/asset.rb:42:in
`gsub!': invalid byte sequence in US-ASCII (ArgumentError)
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n/asset.rb:42:in
`strip_comments!'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n/asset.rb:16:in
`strip!'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n.rb:78:in `block
(2 levels) in download'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n.rb:76:in `each'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n.rb:76:in `block
in download'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:128:in
`block (2 levels) in each_language_with_tmpdir'
        from /usr/lib/ruby/3.0.0/tmpdir.rb:96:in `mktmpdir'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/tmpdir.rb:22:in
`mktmpdir'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:128:in
`block in each_language_with_tmpdir'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:111:in
`block (2 levels) in blocking_thread_pool'
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n/asset.rb:42:in
`gsub!': invalid byte sequence in US-ASCII (ArgumentError)
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n/asset.rb:42:in
`strip_comments!'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n/asset.rb:16:in
`strip!'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n.rb:78:in `block
(2 levels) in download'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n.rb:76:in `each'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/l10n.rb:76:in `block
in download'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:128:in
`block (2 levels) in each_language_with_tmpdir'
        from /usr/lib/ruby/3.0.0/tmpdir.rb:96:in `mktmpdir'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/tmpdir.rb:22:in
`mktmpdir'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:128:in
`block in each_language_with_tmpdir'
        from
/home/andrew/Development/Lab/build/releaseme/lib/releaseme/translationunit.rb:111:in
`block (2 levels) in blocking_thread_pool'
-- Found Boost: /usr/lib64/cmake/Boost-1.76.0/BoostConfig.cmake (found version
"1.76.0")
```

EXPECTED RESULT
There should be no any errors. There should be only these info lines:

```
INFO -- ReleaseMe::L10n: Downloading translations for
/home/andrew/Development/Lab/pim/zanshin
INFO -- ReleaseMe::L10n: The following languages had translations files but
they amount to no useful strings so they were removed: ja, zh_TW
INFO -- ReleaseMe::L10n: No translations for: as, ast, az, ar, af, bg,
be@latin, bn, be, bn_IN, crh, br, csb, cy, el, en, eo, fa, fy, gd, gu, ha, hi,
he, hr, hne, hsb, hy, id, is, ka, kab, kk, kn, km, ku, lb, lv, mai, ml, mk, ms,
mt, ne, nso, oc, or, pa, ps, ro, rw, se, si, sq, sr@ijekavian, sr,
sr@ijekavianlatin, sr@latin, ta, te, tg, th, tn, tt, uz, uz@cyrillic, vi, wa,
xh, zh_HK
```


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Current releaseme commit: b830efbd (Oct 27, 2021)
Arch packages versions:
 extra-cmake-modules: 5.87.0-1
 ruby: 3.0.2-2

ADDITIONAL INFORMATION
When running that command

```
ruby /home/andrew/Development/Lab/build/releaseme/fetchpo.rb --origin trunk
--project pim/zanshin --output-dir /home/andrew/Development/Lab/build/po
--output-poqm-dir /home/andrew/Development/Lab/build/poqm
/home/andrew/Development/Lab/zanshin
```

directly in konsole, it works normally.

I suspect that it may be related with ja, zh_TW languages. Because their number
is two, and that error "invalid byte sequence in US-ASCII (ArgumentError)" was
logged two times in cmake output.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to