Skip to content

Commit

Permalink
Backed out changeset 4ba7a3e079e3 (bug 1566336) for static analysis b…
Browse files Browse the repository at this point in the history
…ustage CLOSED TREE
  • Loading branch information
bogdant-old committed Jul 31, 2019
1 parent 86692ba commit 4f87c3b
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"unpack": true
},
{
"version": "MinGit-2.13.3-64-bit",
"size": 21482885,
"digest": "929bb3c07be8487ee519422a312bdbfeec8f4db4b62c49d02f9aad9fd2a66c0ee5fad63d2b06c8744c336dc9d50446fa4457897333ad17ffd783ecabd1e2ddbb",
"version": "SVN 1.9.4, repacked from SlikSvn (https://sliksvn.com/download/)",
"size": 3934520,
"digest": "d3b8f74936857ecbf542e403ed6835938a31d65302985729cbfa7191bf2cf94138565cefcc2f31517098013fbfc51868348863a55b588250902f9dec214dbc42",
"algorithm": "sha512",
"filename": "git.zip",
"filename": "svn194.zip",
"unpack": true
},
{
Expand Down
55 changes: 36 additions & 19 deletions build/build-clang/build-clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

from mozfile import which

URL_REPO = "https://github.com/llvm/llvm-project"


def symlink(source, link_name):
os_symlink = getattr(os, "symlink", None)
Expand Down Expand Up @@ -78,7 +76,7 @@ def import_clang_tidy(source_dir):
clang_plugin_path = os.path.join(os.path.dirname(sys.argv[0]),
'..', 'clang-plugin')
clang_tidy_path = os.path.join(source_dir,
'clang-tools-extra/clang-tidy')
'tools/clang/tools/extra/clang-tidy')
sys.path.append(clang_plugin_path)
from import_mozilla_checks import do_import
do_import(clang_plugin_path, clang_tidy_path)
Expand Down Expand Up @@ -199,14 +197,13 @@ def install_asan_symbols(build_dir, clang_dir):
shutil.copy2(src_path[0], dst_path[0])


def git_clone(base_dir, url, directory, revision):
run_in(base_dir, ["git", "clone", "-n", url, directory])
run_in(os.path.join(base_dir, directory), ["git", "checkout", revision])
def svn_co(source_dir, url, directory, revision):
run_in(source_dir, ["svn", "co", "-q", "-r", revision, url, directory])


def git_update(directory, revision):
run_in(directory, ["git", "remote", "update"])
run_in(directory, ["git", "reset", "--hard", revision])
def svn_update(directory, revision):
run_in(directory, ["svn", "revert", "-q", "-R", "."])
run_in(directory, ["svn", "update", "-q", "-r", revision])


def is_darwin():
Expand Down Expand Up @@ -586,6 +583,7 @@ def prune_final_dir_for_clang_tidy(final_dir, osx_cross_compile):

llvm_source_dir = source_dir + "/llvm"
clang_source_dir = source_dir + "/clang"
extra_source_dir = source_dir + "/extra"
lld_source_dir = source_dir + "/lld"
compiler_rt_source_dir = source_dir + "/compiler-rt"
libcxx_source_dir = source_dir + "/libcxx"
Expand All @@ -607,8 +605,14 @@ def prune_final_dir_for_clang_tidy(final_dir, osx_cross_compile):
config = json.load(args.config)

llvm_revision = config["llvm_revision"]
if not re.match(r'^[0-9a-fA-F]{40}$', llvm_revision):
raise ValueError("Incorrect format of the git revision")
llvm_repo = config["llvm_repo"]
clang_repo = config["clang_repo"]
extra_repo = config.get("extra_repo")
lld_repo = config.get("lld_repo")
# On some packages we don't use compiler_repo
compiler_repo = config.get("compiler_repo")
libcxx_repo = config["libcxx_repo"]
libcxxabi_repo = config.get("libcxxabi_repo")
stages = 3
if "stages" in config:
stages = int(config["stages"])
Expand Down Expand Up @@ -682,20 +686,33 @@ def prune_final_dir_for_clang_tidy(final_dir, osx_cross_compile):
if not os.path.exists(source_dir):
os.makedirs(source_dir)

if not args.skip_checkout:
if os.path.exists(os.path.join(source_dir, '.git')):
git_update(source_dir, llvm_revision)
def checkout_or_update(repo, checkout_dir):
if os.path.exists(checkout_dir):
svn_update(checkout_dir, llvm_revision)
else:
delete(source_dir)
git_clone(base_dir, URL_REPO, source_dir, llvm_revision)
svn_co(source_dir, repo, checkout_dir, llvm_revision)

