88 Commits

Author SHA1 Message Date
f215eaf71a Extract out Android build instructions (#1191)
This is the first part towards removing the dependency on Docker from
our build instructions for Linux desktop and Android (#1181).

This commit makes it clear that you can build 'libmozc.so' on both Linux
and macOS by the same Bazel command with actually demonstrating it in

  .github/workflows/android.yaml

that 'libmozc.so' can be built on both Linux and macOS GitHub Actions
runners.

With above our 'Dockerfile' can stop setting up Android NDK since
'build_mozc_in_docker.md' does not mention Android any more.

This commit is only about the build instructions of 'libmozc.so' for
Android. There must be no difference in the final artifacts.

PiperOrigin-RevId: 729468755
2025-02-21 21:53:44 +09:00
662b9b5c4a Remove --build_tests_only from the bazel test command in CI.
* this will check the build rules more strictly.

#codehealth

PiperOrigin-RevId: 719145071
2025-01-24 05:52:40 +00:00
8d704f0f82 Use bazelisk instead of bazel.
* .bazeliskrc is used instead of USE_BAZEL_VERSION.
* Remove the .bazelversion file.

#codehealth

PiperOrigin-RevId: 716213424
2025-01-16 14:35:53 +00:00
6dadef1c3d Switch to Bazel 8.0.0 (#1154)
With this commit we fully switch to Bazel 8.0.0 as the officially
supported build environment for Mozc.

Closes #1118.

PiperOrigin-RevId: 709793147
2024-12-27 00:18:51 +09:00
2016df940b Clarify Bazel 8.0 is not yet supported (#1118) (#1123)
As Mozc is not compatible with Bazel 8.0 yet, let's

 * pin Bazel version to Bazel 7.4.1 in GitHub Actions.
 * clarify that Bazel 8.0 is not supported in the build instructions.

PiperOrigin-RevId: 698388242
2024-11-21 01:20:49 +09:00
df9931dd4a Run buildifier in a GitHub Actions workflow (#1091)
With this commit we can continuously check is there is any lint error in
BUILD.bazel and *.bzl files.

Closes #1089.

PiperOrigin-RevId: 689642057
2024-10-26 00:52:30 +09:00
f231b396a1 Fix typo: biuld → build.
#codehalth

PiperOrigin-RevId: 689308115
2024-10-24 10:09:30 +00:00
ffc460e0f3 Support building installer for Windows with Bazel
As a milestone of our on-going effort to support Bazel to build Mozc
for Windows (#948), we can finally start building the installer of Mozc
for Windows with Bazel with this commit.

While there remain several things to be followed up (e.g. compiler
options and linker options for production builds), it should now just
work in an end-to-end manner.

PiperOrigin-RevId: 680400073
2024-09-30 04:00:07 +00:00
1a653db094 Switch to Ubuntu 24.04 for build environment
With this commit we start using Ubuntu 24.04 for our reference build
environment for Linux and Android builds.

Fix #924.

PiperOrigin-RevId: 679428940
2024-09-27 04:54:11 +00:00
efc4337c01 Update issue templates from MarkDown to YAML.
* It supports structured required forms.

https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository

#codehealth

PiperOrigin-RevId: 678019529
2024-09-24 01:29:54 +00:00
86d54ef9a5 Update the template for typing issues.
Added a note about the Google form for reporting typing issues.

https://github.com/google/mozc/issues/1056

#typingquality

PiperOrigin-RevId: 670078434
2024-09-02 05:27:07 +00:00
9fd8739567 Add bazel build config for release build (--config=release_build)
This flag enables compiler optimizations and disables logging.

PiperOrigin-RevId: 667502436
2024-08-26 08:52:23 +00:00
08d6c399ad Add a note to the typing issue template.
```
Typing issues will be closed when the entries are added to test cases and
evaluations.

https://github.com/google/mozc/blob/master/src/data/test/quality_regression_test/oss.tsv
https://github.com/google/mozc/blob/master/src/data/dictionary_oss/evaluation.tsv
```

PiperOrigin-RevId: 648105800
2024-06-30 10:21:23 +00:00
4e4645c190 Also build mozc_tool with Bazel on GitHub Actions
We can now build mozc_tool.exe with Bazel on Windows (#948). Let's start
continuously building it as well as mozc_server.exe on GitHub Actions.

#codehealth

PiperOrigin-RevId: 646729912
2024-06-26 05:33:30 +00:00
ff649883e8 Temporarily revert //win32/installer:artifacts
This is a follow up commit to my previous commits, which added

  //win32/installer:artifacts

target to build Mozc with Bazel on Windows (#948).

It seems that it has caused some build errors in other platforms.
Let's revert them back until we figure out how to solve the issue.

#codehealth

PiperOrigin-RevId: 646670786
2024-06-26 00:59:02 +00:00
421ecca1f7 Enable minimum CI for Windows bazel build
As a preparation to support Bazel for Windows build (#948), we start
enabling an experimental CI rule for Windows bazel build.

#codehealth

PiperOrigin-RevId: 646330047
2024-06-25 04:59:08 +00:00
07c5f89f71 Use -c opt for build and -c dbg for test.
#codehealth

PiperOrigin-RevId: 632041237
2024-05-09 06:09:45 +00:00
6c72bf5cec Update comment URLs in GitHub Actions rules
URLs to GitHub Actions runner images are migrated from

  https://github.com/actions/virtual-environments

to

  https://github.com/actions/runner-images

#codehealth

PiperOrigin-RevId: 630801581
2024-05-05 11:05:39 +00:00
1d82d685ae Stop requiring vcvarsall.bat before build_mozc.py
With this commit 'vcvarsall.bat' (and its variant) are no longer
requires to be executed before running 'build_mozc.py', like
'build_qt.py' has never required 'vcvarsall.bat' (and its variant) [1].

'--vcvarsall_path' option, which is available in 'build_qt.py' [2],
is also available to explicitly specify a custom path of vcvarsall.bat
as follows.

  build_mozc.py --vcvarsall_path=C:\VS\VC\Auxiliary\Build\vcvarsall.bat

Overall this commit should make our build instructions simpler and
easier to keep maintaining.

Closes #923.

#codehealth

 [1]: baf418832c
 [2]: c777896808

PiperOrigin-RevId: 629293616
2024-04-30 05:22:55 +00:00
e8d25a2bee Fix #910: Use python venv for macOS build
With this commit macOS build starts using Python virtual environment so
that our build steps can comply with PEP 668 [1].

This is only about the build procedure. There must be no behavior change
in the build artifacts.

#codehealth

 [1]: https://peps.python.org/pep-0668/

PiperOrigin-RevId: 621123606
2024-04-02 10:59:27 +00:00
98255ddf30 Use the default Python in macos-14 image
This is a follow up commit to my previous commit [1], which upgraded
GitHub Actions runner for macOS builds to 'macos-14' (#868).

While we still support Python 3.9 to build Mozc on macOS environment,
currently we cannot use 'setup-python' to set up Python 3.9 in
'macos-14' runner [2]. Also we don't use 'setup-python' in other
platforms such as Windows build.

For simplicity, let's just use the default python in the runner [3],
which is Python 3.11 as of writing. Then we should no longer see
errors from 'setup-python' in the build summary [4].

#codehealth

 [1]: 4af1a445bb
 [2]: https://github.com/actions/setup-python/issues/808
 [3]: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-14-Readme.md
 [4]: https://github.com/actions/setup-python/issues/809

PiperOrigin-RevId: 604223079
2024-02-05 07:50:53 +00:00
4af1a445bb Switch to macos-14 GitHub Actions runner (#868)
With this commit macOS GitHub Actions start running on 'macos-14'
runner, which now runs on Apple silicon.

One observable change is that 'Mozc_arm64.pkg' from 'build_arm64' job
is a bit smaller because we no longer need to build Qt6 as universal
binaries.

Python version is also updated as Python 3.9 is not available for
'macos-14' runner right now.

Closes #868.

PiperOrigin-RevId: 603665115
2024-02-02 13:57:39 +00:00
70d1d5207e Remove the file path limitation for PRs.
PiperOrigin-RevId: 601957808
2024-01-27 07:05:31 +00:00
034b61000d Switch to actions/upload-artifact@v4
This commit updates 'actions/upload-artifact' used in our GitHub Actions
rules from

  actions/upload-artifact@v3

to

  actions/upload-artifact@v4.

According to the release note [1], there are several breaking changes
but none of them looks to be hitting us.

 [1]: https://github.com/actions/upload-artifact/releases/tag/v4.0.0

#codehealth

PiperOrigin-RevId: 600269936
2024-01-21 19:02:39 +00:00
afd37bf248 Switch to actions/cache@v4
This commit updates 'actions/cache' used in our GitHub Actions rules
from

  actions/cache@v3

to

  actions/cache@v4.

According to the release note [1], there seems to be no breaking change.

 [1]: https://github.com/actions/cache/releases/tag/v4.0.0

#codehealth

PiperOrigin-RevId: 599384139
2024-01-18 05:34:34 +00:00
87b0d4e2b6 Add a template for Discussions.
PiperOrigin-RevId: 589403431
2023-12-09 15:05:46 +00:00
b0a604f110 Use 'android_binary' rule to build 'libmozc.so'
This is a follow up to my previous commit [1], which aimed to build
'libmozc.so' for relevant architectures.

Although in the above commit I believe I followed exactly the same step
explained in the Bazel document [2], it seems that artifact files are
not ready to run on the actual Android devices.  Perhaps it might be
because the above approach is for those who want to build native
libraries for Android without building an APK, which is somewhat
not-a-major use case and may not be well maintained.  This is why I
ended up building a temporary fat APK only to extract native libraries
from it.

Basically what this commit does are:

 1. Build a fat APK, which depends on 'mozcjni' cc_library target.
 2. Extract native libraries from the APK and zip it as native_libs.zip

The temporary APK used here is completely empty and used only for
building purpose.

The 'package' meta target is updated to point to the native library
build target, which is 'android/jni:native_libs'.

 bazel build --config oss_android package
 ls bazel-bin/android/jni/native_libs.zip

'.bazelrc' is also updated because Android build starts using the
following options instead.

 * --android_crosstool_top=@androidndk//:toolchain
 * --fat_apk_cpu=armeabi-v7a,arm64-v8a,x86,x86_64

Dockerfile is also updated because now Android build requires not only
Android NDK but also Android SDK.

This commit only affects Android build target.  Other build target
should continue to success without installing Android SDK/NDK.

Closes #840.

 [1]: 5a6e457b72
 [2]: https://bazel.build/docs/android-ndk#cclibrary-android
 [3]: https://bazel.build/docs/android-ndk

PiperOrigin-RevId: 578420951
2023-11-01 07:13:42 +00:00
ee8c0aa1ae Increase timeout of 'build_universal_binary' to 120-min
This is a follow up to e946483fa5 for #801.

Looks like 'build_universal_binary' can take more than 90 mins occasionally.
Let's increase it to 120 mins for now.

PiperOrigin-RevId: 564887983
2023-09-13 01:03:07 +00:00
aba090da42 Assume GCC and libstdc++ in Linux CI
In most Linux distributions, system-provided Qt6 libraries are supposed to be
built with libstdc++ rather than libc++.  This means that mozc_tool also need to
link to libstdc++ to avoid ABI mismatch unless we build Qt6 from the source code
like we do so in macOS and Windows builds.  For now, let's assume GCC and
libstdc++ in Linux CI.

Closes #803.

#codehealth

PiperOrigin-RevId: 563670356
2023-09-08 07:39:49 +00:00
7e31c946da Switch to 'actions/checkout@v4' in GitHub Actions
This commit updates our GitHub Actions rules to use 'actions/checkout@v4' to
check out source code.

According to the release note [1], there seems to be no breaking change.

 [1]: https://github.com/actions/checkout/releases/tag/v4.0.0

#codehealth

PiperOrigin-RevId: 563656358
2023-09-08 06:25:30 +00:00
e946483fa5 Build intel64, arm64, and Universal Binary in GitHub Actions
With this commit, GitHub Actions for macOS starts building and uploading the
installer for the following 3 CPU architectures.

 - x86_64
 - arm64
 - universal (x86_64 and arm64)

One caveat is that so far we have not figured out how to build Qt6 for arm64 on
Intel mac.  As a result, Qt6 binaries in the arm64 installer are built as
universal binaries rather than a pure arm64 binaries.  This can be easily
fixed once GitHub start offering GitHub-hosted arm64 macOS runners.

In the build artifacts, it is clear that Universal Binary basically doubles the
installer size.

Closes #801.

PiperOrigin-RevId: 562468629
2023-09-04 06:43:04 +00:00
5a6e457b72 #730: Also upload 'libmozcjni.so' as artifacts
This is a follow up to my commit [1], which enabled GitHub Actions
to upload build artifacts for Windows, macOS, and Linux but not for
Android.  This commit is to also support Android.

One interesting requirement for Android is that developers usually need
to build *.so for the following 4 architectures.

 - armeabi-v7a
 - arm64-v8a
 - x86
 - x86_64

With this commit, our GitHub Actions rule actually starts building
'libmozcjni.so' for the above 4 architectures, then archives them into
a single zip file and upload it as the final artifact.

 [1]: bb50663d5e

PiperOrigin-RevId: 561867498
2023-09-01 06:33:38 +00:00
ecf8232f79 Stop building Windows binaries with Qt5 in GHA
This is a cleanup after #775.

As Qt6 migration has been successfully completed, let's simplify our
Windows CI by removing build configurations with Qt5.

By doing this, we can start further cleaning up other scripts such as
'update_deps.py' and 'build_qt.py'.

#codehealth

PiperOrigin-RevId: 561083677
2023-08-29 18:07:42 +00:00
614c109e4b #775: Switch to Qt6 in mac Bazel build
With this commit, macOS Bazel build starts linking to Qt6.

Here are things needed to use Qt6:

 * Qt6 uses 'libexec' rather than 'bin' to host tools like 'uic'.
 * Qt6 uses 'Frameworks/QtCore.framework/Versions/A' rather than
   'Frameworks/QtCore.framework/Versions/5'.

PiperOrigin-RevId: 558715583
2023-08-21 08:47:13 +00:00
7b0fc713f0 #775: Switch to Qt6 in Linux
With this commit, Linux build starts linking to Qt6.

Here are things needed to use Qt6 in Ubuntu 22.04.

 * Qt6 uses 'libexec' rather than 'bin' to host tools like 'uic'.
 * Qt6 requires 'libgl-dev' in Ubuntu 22.04.
 * Ubuntu 22.04 uses Qt 6.2.4, where you cannot use pkg-config for Qt6
   due to QTBUG-86080 [1]. This commit works around it by injecting
   files like Qt6Core.pc files with 'PKG_CONFIG_PATH' environment
   variable.

 [1]: https://bugreports.qt.io/browse/QTBUG-86080

PiperOrigin-RevId: 558016590
2023-08-18 03:52:17 +00:00
0583d16594 Add a CI to only build Qt6 for mac
With this commit we can continuously verifies that build_qt.py works
fine with Qt6 in macOS (#775).

PiperOrigin-RevId: 556069080
2023-08-11 20:27:25 +00:00
fa57fd05f5 Update the format of pull_request_template.md
* Use `##` instead of `**`.

#codehealth

PiperOrigin-RevId: 553670487
2023-08-04 03:34:02 +00:00
4254a2d671 #775: Use Qt6 by default for Windows
With this commit, Windows build starts using Qt6 by default.

You can still use Qt5 by explicitly specifying Qt5 source archive with
'--qt_archive_path' option in 'build_qt.py'.  You can also find Qt5
build status in GitHub Actions.

PiperOrigin-RevId: 553162054
2023-08-02 16:03:45 +00:00
eacc8f9161 Fully switch from Ubuntu 20.04 to Ubuntu 22.04
This follows up to bb52df2437.

With this commit we use Ubuntu 22.04 as the reference build environment
for Mozc for Linux and Android.

This commit also updates NDK version from 'r21b' to 'r25c' as otherwise
Android build fails.

Also the default Clang version in Ubuntu 22.04 is '14' thus we do not
need to explicitly set them in 'CC' and 'CXX'.

This is also a preparation of Qt6 migration (#775), as Ubuntu 20.04 does
not have Qt6 in their official repository.

Closes #763.

PiperOrigin-RevId: 552728127
2023-08-01 08:35:51 +00:00
4ffe37f88e #781: Delete src/renderer/unix
This commits delete src/renderer/unix, which is has also been known as
"Mozc GTK renderer". By removing this we can make it clear that GTK+2
(e.g. `libgtk2.0-dev`) is not necessary to build Mozc in Linux.

#codehealth

Closes #781.

PiperOrigin-RevId: 551780822
2023-07-28 08:48:26 +00:00
28d6312630 Download ninja.exe with update_deps.py
This follows up to my previous commit [1], which aimed to update the
ninja binary to 1.11.0 that has a compatibility fix [2] by using
Chocolatey.

It seems that Chocolatey is not stable.  Let's use update_deps.py to
download the binary from GitHub.

 [1]: c34fd2962e
 [2]: 66b05496ff

PiperOrigin-RevId: 551728663
2023-07-28 04:26:19 +00:00
88fb0c68d7 Fix #779: Remove src/unix/ibus/selection_monitor.cc
selection_monitor.cc has been a fallback for features built on top of
surrounding text APIs to continue working even when
IbusEngineWrapper::GetSurroundingText() doesn't return correct
anchor_pos.

The way how selection_monitor.cc worked around was to keep monitoring
clipboards via by X11 APIs. However I believe it's time to remove this
workaround. My rationales are:

 * Having a runtime dependency on xcb from ibus_mozc is getting more
   and more questionable, especially when the industry is heading to
   Wayland. There was actually an issue in Ubuntu 21.10 [1] because of
   this dependency.
 * If an IME API doesn't work well, ideally such an issue should be
   addressed in the right component, rather than trying to work around
   it in each IME.

 [1]: https://bugs.launchpad.net/ubuntu/+source/mozc/+bug/1946969

#codehealth

PiperOrigin-RevId: 551164079
2023-07-26 11:22:21 +00:00
2336361146 Use headings in issue templates
Instead of using bold lines, let's use headings for better formatting in
issue templates.

#codehealth

PiperOrigin-RevId: 549885052
2023-07-21 09:11:44 +00:00
07d93350dc Enable C++20 for Windows
With this commit we can start using C++20 features in Windows build.

There must be no user observable behavior change.

Closes #769

PiperOrigin-RevId: 548581637
2023-07-17 05:21:03 +00:00
46e24b83b3 Drop unnecessary permissions from GitHub Actions
By only giving read permission, we can guarantee that running GitHub Actions can never perform unexpected write operations to our repository resources such as modifying git repository and updating issues.

Note that even with this configuration, we can still upload build artifacts and rely on GitHub Actions cache.

PiperOrigin-RevId: 548428394
2023-07-16 04:05:25 +00:00
bb52df2437 Update the Linux GitHub Action to use Ubuntu 22.04 and clang 14
https://github.com/google/mozc/issues/763

PiperOrigin-RevId: 541230155
2023-06-18 15:13:02 +00:00
5e92aa9b27 Stop uploading Mozc32.msi (#752)
As the first step to stopping building `Mozc32.msi`, this CL stops uploading `Mozc32.msi` as an artifact of GitHub Actions.

#codehealth

PiperOrigin-RevId: 537191899
2023-06-02 02:45:41 +00:00
5818a11df5 Fix compilation error in Linux
Seems that GCC 9.4.0 installed in `ubuntu-20.04` image doesn't recognize `decltype(<member variable>)`.

Let's switch to Clang 12 as the host toolchain in GitHub Actions for Linux and Android as a quick workaround.

PiperOrigin-RevId: 536605776
2023-05-31 05:38:17 +00:00
c81712f7e7 Fix warning messages in GitHub Actions for Win
This is a follow up to e8d211e9f1 for #749.

Putting a line starts with `#` in `run` lines ends up with the following (non-critical) warning for `cmd` shell in Windows.  Let's move it outside of `run:` lines to keep the build log cleaner.

```
'#' is not recognized as an internal or external command,
operable program or batch file.
```

There should be no actual behavior change in the build process itself.

PiperOrigin-RevId: 536563466
2023-05-31 01:22:45 +00:00
395ebe3b3c Fix comment typos in {macos,windows}.yaml (#749)
PiperOrigin-RevId: 536283759
2023-05-30 04:25:26 +00:00