41 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
7f686f1ee1 Update Android NDK in Dockerfile to r28 (#1176)
Android NDK r28 is released with 16 KiB page size compatibility option
enabled by default [1].

Let's update our Dockerfile to make it clear that libmozc.so is
compatible with 16 KiB page size.

 [1]: https://github.com/android/ndk/releases/tag/r28

PiperOrigin-RevId: 725115333
2025-02-10 20:28:08 +09:00
e772004b4c Simplify NDK setup in Dockerfile (#1162)
This commit aims to simplify how Android NDK is set up in Dockerfile
without changing any final artifact.

With this commit Android NDK will be directly downloaded then deployed
just by unzipping the archive. As a result we no longer need to install
openjdk-17-jdk package just to run Android SDK setup.

This commit also makes it clear that the build environment for Android
requires Android NDK only. Android SDK and ANDROID_HOME environment
variable are not necessary.

There must be no difference in the final artifact.

PiperOrigin-RevId: 717365459
2025-01-20 14:38:43 +09: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
032535dbce Use bazelisk as a bazel launcher in Dockerfile
bazelisk [1] is a wrapper around bazel that allows you to use different
versions of bazel without having to install them all. This is useful
for testing different versions of bazel or for using a specific version
of bazel that is not available in the default repository.

Let's update Dockerfile to use bazelisk instead of bazel. This will
allow us to avoid a tricky question on which version of bazel should be
installed in the Docker container by checking in '.bazeliskrc' into the
repository.

Note that switching to recent versions of bazel is also necessary due to
our migration to bzlmod (#1002). Probably bazel 7.3 or later is
currently required to build Mozc with bazel.

 [1]: https://github.com/bazelbuild/bazelisk

#codehealth

PiperOrigin-RevId: 680750168
2024-09-30 22:57:08 +00:00
ade798c4a8 Update Android NDK version to 27.1.12297006 in Docker
Android NDK 25.2.9519653 is too old to build recent versions of
abseil-cpp with C++20 enabled.

#codehealth

PiperOrigin-RevId: 680750096
2024-09-30 22:56:56 +00:00
ab98773a96 Fix missing C++ compiler in docker/ubuntu22.04/Dockerfile
Somehow gcc and g++ should have been explicitly installed since my
previous commit [1], which aimed to switch from clang/libc++ to
GCC/libstdc++

 [1]: aba090da42

#codehealth

PiperOrigin-RevId: 680749115
2024-09-30 22:53:49 +00:00
e122f75317 Revisit usage of DEBIAN_FRONTEND=noninteractive.
- Use ARG command in 22.04 to set the variable only during build (https://github.com/moby/moby/issues/4032#issuecomment-192327844).
- Remove the command entirely in 24.04 since newer version of APT is smarter (https://github.com/moby/moby/issues/4032#issuecomment-2008339218).

PiperOrigin-RevId: 633548518
2024-05-14 12:20:14 +00:00
b186b0500d Follow docker best practice to minimize layers.
ref: https://docs.docker.com/develop/develop-images/instructions/#apt-get
PiperOrigin-RevId: 633544567
2024-05-14 12:03:00 +00:00
d569f615fa Add a Dockerfile for Ubuntu 24.04
As the initial step towards #924, this commit introduces a Dockerfile
for Ubuntu 24.04 so that developers can build Mozc binaries for
Ubuntu 24.04 and Android.

#codelealth

PiperOrigin-RevId: 630801826
2024-05-05 11:07:15 +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
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
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
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
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
2030eb4a98 Switch from gcc to clang to use decltype (#758)
Porting 5818a11df5 to Dockerfile.

PiperOrigin-RevId: 539639484
2023-06-12 23:03:35 +09:00
3ab1bec511 Add apt-get update --fix-missing to Dockerfile.
* This fixes the problem of "Undetermined Error [IP: 91.189.88.142 80]".

#codehealth

PiperOrigin-RevId: 483290300
2022-10-24 15:59:08 +09:00
ec41969589 mozc: simplify gyp.patch
NOTE: these changes require updating gyp submodule in mozc github repo.

See https://github.com/dextero/mozc/actions for results of a test CI run.

* Set GYP_MSVS_DISABLE_PATH_NORMALIZATION environment variable in
  build_mozc.py. Removing path normalization that was breaking Windows build
  was a breaking change that didn't get accepted in upstream. Instead, setting
  that environment variable makes gyp skip the normalization.

* Remove instructions to apply gyp.patch from Windows build instructions.

PiperOrigin-RevId: 440133963
2022-04-08 02:00:13 +09:00
85d50840f6 Remove no longer necessary packages from Dockerfile.
PiperOrigin-RevId: 431877733
2022-03-02 18:15:58 +09:00
182fa2327a Use apt-get instead of apt in Dockerfile
Ubuntu Manpage: apt - command-line interface
SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
https://manpages.ubuntu.com/manpages/focal/en/man8/apt.8.html#script%20usage%20and%20differences%20from%20other%20apt%20tools
> The apt(8) commandline is designed as an end-user tool and it may
> change behavior between versions. While it tries not to break backward
> compatibility this is not guaranteed either if a change seems
> beneficial for interactive use.
>
> All features of apt(8) are available in dedicated APT tools like
> apt-get(8) and apt-cache(8) as well.  apt(8) just changes the default
> value of some options (see apt.conf(5) and specifically the Binary
> scope). So you should prefer using these commands (potentially with
> some additional options enabled) in your scripts as they keep backward
> compatibility as much as possible.
2022-03-01 00:16:01 +09:00
1f4fa17372 Update documents and docker files.
* Removed old docker files.
2020-12-29 12:22:34 +09:00
5a4af2feed Update Dockerfiles. 2020-08-29 23:00:46 +09:00
c268b2793c Add docker files for Ubuntu 20.04. 2020-08-23 23:35:18 +09:00
6b878e31fb Amend a typo in the copyright year
This CL am amends a typo in the copyright year in the file header of
docker/fedora23/Dockerfile, which was introduced in my previous
CL [1].

 [1]: f5ddd0e06f
2018-01-01 11:28:57 -08:00
f5ddd0e06f Update the copyright year to 2018
REF_BUG=
REF_CL=180466480
REF_TIME=2018-01-01T00:00:18-08:00
REF_TIME_RAW=1514793618 -0800
2018-01-01 00:00:18 -08:00
e24eb2f03e Update Android NDK from r12b to r16b
This CL also drops MIPS/MIPS64 build configurations from Travis CI,
since NDK r16 deprecated those build targets [1].

 [1]: https://github.com/android-ndk/ndk/wiki/Changelog-r16

BUG=
TEST=compile
2017-12-30 22:38:49 -08:00
1195cf739b Directly download android-support-v13.jar v23.1.1
This closes #406, closes #410, closes #417, closes #414,
and closes #418.

BUG=#406,#410,#417,#418
TEST=complied inside Docker
2017-12-28 11:52:00 -08:00
4b5d7ffd78 Update the copyright year to 2017. 2017-01-01 00:00:00 +09:00
2ab65b962b Bump Pepper SDK version from 45 to 49
Pepper 45 SDK is going to be deprecated.  We have to switch to a newer
version.

No user visible change is intended.

BUG=
TEST=compile
REF_BUG=
REF_CL=
REF_TIME=2016-10-02T23:56:17-07:00
REF_TIME_RAW=1475477777 -0700
2016-10-02 23:56:17 -07:00
d10cf30c4f Update Dockerfile to install Qt5 packages on Linux
This is a follow-up CL to f76c304164,
with which we started using Qt5 by default for Linux desktop build.

BUG=#327
TEST=
REF_BUG=
REF_CL=
REF_TIME=
REF_TIME_RAW=
2016-10-01 17:26:31 -07:00
5ce7fa6214 Switch NDK from r10e to r12b
This CL completely removes --android_compiler option since we now only
support Clang toolchain for Android target binaries.  GCC toolchain
bundled in Android NDK is going to be deprecated shortly [1].

This Cl also adds following build targets on Travis-CI.
 - Android (arm64)
 - Android (x86)
 - Android (x86_64)
 - Android (mips)
 - Android (mips64)

Closes #273.

 [1]: fb83ea8bf7

BUG=#273
TEST=compile
REF_BUG=
REF_CL=131555947,133352265,134314373
REF_TIME=2016-08-28T22:29:30-07:00
REF_TIME_RAW=1472448570 -0700
2016-08-28 22:29:30 -07:00
a7cbf72341 Use Ubuntu 14.04.5 in Docker build
BUG=
TEST=compile
REF_BUG=
REF_CL=
REF_TIME=
REF_TIME_RAW=
2016-08-21 16:08:31 -07:00
3d4e01e667 Use Trusty environment on Travis CI
The 3GB memory limit enforced to Travis CI container-based environment
is too small to build Mozc for Android.  To avoid Out-Of-Memory errors,
this CL lets Travis CI use Ubuntu 14.04 Trusty VM instead.

This CL also updates Ubuntu 14.04 Dockerfile to keep those two build
environments as similar as possible.

BUG=
TEST=
REF_BUG=
REF_CL=
REF_TIME=2016-03-03T02:14:00-08:00
REF_TIME_RAW=1457000040 -0800
2016-03-03 02:14:00 -08:00
cbccaa662d Developers should check out only master branch.
In Mozc repository, it's only master branch where we basically do not
change existing commit histories and commit hashes unless we
exceptionally have to do that.  Since any other branches are basically
used for development purpose, it is not recommended to check them out
unless needed.  Hence this CL updates documents and Dockerfile for
developers to not check them out accidentally.
2016-01-10 14:06:42 -08:00
4a370c6ea6 Update copyright year in source headers to 2016.
This CL updates the copyright year in source header comments to 2016.
No behavior change is intended.

BUG=
TEST=unittest
REF_BUG=
REF_CL=
2016-01-01 21:32:35 -08:00
4fb5f2493d Build Mozc on Fedora 23 in Docker.
Since Fedora 21 will soon enter End Of Life (EOL) status on
December 1st, 2015, this CL updates Dockerfile for Fedora to use
Fedora 23 instead of Fedora 21.

Note that Android build support is intentionally dropped from
this Dockerfile due to the lack of due to the lack of OpenJDK 1.7
support in Fedora 23.

Note also that this Dockerfile is provided just for the reference.
Ensuring that Mozc can be built on Fedora 23 is beyond our goal
at the moment.

BUG=
TEST=compile and unittest in Docker 1.9.1 running on Ubuntu 14.04.3
REF_BUG=
REF_CL=
2015-11-29 00:24:05 -08:00
05d67ad6cf Bump Pepper SDK version from 40 to 45.
Pepper 40 SDK is no longer downloadable from Peppre SDK tool.
We have to switch to newer version right now.

No user visible change is intended.

BUG=
TEST=compile
REF_BUG=
REF_CL=
2015-10-24 01:02:15 -07:00
cfe9a2a5c7 Move docker directory from src/ to top directory.
Currently meta information regarding how to set up build environment
for Mozc and how to build Mozc actually is described in files at the
top level directory (e.g., README.md and appveyor.yml) and documents
under doc/ directory.  One exception of this directory structure is
docker files under src/docker/ directory.

Probably extracting this kind of meta source code out from src/
directory would make sense from the viewpoint of directory structure
management.
2015-09-20 19:21:21 -07:00