48 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
c523a3b998 Move Repository rule documentation under Bzlmod
PiperOrigin-RevId: 728591907
2025-02-19 11:11:51 +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
c62effb5da Update build_mozc_in_docker.md to reflect bzlmod migration
As we are about to complete bzlmod migration (#1002), let's also update
the build instructions to make it clear that "MODULE.bazel" will be the
file to be customized depending on differences in Linux distributions
and packagers' needs.

PiperOrigin-RevId: 680748113
2024-09-30 22:50:29 +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
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
e2246ccbca Update the document for Android NDK.
#codehealth

PiperOrigin-RevId: 664617503
2024-08-19 03:58:04 +00:00
5ba03bef70 Change the status of the GYP build for Linux to "deprecated".
PiperOrigin-RevId: 623761678
2024-04-11 09:44:48 +00:00
c77285efa0 Rebase mozc onto Abseil logging library.
This is a relatively large update with several breaking changes.

- Most of the code in `//base:logging` is now removed.
- Logging calls are now handled by `@com_google_absl//absl/log`. This means:
  - Log message formats will change.
  - Important: If you have existing log files and run non-release builds (more precisely `!defined(MOZC_NO_LOGGING)`), your files will contain mixed formats after this commit. You may want to remove or rename the existing one.
- Flag deprecations
  - `--colored_log`: they're not supported by Abseil.
  - `--logtostderr`: this flag had a inconsistent behavior with a google-internal flag of the same name (nor it doesn't make sense for mozc to consolidate the semantics), and is not provided by Abseil.
    - Note: There's no longer a way to disable log files in debug builds. A configuration option might be added later if this proves problematic.

The Abseil logging library is packed with many features. It provides out-of-box integration with the Windows debugger and allows you to adjust the verbosity of your logs using command-line flags (e.g., `--stderrthreshold=0` to see all INFO level logs and above). For a full list of features, take a look at their documentation and source code.

PiperOrigin-RevId: 610006013
2024-02-26 03:12:27 +00:00
279e2a4527 Fix #844: Set configure = True to repository_rule
By setting 'configure = True' to 'repository_rule' when defining an
external repository, the repository will be re-evaluated by running the
following command [1].

  bazel sync --configure

Hopefully this command can fix most of mysterious build failures due to
stale external repositories and/or build toolchanins, which cannot be
simply fixed by 'bazel clean'.

 [1]: 80edda5b7b/site/en/extending/repo.md (L156-L168)

PiperOrigin-RevId: 580265652
2023-11-07 20:31:21 +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
00f867b459 Add a note for bazel clean.
#codehealth

PiperOrigin-RevId: 573636115
2023-10-15 17:31:10 +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
24f86c5180 #779: Remove 'libxcb' from build deps
This is a follow up to 88fb0c68d7.

#codehealth

PiperOrigin-RevId: 552728174
2023-08-01 08:36:06 +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
eb8f5dfc26 Update build_mozc_in_docker.md (#746)
* Update build_mozc_in_docker.md

Missing character

PiperOrigin-RevId: 535210517
2023-05-25 21:03:34 +09:00
a2416f52bc Use local_repository for googletest instead of new_local_repository.
* local_repository uses googletest's WORKSPACE and treats googletest as a separate repository.
* new_local_repository treats googletest as a part of Mozc's respository.
* We no longer need to specify "-- -thired_party/..." for unit tests to avoid errors.

#codehaalth

PiperOrigin-RevId: 531765928
2023-05-13 17:13:26 +00:00
1063358361 Update the section of the GYP build.
* The GYP build no longer support the Ibus build.

PiperOrigin-RevId: 528387874
2023-05-01 04:57:38 +00:00
f3a8cf4e1a Add --build_tests_only to bazel test
This is a follow up to my c04a115f9c for #729.

With `--build_tests_only`, we can tell bazel to build targets that are only necessary to run tests, which drastically saves time.

https://bazel.build/docs/user-manual#build-tests-only

#codehealth

PiperOrigin-RevId: 527581234
2023-04-27 15:12:11 +00:00
a41d0677d5 Update the document and workflow as the net/ directory was removed.
#codehealth

PiperOrigin-RevId: 521369482
2023-04-03 05:58:51 +00:00
6bc554c15e Archive the section of "GYP Build configurations".
#codehealth

PiperOrigin-RevId: 500863901
2023-01-10 11:52:17 +09:00
69f8387cce Simplified the build configurations for Ibus.
* Updated the required Ibus version to 1.5.4.
* Always use `symbol` and `input purpose`.

#codehealth

PiperOrigin-RevId: 499692175
2023-01-05 14:04:41 +09:00
6b95e8a412 Update build_mozc_in_docker.md.
#codehealth

PiperOrigin-RevId: 497160216
2022-12-23 00:31:17 +09:00
c71d9ff2f8 Update build instructions for Linux, Android and macOS.
#codehealth

PiperOrigin-RevId: 496892338
2022-12-21 21:49:22 +09:00
ae89dcfd08 Remove mozc_renderer from the package alias in mozc_build.py
* GTK candidate window will be removed.
* Requires --no_gtk_build to notify this change.
* https://github.com/google/mozc/issues/567

PiperOrigin-RevId: 495618343
2022-12-16 02:35:44 +09:00
f3252df878 Add more instructions about Docker build.
#codehealth

PiperOrigin-RevId: 483293216
2022-10-24 16:14:39 +09:00
cebd5eb635 Updated the documents about Bazel only features.
* Filtered dictionary and SVS character input.

PiperOrigin-RevId: 462999851
2022-07-25 13:27:48 +09:00
ea23a3886c Introduce pkg_config_repository.bzl and removed BUILD files for gtk2 and ibus.
* https://github.com/google/mozc/issues/567

PiperOrigin-RevId: 458727952
2022-07-03 16:09:09 +09:00
48a99e7a58 Add tips to ignore modified configuration files in git.
* https://stackoverflow.com/questions/655243/ignore-modified-but-not-committed-files-in-git

PiperOrigin-RevId: 458608584
2022-07-02 15:32:35 +09:00
a28746d4fa Add --use_gyp_for_ibus_build flag.
PiperOrigin-RevId: 452195266
2022-06-01 11:37:50 +09:00
28ff27b0e3 Add a link to Dockerfile.
PiperOrigin-RevId: 439475755
2022-04-05 12:23:27 +09:00
5659b537dc Fix typos.
* https://github.com/google/mozc/issues/553

PiperOrigin-RevId: 431120095
2022-03-04 23:09:36 +09:00
7f02ce1923 Fix a typo.
PiperOrigin-RevId: 428288598
2022-02-13 15:44:11 +09:00
f37d831ec9 Update build paths in build_mozc_in_docker.md.
- Fix a wrong path (lib/mozc_renderer -> lib/mozc/mozc_renderer)
- Add paths for IBus component XML and icons.

PiperOrigin-RevId: 422723002
2022-01-19 14:45:24 +09:00
bd73403635 Add a section for --test_arg=--logtostderr --test_output=all
PiperOrigin-RevId: 408137936
2021-11-07 19:19:36 +09:00
b914993581 Update the build paths and install paths. 2021-10-02 20:02:08 +09:00
10b69af9e9 Update documents. 2021-09-25 18:01:50 +09:00
18b2b32b4d Update documents. 2021-07-17 17:04:33 +09:00
f95d523652 Add notes for build on other Linux environment. 2021-07-03 23:57:36 +09:00
d031469630 Add diff b/w Bazel and GYP. 2021-06-05 18:36:50 +09:00
e932d64a16 Update documents. 2021-02-07 19:12:26 +09:00
42426e181c Update build_mozc_in_docker.md 2020-11-01 16:22:31 +09:00
08c8342531 Update build_mozc_in_docker.md. 2020-10-26 02:30:51 +09:00
262156b03e Update from the upstream.
* Updates for Python3 / MacSDK 10.15 / MSVS 2017
* Some code refactoring
2020-10-11 15:16:25 +09:00
5979e5a847 Update README.md and docs/build_mozc_in_docker.md 2020-09-04 03:05:51 +09:00
842c8420ee Minor document updates 2017-12-29 15:02:53 -08:00
280e38fe3d Drop Qt 4 support
With this CL, --qtver configure option will be removed and Mozc no
longer supports to be built with Qt 4.

BUG=#327
TEST=
REF_BUG=26887740
REF_CL=141386550
REF_TIME=2016-12-08T11:43:38+09:00
REF_TIME_RAW=1481165018 +0900
2016-12-08 11:43:38 +09:00
1c8121087e Rename doc/ to docs/
This CL renames doc to docs/ on GitHub, just in case in future we want
to expose web pages on GitHub Pages [1].

 [1]: https://github.com/blog/2228-simpler-github-pages-publishing

BUG=
TEST=
REF_BUG=
REF_CL=130706872
REF_TIME=2016-08-18T18:22:05-07:00
REF_TIME_RAW=1471569725 -0700
2016-08-18 18:22:05 -07:00