зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1495641 - Make clang-tidy toolchains use a clang-tidy/ directory instead of clang/. r=ted
Differential Revision: https://phabricator.services.mozilla.com/D7582
This commit is contained in:
Родитель
a2970b5269
Коммит
d19d35bd2e
|
@ -183,7 +183,7 @@ def is_windows():
|
|||
|
||||
|
||||
def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
|
||||
src_dir, stage_dir, build_libcxx,
|
||||
src_dir, stage_dir, package_name, build_libcxx,
|
||||
osx_cross_compile, build_type, assertions,
|
||||
python_path, gcc_dir, libcxx_include_dir,
|
||||
is_final_stage=False):
|
||||
|
@ -191,7 +191,7 @@ def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
|
|||
os.mkdir(stage_dir)
|
||||
|
||||
build_dir = stage_dir + "/build"
|
||||
inst_dir = stage_dir + "/clang"
|
||||
inst_dir = stage_dir + "/" + package_name
|
||||
|
||||
# cmake doesn't deal well with backslashes in paths.
|
||||
def slashify_path(path):
|
||||
|
@ -588,7 +588,9 @@ if __name__ == "__main__":
|
|||
if os.path.exists(l[0]):
|
||||
symlink(l[0], l[1])
|
||||
|
||||
package_name = "clang"
|
||||
if build_clang_tidy:
|
||||
package_name = "clang-tidy"
|
||||
import_clang_tidy(llvm_source_dir)
|
||||
|
||||
if not os.path.exists(build_dir):
|
||||
|
@ -598,7 +600,7 @@ if __name__ == "__main__":
|
|||
"libcxx", "include")
|
||||
|
||||
stage1_dir = build_dir + '/stage1'
|
||||
stage1_inst_dir = stage1_dir + '/clang'
|
||||
stage1_inst_dir = stage1_dir + '/' + package_name
|
||||
|
||||
final_stage_dir = stage1_dir
|
||||
|
||||
|
@ -663,12 +665,12 @@ if __name__ == "__main__":
|
|||
[asm] + extra_asmflags,
|
||||
[ld] + extra_ldflags,
|
||||
ar, ranlib, libtool,
|
||||
llvm_source_dir, stage1_dir, build_libcxx, osx_cross_compile,
|
||||
llvm_source_dir, stage1_dir, package_name, build_libcxx, osx_cross_compile,
|
||||
build_type, assertions, python_path, gcc_dir, libcxx_include_dir)
|
||||
|
||||
if stages > 1:
|
||||
stage2_dir = build_dir + '/stage2'
|
||||
stage2_inst_dir = stage2_dir + '/clang'
|
||||
stage2_inst_dir = stage2_dir + '/' + package_name
|
||||
final_stage_dir = stage2_dir
|
||||
build_one_stage(
|
||||
[stage1_inst_dir + "/bin/%s%s" %
|
||||
|
@ -679,7 +681,7 @@ if __name__ == "__main__":
|
|||
(cc_name, exe_ext)] + extra_asmflags,
|
||||
[ld] + extra_ldflags,
|
||||
ar, ranlib, libtool,
|
||||
llvm_source_dir, stage2_dir, build_libcxx, osx_cross_compile,
|
||||
llvm_source_dir, stage2_dir, package_name, build_libcxx, osx_cross_compile,
|
||||
build_type, assertions, python_path, gcc_dir, libcxx_include_dir,
|
||||
stages == 2)
|
||||
|
||||
|
@ -695,15 +697,14 @@ if __name__ == "__main__":
|
|||
(cc_name, exe_ext)] + extra_asmflags,
|
||||
[ld] + extra_ldflags,
|
||||
ar, ranlib, libtool,
|
||||
llvm_source_dir, stage3_dir, build_libcxx, osx_cross_compile,
|
||||
llvm_source_dir, stage3_dir, package_name, build_libcxx, osx_cross_compile,
|
||||
build_type, assertions, python_path, gcc_dir, libcxx_include_dir,
|
||||
stages == 3)
|
||||
|
||||
package_name = "clang"
|
||||
if build_clang_tidy:
|
||||
prune_final_dir_for_clang_tidy(os.path.join(final_stage_dir, "clang"), osx_cross_compile)
|
||||
package_name = "clang-tidy"
|
||||
prune_final_dir_for_clang_tidy(os.path.join(final_stage_dir, package_name),
|
||||
osx_cross_compile)
|
||||
|
||||
if not args.skip_tar:
|
||||
ext = "bz2" if is_darwin() or is_windows() else "xz"
|
||||
build_tar_package("tar", "%s.tar.%s" % (package_name, ext), final_stage_dir, "clang")
|
||||
build_tar_package("tar", "%s.tar.%s" % (package_name, ext), final_stage_dir, package_name)
|
||||
|
|
|
@ -1938,17 +1938,17 @@ class StaticAnalysis(MachCommandBase):
|
|||
_, config, _ = self._get_config_environment()
|
||||
clang_tools_path = self.topsrcdir
|
||||
self._clang_tidy_path = mozpath.join(
|
||||
clang_tools_path, "clang", "bin",
|
||||
clang_tools_path, "clang-tidy", "bin",
|
||||
"clang-tidy" + config.substs.get('BIN_SUFFIX', ''))
|
||||
self._clang_format_path = mozpath.join(
|
||||
clang_tools_path, "clang", "bin",
|
||||
clang_tools_path, "clang-tidy", "bin",
|
||||
"clang-format" + config.substs.get('BIN_SUFFIX', ''))
|
||||
self._clang_apply_replacements = mozpath.join(
|
||||
clang_tools_path, "clang", "bin",
|
||||
clang_tools_path, "clang-tidy", "bin",
|
||||
"clang-apply-replacements" + config.substs.get('BIN_SUFFIX', ''))
|
||||
self._run_clang_tidy_path = mozpath.join(clang_tools_path, "clang", "share",
|
||||
self._run_clang_tidy_path = mozpath.join(clang_tools_path, "clang-tidy", "share",
|
||||
"clang", "run-clang-tidy.py")
|
||||
self._clang_format_diff = mozpath.join(clang_tools_path, "clang", "share",
|
||||
self._clang_format_diff = mozpath.join(clang_tools_path, "clang-tidy", "share",
|
||||
"clang", "clang-format-diff.py")
|
||||
|
||||
# Ensure that clang-tidy is present
|
||||
|
@ -2361,17 +2361,17 @@ class StaticAnalysis(MachCommandBase):
|
|||
return rc
|
||||
|
||||
clang_tools_path = mozpath.join(self._mach_context.state_dir, "clang-tools")
|
||||
self._clang_tidy_path = mozpath.join(clang_tools_path, "clang", "bin",
|
||||
self._clang_tidy_path = mozpath.join(clang_tools_path, "clang-tidy", "bin",
|
||||
"clang-tidy" + config.substs.get('BIN_SUFFIX', ''))
|
||||
self._clang_format_path = mozpath.join(
|
||||
clang_tools_path, "clang", "bin",
|
||||
clang_tools_path, "clang-tidy", "bin",
|
||||
"clang-format" + config.substs.get('BIN_SUFFIX', ''))
|
||||
self._clang_apply_replacements = mozpath.join(
|
||||
clang_tools_path, "clang", "bin",
|
||||
clang_tools_path, "clang-tidy", "bin",
|
||||
"clang-apply-replacements" + config.substs.get('BIN_SUFFIX', ''))
|
||||
self._run_clang_tidy_path = mozpath.join(clang_tools_path, "clang", "share", "clang",
|
||||
self._run_clang_tidy_path = mozpath.join(clang_tools_path, "clang-tidy", "share", "clang",
|
||||
"run-clang-tidy.py")
|
||||
self._clang_format_diff = mozpath.join(clang_tools_path, "clang", "share", "clang",
|
||||
self._clang_format_diff = mozpath.join(clang_tools_path, "clang-tidy", "share", "clang",
|
||||
"clang-format-diff.py")
|
||||
|
||||
if os.path.exists(self._clang_tidy_path) and \
|
||||
|
|
|
@ -39,6 +39,11 @@ jobs:
|
|||
treeherder:
|
||||
platform: linux64/debug
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-large
|
||||
worker:
|
||||
env:
|
||||
# clang-tidy needs a recent libstdc++, which can be found in the clang
|
||||
# toolchain.
|
||||
LD_LIBRARY_PATH: /builds/worker/workspace/build/src/clang/lib
|
||||
run:
|
||||
config:
|
||||
- builds/releng_base_firefox.py
|
||||
|
|
Загрузка…
Ссылка в новой задаче