From fbcdfa669173ac909ec830336454d30ae104ee5d Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 18 Apr 2023 13:09:35 -0400 Subject: [PATCH] Plugin/CodeQL: Linux fixes 1. Removes assignment to `suffix` (which does not have a setter) 2. Adds owner execution permission to files in the CodeQL CLI ext dep Signed-off-by: Michael Kubacki --- .pytool/Plugin/CodeQL/CodeQlBuildPlugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.pytool/Plugin/CodeQL/CodeQlBuildPlugin.py b/.pytool/Plugin/CodeQL/CodeQlBuildPlugin.py index bf0e893b2f..2fbf554f8f 100644 --- a/.pytool/Plugin/CodeQL/CodeQlBuildPlugin.py +++ b/.pytool/Plugin/CodeQL/CodeQlBuildPlugin.py @@ -6,6 +6,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent ## +import glob import logging import os import stat @@ -99,7 +100,7 @@ def do_pre_build(self, builder: UefiBuilder) -> int: self.codeql_cmd_path = self.codeql_cmd_path.parent / ( self.codeql_cmd_path.name + '.bat') elif GetHostInfo().os == "Linux": - self.codeql_cmd_path.suffix = self.codeql_cmd_path.parent / ( + self.codeql_cmd_path = self.codeql_cmd_path.parent / ( self.codeql_cmd_path.name + '.sh') codeql_build_cmd += f"#!/bin/bash{os.linesep * 2}" codeql_build_cmd += "build " + build_params @@ -110,6 +111,9 @@ def do_pre_build(self, builder: UefiBuilder) -> int: if GetHostInfo().os == "Linux": os.chmod(self.codeql_cmd_path, os.stat(self.codeql_cmd_path).st_mode | stat.S_IEXEC) + for f in glob.glob(os.path.join( + os.path.dirname(self.codeql_path), '**/*'), recursive=True): + os.chmod(f, os.stat(f).st_mode | stat.S_IEXEC) codeql_params = (f'database create {self.codeql_db_path} ' f'--language=cpp '