@phoepsilonix The main issue is that TARGET won't get populated, and I also don't know where cargo/rust home ends up.
I apply the following patch to make it work on my Arch build system.
--- a/PKGBUILD 2025-09-14 21:14:06.037959860 +0200
+++ b/PKGBUILD 2025-09-14 03:58:21.074528414 +0200
@@ -33,7 +33,6 @@
url="https://github.com/fcitx/mozc"
license=('Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND NAIST-2003 AND Unicode-3.0 AND LicenseRef-Okinawa-Dictionary')
makedepends=('qt6-base' 'fcitx5' 'fcitx5-qt' 'bazel' 'git' 'python' 'mold' 'pkg-config' 'libibus' 'rustup')
-options=(!lto)
source=("git+$url.git#commit=${_mozc_commit}"
"bcr::git+https://github.com/bazelbuild/bazel-central-registry.git#commit=${_bcr_commit}"
"git+https://github.com/abseil/abseil-cpp.git#commit=${_abseil_cpp_commit}"
@@ -84,7 +83,20 @@
printf "%s.%s.%s.%s" "$MAJOR" "$MINOR" "$BUILD_OSS" "$((REVISION+2))"
}
+# Use debug
+export CARGO_PROFILE_RELEASE_DEBUG=2 CARGO_PROFILE_RELEASE_STRIP=false
+
+# Use LTO
+export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
+
+# Set default rustup toolchain
+export RUSTUP_TOOLCHAIN=stable
+
prepare() {
+ # Set rust/cargo home to the build source dir
+ export CARGO_HOME="$srcdir/build/cargo-home"
+ export RUSTUP_HOME="$srcdir/build/rustup-home"
+
cd "$srcdir/mozc" || exit
git submodule init
@@ -109,13 +121,12 @@
# disable warning of ANDROID_NDK_HOME.
sed -e '/register_toolchains("@androidndk\/\/:all")/d' -i MODULE.bazel
- rustup update stable
cd "${srcdir}/dict-to-mozc/" || exit
#sed -e "s|channel *=.*|channel = \"stable\"|" -i rust-toolchain.toml
#sed -e "/components.*/d" -i rust-toolchain.toml
# すだちを優先
msg '1. Build the rust program(dict-to-mozc), it may take some time...'
- rustup target list --installed | grep $(rustc -vV | sed -e 's|host: ||' -e 's|-gnu||p' -n) | grep -v musl && TARGET=$(rustup target list --installed | grep $(rustc -vV | sed -e 's|host: ||' -e 's|-gnu||p' -n)|grep -v musl|head -n1) || TARGET=$(rustup target list --installed | grep $(rustc -vV | sed -e 's|host: ||' -e 's|-gnu||p' -n)|grep musl|head -n1)
+ TARGET=$(rustc -vV | sed -n 's/host: //p')
unset RUSTC
#CC_=$CC
#unset CC
@@ -152,6 +163,10 @@
}
build() {
+ # Set rust/cargo home to the build source dir
+ export CARGO_HOME="$srcdir/build/cargo-home"
+ export RUSTUP_HOME="$srcdir/build/rustup-home"
+
cd "$srcdir/mozc/src" || exit
# Fix compatibility with google-glog 0.3.3 (symbol conflict)
@@ -225,7 +240,6 @@
install -D -m 644 "$srcdir/LICENSE-SudachiDict" "$pkgdir/usr/share/licenses/$pkgname/data/dictionary_oss/"
install -D -m 644 "$srcdir/LICENSE-MeCab-unidic-Neologd" "$pkgdir/usr/share/licenses/$pkgname/data/dictionary_oss/"
install -D -m 644 "$srcdir/LICENSE-MeCab-ipadic-Neologd" "$pkgdir/usr/share/licenses/$pkgname/data/dictionary_oss/"
-
}
package_fcitx5-mozc-with-jp-dict() {
@@ -288,4 +302,3 @@
install -Dm644 unix/emacs/mozc.el "$pkgdir/usr/share/emacs/site-lisp/emacs-mozc/mozc.el"
}
-
Pinned Comments
phoepsilonix commented on 2024-08-26 00:02 (UTC) (edited on 2025-09-13 04:30 (UTC) by phoepsilonix)
If you're encountering errors during the build process, try deleting your Bazel cache (located at ~/.cache/bazel by default).
or
The development of Fcitx has transitioned to Fcitx5, and Fcitx-Mozc is no longer maintained. Please try the following command.
I use the following site for build verification and build automation.
If you encounter any issues, please also check here. It may be helpful.
If you are looking for pre-built package files, please check the following GitHub site.
https://github.com/phoepsilonix/mozc-arch/releases