for p in config.get("patches", []):
patch(p, source_dir)
if not args.skip_checkout:
checkout_or_update(llvm_repo, llvm_source_dir)
checkout_or_update(clang_repo, clang_source_dir)
if compiler_repo is not None:
checkout_or_update(compiler_repo, compiler_rt_source_dir)
checkout_or_update(libcxx_repo, libcxx_source_dir)
if lld_repo:
checkout_or_update(lld_repo, lld_source_dir)
if libcxxabi_repo:
checkout_or_update(libcxxabi_repo, libcxxabi_source_dir)
if extra_repo:
checkout_or_update(extra_repo, extra_source_dir)
for p in config.get("patches", []):
patch(p, source_dir)

compiler_rt_source_link = llvm_source_dir + "/projects/compiler-rt"

symlinks = [(clang_source_dir,
llvm_source_dir + "/tools/clang"),
(extra_source_dir,
llvm_source_dir + "/tools/clang/tools/extra"),
(lld_source_dir,
llvm_source_dir + "/tools/lld"),
(compiler_rt_source_dir, compiler_rt_source_link),
Expand All @@ -714,7 +731,7 @@ def prune_final_dir_for_clang_tidy(final_dir, osx_cross_compile):
package_name = "clang"
if build_clang_tidy:
package_name = "clang-tidy"
import_clang_tidy(source_dir)
import_clang_tidy(llvm_source_dir)

if not os.path.exists(build_dir):
os.makedirs(build_dir)
Expand Down
7 changes: 6 additions & 1 deletion build/build-clang/clang-4.0-linux64.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"llvm_revision": "449c3ef93afc7a668eb35e67a83717453e28b25a",
"llvm_revision": "305830",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_401/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_401/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_401/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_401/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_401/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
8 changes: 7 additions & 1 deletion build/build-clang/clang-7-linux64.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"llvm_revision": "d0d8eb2e5415b8be29343e3c17a18e49e67b5551",
"llvm_revision": "349247",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_701/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
8 changes: 7 additions & 1 deletion build/build-clang/clang-8-android.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "2",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
8 changes: 7 additions & 1 deletion build/build-clang/clang-8-linux64-aarch64-cross.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
8 changes: 7 additions & 1 deletion build/build-clang/clang-8-linux64.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
8 changes: 7 additions & 1 deletion build/build-clang/clang-8-macosx64.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"osx_cross_compile": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",
Expand Down
8 changes: 7 additions & 1 deletion build/build-clang/clang-8-mingw.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356265",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
4 changes: 2 additions & 2 deletions build/build-clang/clang-tidy-8.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 2019-03-27 15:12:48.000000000 +0200
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 2019-03-27 15:12:39.000000000 +0200
--- a/extra/clang-tidy/tool/run-clang-tidy.py 2019-03-27 15:12:48.000000000 +0200
+++ b/extra/clang-tidy/tool/run-clang-tidy.py 2019-03-27 15:12:39.000000000 +0200
@@ -169,6 +169,7 @@
with lock:
sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8') + '\n')
Expand Down
7 changes: 6 additions & 1 deletion build/build-clang/clang-tidy-linux64.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final/",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final/",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_800/final/",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final/",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final/",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
Expand Down
10 changes: 7 additions & 3 deletions build/build-clang/clang-tidy-macosx64.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"osx_cross_compile": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_800/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",
Expand All @@ -16,7 +21,6 @@
"libtool": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin-libtool",
"ld": "/builds/worker/workspace/build/src/clang/bin/clang",
"patches": [
"clang-tidy-8.patch",
"compiler-rt-no-codesign.patch"
"clang-tidy-8.patch"
]
}
7 changes: 6 additions & 1 deletion build/build-clang/clang-tidy-win64.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "1",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",
Expand Down
7 changes: 6 additions & 1 deletion build/build-clang/clang-win64.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"llvm_revision": "d2298e74235598f15594fe2c99bbac870a507c59",
"llvm_revision": "356365",
"stages": "3",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_800/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_800/final",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",
Expand Down
7 changes: 2 additions & 5 deletions build/clang-plugin/import_mozilla_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ def write_third_party_paths(mozilla_path, module_path):
def do_import(mozilla_path, clang_tidy_path):
module = 'mozilla'
module_path = os.path.join(clang_tidy_path, module)
try:
os.makedirs(module_path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
if not os.path.isdir(module_path):
os.mkdir(module_path)

copy_dir_contents(mozilla_path, module_path)
write_third_party_paths(mozilla_path, module_path)
Expand Down
Loading

0 comments on commit 4f87c3b

Please sign in to comment.