Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A bit more gracefully handle missing Android NDK (#1182)
This is a preparation before removing the dependency on Docker from our Android build instructions (#1181). Suppose we want to specify 'path' attribute to 'android_ndk_repository_extension' so that we can specify the actual path to the Android NDK in our MODULE.bazel. android_ndk_repository_extension = use_extension( "@rules_android_ndk//:extension.bzl", "android_ndk_repository_extension", ) android_ndk_repository_extension.configure( path = "$WORKSPACE_ROOT/third_party/ndk/android-ndk-r28", ) use_repo(android_ndk_repository_extension, "androidndk") The problem is that there is currently no way to conditionally the the above path attribute depending on the host platform and/or the target platform. As a result, the above configuration takes effect not only on Linux but also on Windows environment, where we do not plan to support building libmozc.so right now. To gracefully handle the above scenario, this commit updates our patch to 'rules_android_ndk' to generate an empty BUILD.bazel file when an Android NDK does not exist at the location specified by ANDROID_NDK_HOME or the path attribute. Basically this is a superset of the behavior of the current patch, where an empty BUILD.bazel file is generated unless ANDROID_NDK_HOME is explicitly specified or the path attribute is set. In general there should be no observable behavior change as long as the build is currently passing. PiperOrigin-RevId: 728118761
- Loading branch information