From a023ed88c73f84285b1c2b578b389a4bab73a1ad Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Wed, 22 Nov 2017 14:01:06 -0800 Subject: [PATCH] [infra] msan builder: wrap dpkg-gensymbols. --- infra/base-images/msan-builder/msan_build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/infra/base-images/msan-builder/msan_build.py b/infra/base-images/msan-builder/msan_build.py index 34ae18c1e..1148ce365 100755 --- a/infra/base-images/msan-builder/msan_build.py +++ b/infra/base-images/msan-builder/msan_build.py @@ -79,6 +79,16 @@ def SetUpEnvironment(work_dir): env['DEB_LDFLAGS_APPEND'] = MSAN_OPTIONS env['DPKG_GENSYMBOLS_CHECK_LEVEL'] = '0' + # debian/rules can set DPKG_GENSYMBOLS_CHECK_LEVEL explicitly, so override it. + dpkg_gensymbols_path = os.path.join(bin_dir, 'dpkg-gensymbols') + with open(dpkg_gensymbols_path, 'w') as f: + f.write( + '#!/bin/sh\n' + 'export DPKG_GENSYMBOLS_CHECK_LEVEL=0\n' + '/usr/bin/dpkg-gensymbols "$@"\n') + + os.chmod(dpkg_gensymbols_path, 0755) + env['PATH'] = bin_dir + ':' + os.environ['PATH'] # Prevent entire build from failing because of bugs/uninstrumented in tools