servo: Merge #19109 - Check if the NDK version is 12 (from tigercosmos:ndk); r=jdm
authortigercosmos <b04209032@ntu.edu.tw>
Fri, 03 Nov 2017 08:14:27 -0500
changeset 443327 031cd9e534d9926632d96bfdd18912d2b3e596d7
parent 443326 db515817640406651cd36558eac1f0e39c4493a9
child 443328 d4d10e329d1b5e8009ae0465bbdd1cae29475522
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #19109 - Check if the NDK version is 12 (from tigercosmos:ndk); r=jdm <!-- Please describe your changes on the following line: --> Since we only support NDK 12(b), we should add some script to check for that. User might download 15 or 16, and would get some errors. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19095 (github issue number if applicable). <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: af1cd386f5bc000936267094c64114c264f77b38
servo/python/servo/build_commands.py
--- a/servo/python/servo/build_commands.py
+++ b/servo/python/servo/build_commands.py
@@ -256,17 +256,25 @@ class MachCommands(CommandBase):
             if jobs is not None:
                 make_cmd += ["-j" + jobs]
             android_dir = self.android_build_dir(dev)
             openssl_dir = path.join(android_dir, "native", "openssl")
             if not path.exists(openssl_dir):
                 os.makedirs(openssl_dir)
             shutil.copy(path.join(self.android_support_dir(), "openssl.makefile"), openssl_dir)
             shutil.copy(path.join(self.android_support_dir(), "openssl.sh"), openssl_dir)
+
+            # Check if the NDK version is 12
             env["ANDROID_NDK_ROOT"] = env["ANDROID_NDK"]
+            with open(path.join(env["ANDROID_NDK"], 'source.properties')) as ndk_properties:
+                lines = ndk_properties.readlines()
+                if lines[1].split(' = ')[1].split('.')[0] != '12':
+                    print("Currently only support NDK 12.")
+                    sys.exit(1)
+
             env["RUST_TARGET"] = target
             with cd(openssl_dir):
                 status = call(
                     make_cmd + ["-f", "openssl.makefile"],
                     env=env,
                     verbose=verbose)
                 if status:
                     return status