@npreining Alright then, I'll include a fix for your use case in the next update.
Search Criteria
Package Details: mozc-ut 2.31.5712.102.20250117-1
Package Actions
Git Clone URL: | https://aur.archlinux.org/mozc-ut.git (read-only, click to copy) |
---|---|
Package Base: | mozc-ut |
Description: | The Open Source edition of Google Japanese Input bundled with the UT dictionary |
Upstream URL: | https://github.com/google/mozc |
Licenses: | Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND CC-BY-SA-3.0 AND CC-BY-SA-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND MIT AND NAIST-2003 AND Unicode-3.0 AND LicenseRef-Okinawa-Dictionary |
Conflicts: | mozc |
Provides: | mozc |
Submitter: | naoina |
Maintainer: | Nocifer |
Last Packager: | Nocifer |
Votes: | 26 |
Popularity: | 0.30 |
First Submitted: | 2020-11-04 02:00 (UTC) |
Last Updated: | 2025-01-17 11:43 (UTC) |
Dependencies (8)
- qt6-base (qt6-base-gitAUR, qt6-base-headlessAUR)
- bazel (bazel-gitAUR, bazel3-binAUR, bazelisk-gitAUR, bazelisk-binAUR, bazelisk) (make)
- git (git-gitAUR, git-glAUR) (make)
- python (python37AUR, python311AUR, python310AUR) (make)
- qt6-base (qt6-base-gitAUR, qt6-base-headlessAUR) (make)
- emacs-mozcAUR (emacs-mozc-with-jp-dictAUR) (optional) – Emacs integration
- fcitx5-mozc-utAUR (optional) – Fcitx5 integration
- ibus-mozcAUR (ibus-mozc-with-jp-dictAUR) (optional) – IBus integration
Required by (4)
- emacs-mozc (requires mozc)
- fcitx-mozc-ut (requires mozc)
- ibus-mozc (requires mozc)
- uim-mozc (requires mozc)
Sources (18)
- git+https://github.com/abseil/abseil-cpp.git#commit=4447c7562e3bc702ade25105912dce503f0c4010
- git+https://github.com/chromium/gyp.git#commit=9ecf45e37677743503342ee4c6a76eaee80e4a7f
- git+https://github.com/google/breakpad.git#commit=216cea7bca53fa441a3ee0d0f5fd339a3a894224
- git+https://github.com/google/googletest.git#commit=b514bdc898e2951020cbdca1304b75f5950d1f59
- git+https://github.com/google/mozc.git#commit=58ebfadae04bc46c46e70edc9662347a29d8b7bc
- git+https://github.com/hiroyuki-komatsu/japanese-usage-dictionary.git#commit=e5b3425575734c323e1d947009dd74709437b684
- git+https://github.com/microsoft/wil.git#commit=fc5dbf55989fe20351c71d038a8d12de4b397a6d
- git+https://github.com/protocolbuffers/protobuf.git#commit=7cc670c1809e704ebeba90fb430d50e009f36727
- git+https://github.com/utuhiro78/merge-ut-dictionaries.git#commit=c0a210388ce78ee7ebfa918810d8224e717a693e
- git+https://github.com/utuhiro78/mozcdic-ut-alt-cannadic.git#commit=bf26bcbb1846f2e9cf35cbfcafcc91c015a1fb22
- git+https://github.com/utuhiro78/mozcdic-ut-edict2.git#commit=520fbc99080bd2b3111440c23ca0e2edaa4c76c5
- git+https://github.com/utuhiro78/mozcdic-ut-jawiki.git#commit=342b9b00c1cc58c9c124b9d7551fdac9a71ee56b
- git+https://github.com/utuhiro78/mozcdic-ut-neologd.git#commit=e33ac4ce808fa4253c6c97bf5178e229a4bfb50f
- git+https://github.com/utuhiro78/mozcdic-ut-personal-names.git#commit=5221f96d59b797e915845a4a51b2e8a8543b47e1
- git+https://github.com/utuhiro78/mozcdic-ut-place-names.git#commit=9789d69e28b7ee7176c9ea0a5826317cfdac75a5
- git+https://github.com/utuhiro78/mozcdic-ut-skk-jisyo.git#commit=c52cdb15e0a014c96050ce1bd02932f50706a3f0
- git+https://github.com/utuhiro78/mozcdic-ut-sudachidict.git#commit=3eb0a18fe59f9d60a558585f3f9734c66665cf9b
- https://dumps.wikimedia.org/jawiki/20250101/jawiki-20250101-pages-articles-multistream-index.txt.bz2
Nocifer commented on 2022-07-27 07:59 (UTC)
npreining commented on 2022-07-26 10:57 (UTC)
Thanks @Nocifer, yes I have ANDROID_NDK_HOME
set due to having android-ndk
installed which ships /etc/profile.d/android-ndk.sh
.
Unsetting the env vars before trying to update the build has worked. Thanks a lot for the pointer, much appreciated!
Nocifer commented on 2022-07-25 08:55 (UTC)
@npreining Do you by any chance do any Android development work or some such? As far as I understand the hacky solution introduced by Mozc's devs to solve this Bazel error (hacky because it can only be really fixed when Bazel addresses the issue on its end) you should no longer be getting an error about the Android NDK unless the ANDROID_NDK_HOME
environment variable is set in your PATH, in which case the setup process will try to pull an Android NDK from the path provided by ANDROID_NDK_HOME
(/opt/android-ndk/platforms
in your case).
If you do have this env var set and you need it that way, then you should just comment out line 18 in WORKSPACE.bazel
(and maybe line 16 as well) and check if Mozc will build. If so, then I'll reintroduce the NDK fix I removed with this update and report to upstream about it.
npreining commented on 2022-07-25 01:26 (UTC)
Tried to compile (via yay) but got error. bazel cache is cleaned before the build, as well as all clean build enabled. Error is about finding android:
==> Making package: mozc-ut 2.28.4800.102.20220723-1 (Mon Jul 25 10:22:22 2022)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
ERROR: /home/norbert/.cache/yay/mozc-ut/src/mozc-ut-git/src/WORKSPACE.bazel:19:18: fetching android_ndk_repository rule //external:androidndk: java.io.IOException: Expected directory at /opt/android-ndk/platforms but it is not a directory or it does not exist. Unable to read the Android NDK at /opt/android-ndk, the path may be invalid. Is the path in android_ndk_repository() or ANDROID_NDK_HOME set correctly? If the path is correct, the contents in the Android NDK directory may have been modified.
ERROR: Analysis of target '//gui/tool:mozc_tool' failed; build aborted: Expected directory at /opt/android-ndk/platforms but it is not a directory or it does not exist. Unable to read the Android NDK at /opt/android-ndk, the path may be invalid. Is the path in android_ndk_repository() or ANDROID_NDK_HOME set correctly? If the path is correct, the contents in the Android NDK directory may have been modified.
INFO: Elapsed time: 11.246s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (6 packages loaded, 6 targets configured)
currently loading: @bazel_tools//tools/jdk
Fetching @local_jdk; fetching
Fetching @local_config_cc_toolchains; Restarting.
==> ERROR: A failure occurred in build().
Thanks for your work on mozc!
Thatsinsanedude commented on 2022-07-02 13:27 (UTC) (edited on 2022-07-02 13:45 (UTC) by Thatsinsanedude)
Cleared cache and i got the following error at the end of the compiliation :
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/string:45,
from ./data_manager/data_manager.h:35,
from data_manager/data_manager.cc:30:
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
ERROR: /home/admin/.cache/yay/mozc-ut/src/mozc-ut-git/src/data_manager/oss/BUILD.bazel:45:13: Executing genrule //data_manager/oss:mozc_dataset_for_oss@dictionary failed: (Aborted): bash failed: error executing command /bin/bash -c ... (remaining 1 argument skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Edit : Caused by global use of Hardened_malloc Allocator in non normal variant.
Nocifer commented on 2022-05-29 21:54 (UTC) (edited on 2023-08-22 09:33 (UTC) by Nocifer)
If you're getting compilation errors, please delete your Bazel cache (~/.cache/bazel
by default).
Nocifer commented on 2022-05-11 18:01 (UTC)
@LetMeByte Yeah, ccache et al still remain largely incompatible with Bazel. I think the obvious and even easier solution to this would be to add BUILDENV=(!distcc !ccache) in the PKGBUILD so as to explicitly disable both of them, even if the user has manually enabled them in makepkg.conf
. Is that what you meant by "setting a compatible toolchain"?
The funny thing is, more than one times in the past I've proposed this solution to other AUR maintainers for them to use in their packages in order to fix this exact same issue, but apparently I failed to ever realize it could also be used to solve the issue in my own package as well :P
Anyway, I'll do it in the next update.
<deleted-account> commented on 2022-05-11 16:50 (UTC)
Building mozc(-ut) with distcc/ccache installed results in various errors.
The problem is caused by distcc/ccache exporting their own versions of GCC and Clang, check with which gcc
or which clang
.
The temporary fix is to disable the corresponding options in /etc/makepkg.conf, or just setting the CC environment variable to the standalone version of GCC or Clang:
export CC=/usr/bin/gcc
or export CC=/usr/bin/clang
UPDATE: @Nocifer: Thank you for the quick response, the solution you suggested is definitely the best way.
asday commented on 2022-03-05 13:48 (UTC)
@Nocifer
Thank you for the highly detailed comment and the untold (but appreciated) hours of work you put in for little old me.
As previously mentioned I am not overburdened with an excess of brain cells, so I won't try to "[delete] the package cache" because I will somehow manage to rm rf --no-preserve-root /
or chmod -x chmod
or something, and I need this laptop for work. Instead, I will continue to daily drive my laptop and report back after a couple of updates.
Of couse, I have no doubt that your newfound expertise has not been misplaced and my issue has been resolved, so once again I'd like to extend my thanks.
Nocifer commented on 2022-02-25 01:34 (UTC) (edited on 2022-02-25 09:36 (UTC) by Nocifer)
After digging around a bit I believe I've found the culprit. Turns out that whenever the PATH is modified, Bazel will unconditionally invalidate its cache, even if the newly assigned PATH value is the same as before. I've changed the PKGBUILD to use a Java-specific variable that allows Bazel to find and use Java 11 without touching the PATH, so now the cache works as intended.
The bad news is that the first time you try to rebuild the package using the new PKGBUILD, from Bazel's perspective the PATH will once again be modified (from the previously used "/usr/lib/jvm/java-11-openjdk/bin/:$PATH" to the default PATH) so the cache will once again become invalidated; but on the next and subsequent rebuilds it will not, and from then on only the modified files will need to be recompiled on package updates.
The good news is that with this next update I was already planning to replace mozc-ut-common
with mozc-ut
, which means that Bazel will need to do a full recompile anyway, regardless of the cache issues, because mozc-ut
is a completely new package. So one way or another, you guys won't be spared the full recompile. Oh, sorry, this was supposed to be the good news :)
@asday, thanks for taking the time to mention this issue, it ended up becoming the catalyst for an arguably very good improvement (not to mention that I've had the opportunity to learn some interesting things about how Bazel works internally). Also, if you wish to test and verify that the cache now works properly, then as soon as you finish with the update you can force a rebuild by deleting the package cache and then reinstalling Mozc - hopefully, this time the compilation step should only take a handful of seconds at most (because nothing will be recompiled).
EDIT: Unfortunately, TIL that the replaces
field in the PKGBUILD apparently does not work for AUR packages, and the only way to automatically replace an installed AUR package is to merge it into its replacement. But I'd already pushed the new updates before I learned that, so it's going to be two full recompiles in the space of a few days (one for mozc-ut-common
now, and one for mozc-ut
when the merge goes ahead). What fun.
Pinned Comments
Nocifer commented on 2022-05-29 21:54 (UTC) (edited on 2023-08-22 09:33 (UTC) by Nocifer)
If you're getting compilation errors, please delete your Bazel cache (
~/.cache/bazel
by default).