Update Android NDK patch so that Android NDK can be handled gracefully #1182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a preparation before removing the dependency on Docker from our Android build instructions (#1181).
Suppose we want to set 'path' attribute to
android_ndk_repository_extension
so that we can specify the actual path to the Android NDK in ourMODULE.bazel
.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 emptyBUILD.bazel
file when an Android NDK does not exist at the location specified byANDROID_NDK_HOME
or the path attribute. Basically this is a superset of the behavior of the current patch, where an emptyBUILD.bazel
file is generated unlessANDROID_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.
Issue IDs
Steps to test new behaviors (if any)