From c743b577babc60ba9fae26d4aa26653e7cd64569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Csord=C3=A1s?= Date: Mon, 16 Dec 2019 11:45:37 +0100 Subject: [PATCH] [make] Package warning-to-plist converter --- .travis.yml | 2 +- Makefile | 12 +++++++- .../warning_to_plist/WarningToPlist.py | 29 +++++++++++++++---- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35dca5006b..f2ab80fb29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -148,7 +148,7 @@ script: make clean_travis && make package && make -C tools/plist_to_html test && - make -C tools/warning-to-plist test && + make -C tools/warning-to-plist package test && if [[ "$CC_MODULE" = "analyzer" ]]; then BUILD_DIR=$TRAVIS_BUILD_DIR/build make -C analyzer \ test_unit \ diff --git a/Makefile b/Makefile index e8f7ad0d8b..49b00d54ee 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,17 @@ package_tu_collector: build_tu_collector package_dir_structure cd $(CC_BUILD_DIR) && \ ln -sf ../lib/python2.7/tu_collector/tu_collector.py bin/tu_collector -package: package_dir_structure set_git_commit_template package_plist_to_html package_tu_collector +build_warning_to_plist: + $(MAKE) -C $(ROOT)/tools/warning-to-plist build + +package_warning_to_plist: build_warning_to_plist package_dir_structure + # Copy tu_collector files. + cp -rp $(CC_TOOLS)/warning-to-plist/build/warning_to_plist/warning_to_plist $(CC_BUILD_LIB_DIR) && \ + chmod u+x $(CC_BUILD_LIB_DIR)/warning_to_plist/WarningToPlist.py && \ + cd $(CC_BUILD_DIR) && \ + ln -sf ../lib/python2.7/warning_to_plist/WarningToPlist.py bin/warning-to-plist + +package: package_dir_structure set_git_commit_template package_plist_to_html package_tu_collector package_warning_to_plist BUILD_DIR=$(BUILD_DIR) BUILD_LOGGER_64_BIT_ONLY=$(BUILD_LOGGER_64_BIT_ONLY) $(MAKE) -C $(CC_ANALYZER) package_analyzer BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_WEB) package_web diff --git a/tools/warning-to-plist/warning_to_plist/WarningToPlist.py b/tools/warning-to-plist/warning_to_plist/WarningToPlist.py index a2823e0908..3265c56958 100755 --- a/tools/warning-to-plist/warning_to_plist/WarningToPlist.py +++ b/tools/warning-to-plist/warning_to_plist/WarningToPlist.py @@ -15,11 +15,30 @@ import shutil import sys -from .converter.clang_tidy.plist_converter import ClangTidyPlistConverter -from .converter.sanitizers.address.plist_converter import ASANPlistConverter -from .converter.sanitizers.memory.plist_converter import MSANPlistConverter -from .converter.sanitizers.thread.plist_converter import TSANPlistConverter -from .converter.sanitizers.ub.plist_converter import UBSANPlistConverter +try: + from .converter.clang_tidy.plist_converter import \ + ClangTidyPlistConverter + from .converter.sanitizers.address.plist_converter import \ + ASANPlistConverter + from .converter.sanitizers.memory.plist_converter import \ + MSANPlistConverter + from .converter.sanitizers.thread.plist_converter import \ + TSANPlistConverter + from .converter.sanitizers.ub.plist_converter import \ + UBSANPlistConverter +except ValueError: + # Attempted relative import in non-package. + from converter.clang_tidy.plist_converter import \ + ClangTidyPlistConverter + from converter.sanitizers.address.plist_converter import \ + ASANPlistConverter + from converter.sanitizers.memory.plist_converter import \ + MSANPlistConverter + from converter.sanitizers.thread.plist_converter import \ + TSANPlistConverter + from converter.sanitizers.ub.plist_converter import \ + UBSANPlistConverter + LOG = logging.getLogger('WarningToPlist')