Skip to content

Commit fcd3662

Browse files
committed
gcc: fail early when --gcc-sanitize-* is combined with -t valgrind
These tools cannot work together (unless we build/check multiple times). Let the user know immediately, rather than failing with a confusing error message: [...] >>> 2021-05-14 14:36:19 "/usr/bin/mock-unbuffered" "-r" "rhel-9-beta-x86_64" "--plugin-option=tmpfs:keep_mounted=True" "--config-opts=print_main_output=True" "--quiet" "--remove" "valgrind" No matches found for the following disable plugin patterns: local, spacewalk Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Removing: valgrind x86_64 1:3.17.0-1.el9 @rhel-9.0.0-beta 29 M Transaction Summary ================================================================================ Remove 1 Package Freed space: 29 M Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Removed: valgrind-1:3.17.0-1.el9.x86_64 Complete! >>> 2021-05-14 14:36:21 "'/usr/bin/mock-unbuffered' '-r' 'rhel-9-beta-x86_64' '--plugin-option=tmpfs:keep_mounted=True' '--config-opts=print_main_output=True' '--quiet' '--shell' 'rpm -qa' | sort -V > /tmp/csmockF6PqOx/sssd-2.4.2-4.el9_0_0/debug/rpm-list-mock.txt" >>> 2021-05-14 14:36:23 "'/usr/bin/mock-unbuffered' '-r' 'rhel-9-beta-x86_64' '--plugin-option=tmpfs:keep_mounted=True' '--config-opts=print_main_output=True' '--quiet' '--shell' 'rpm -qa --provides' | sort -V > /tmp/csmockF6PqOx/rpm-list-mock-provides.txt" >>> 2021-05-14 14:36:25 "tar -cP '/usr/share/csmock/scripts' '/usr/bin/csexec' '/usr/bin/csexec-loader' '/usr/lib64/libcsexec-preload.so' '/usr/bin/cswrap' '/usr/lib64/cswrap' '/opt/cov-sa-2021.03' '/tmp/csmockF6PqOx/sssd-2.4.2-4.el9_0_0.src.rpm' | '/usr/bin/mock-unbuffered' '-r' 'rhel-9-beta-x86_64' '--plugin-option=tmpfs:keep_mounted=True' '--config-opts=print_main_output=True' '--quiet' '--shell' 'tar -xC/'" tar: Removing leading `/' from member names !!! 2021-05-14 14:36:34 error: tool "valgrind" does not seem to be installed in build root !!! 2021-05-14 14:36:34 error: post-depinst hook failed >>> 2021-05-14 14:36:34 "/usr/bin/mock-unbuffered" "-r" "rhel-9-beta-x86_64" "--plugin-option=tmpfs:keep_mounted=True" "--config-opts=print_main_output=True" "--quiet" "--clean" scan.ini: time-finished = 2021-05-14 14:36:56 scan.ini: exit-code = 1 <<< 2021-05-14 14:36:56 csmock exit code: 1
1 parent e495faa commit fcd3662

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

py/plugins/gcc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self):
3434
class Plugin:
3535
def __init__(self):
3636
self.enabled = False
37+
self.sanitize = False
3738
self.flags = flags_by_warning_level(0)
3839
self.csgcca_path = None
3940

@@ -45,6 +46,7 @@ def enable(self):
4546

4647
def enable_sanitize(self, props, pkgs, flags):
4748
self.enabled = True
49+
self.sanitize = True
4850
props.run_check = True
4951
props.install_pkgs += pkgs
5052
self.flags.append_flags(flags)
@@ -147,6 +149,9 @@ def handle_args(self, parser, args, props):
147149
["csgrep --mode=json --invert-match --checker COMPILER_WARNING"]
148150
return
149151

152+
if self.sanitize and "valgrind" in props.install_pkgs:
153+
parser.error("GCC sanitizers are not compatible with valgrind")
154+
150155
props.enable_cswrap()
151156
props.cswrap_filters += \
152157
["csgrep --mode=json --invert-match --checker COMPILER_WARNING --event error"]

0 commit comments

Comments
 (0)