From 52edfa581061a40b8d2c42c6df290576403d4d97 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 30 Nov 2018 19:37:53 +0000 Subject: [PATCH] Drop python2 dependency from clang-tools-extra --- ...-all-symbols.py-to-python3-using-2to.patch | 61 +++++++++++++++++++ clang.spec | 14 +++-- 2 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 0001-Convert-run-find-all-symbols.py-to-python3-using-2to.patch diff --git a/0001-Convert-run-find-all-symbols.py-to-python3-using-2to.patch b/0001-Convert-run-find-all-symbols.py-to-python3-using-2to.patch new file mode 100644 index 0000000..620f80d --- /dev/null +++ b/0001-Convert-run-find-all-symbols.py-to-python3-using-2to.patch @@ -0,0 +1,61 @@ +From 6430ef09aecb30bce588c2d7f35b2294d219c835 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Mon, 26 Nov 2018 19:18:12 -0800 +Subject: [PATCH] Convert run-find-all-symbols.py to python3 using 2to3 + +--- + include-fixer/find-all-symbols/tool/run-find-all-symbols.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/include-fixer/find-all-symbols/tool/run-find-all-symbols.py +index 461d959..89a6cf5 100755 +--- a/include-fixer/find-all-symbols/tool/run-find-all-symbols.py ++++ b/include-fixer/find-all-symbols/tool/run-find-all-symbols.py +@@ -27,7 +27,7 @@ import argparse + import json + import multiprocessing + import os +-import Queue ++import queue + import shutil + import subprocess + import sys +@@ -40,7 +40,7 @@ def find_compilation_database(path): + result = './' + while not os.path.isfile(os.path.join(result, path)): + if os.path.realpath(result) == '/': +- print 'Error: could not find compilation database.' ++ print('Error: could not find compilation database.') + sys.exit(1) + result += '../' + return os.path.realpath(result) +@@ -50,7 +50,7 @@ def MergeSymbols(directory, args): + """Merge all symbol files (yaml) in a given directaory into a single file.""" + invocation = [args.binary, '-merge-dir='+directory, args.saving_path] + subprocess.call(invocation) +- print 'Merge is finished. Saving results in ' + args.saving_path ++ print('Merge is finished. Saving results in ' + args.saving_path) + + + def run_find_all_symbols(args, tmpdir, build_path, queue): +@@ -96,7 +96,7 @@ def main(): + + try: + # Spin up a bunch of tidy-launching threads. +- queue = Queue.Queue(max_task) ++ queue = queue.Queue(max_task) + for _ in range(max_task): + t = threading.Thread(target=run_find_all_symbols, + args=(args, tmpdir, build_path, queue)) +@@ -116,7 +116,7 @@ def main(): + except KeyboardInterrupt: + # This is a sad hack. Unfortunately subprocess goes + # bonkers with ctrl-c and we start forking merrily. +- print '\nCtrl-C detected, goodbye.' ++ print('\nCtrl-C detected, goodbye.') + os.kill(0, 9) + + +-- +1.8.3.1 + diff --git a/clang.spec b/clang.spec index 43034f5..9bb4c9a 100644 --- a/clang.spec +++ b/clang.spec @@ -57,7 +57,7 @@ Name: %pkg_name Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 6%{?dist} +Release: 7%{?dist} Summary: A C language family front-end for LLVM License: NCSA @@ -75,6 +75,9 @@ Patch5: 0001-Don-t-prefer-python2.7.patch Patch6: 0001-Convert-clang-format-diff.py-to-python3-using-2to3.patch Patch7: 0001-Convert-scan-view-to-python3-using-2to3.patch +# clang-tools-extra patches +Patch100: 0001-Convert-run-find-all-symbols.py-to-python3-using-2to.patch + BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake @@ -200,10 +203,10 @@ Requires: python2 %else %setup -T -q -b 1 -n %{clang_tools_srcdir} -pathfix.py -i %{__python3} -pn \ - clang-tidy/tool/*.py +%patch100 -p1 -b .find-all-symbols-py3 -pathfix.py -i %{__python2} -pn \ +pathfix.py -i %{__python3} -pn \ + clang-tidy/tool/*.py \ include-fixer/find-all-symbols/tool/run-find-all-symbols.py %setup -q -n %{clang_srcdir} @@ -403,6 +406,9 @@ false %endif %changelog +* Fri Nov 30 2018 Tom Stellard - 7.0.0-7 +- Drop python2 dependency from clang-tools-extra + * Wed Nov 21 2018 sguelton@redhat.com - 7.0.0-6 - Prune unneeded reference to llvm-test-suite sub-package