diff --git a/infra/base-images/msan-builder/Dockerfile b/infra/base-images/msan-builder/Dockerfile index 4cb9ef87b..fecb7d78c 100644 --- a/infra/base-images/msan-builder/Dockerfile +++ b/infra/base-images/msan-builder/Dockerfile @@ -30,10 +30,17 @@ WORKDIR /msan ENV PYTHONUNBUFFERED 1 RUN msan_build.py --work-dir=$WORK --create-subdirs \ libarchive13 \ + libarchive-dev \ libfreetype6 \ + libfreetype6-dev \ libpcre2-posix0 \ + libpcre2-dev \ libpcre3 \ + libpcre3-dev \ libpng12-0 \ + libpng12-dev \ libssl1.0.0 \ + libssl-dev \ zlib1g \ + zlib1g-dev \ /msan diff --git a/infra/base-images/msan-builder/msan_build.py b/infra/base-images/msan-builder/msan_build.py index 5706dcdd6..41bcfce56 100755 --- a/infra/base-images/msan-builder/msan_build.py +++ b/infra/base-images/msan-builder/msan_build.py @@ -132,8 +132,8 @@ def FindPackageDebs(package_name, work_directory): return deb_paths -def ExtractSharedLibraries(deb_paths, work_directory, output_directory): - """Extract shared libraries from .deb packages.""" +def ExtractLibraries(deb_paths, work_directory, output_directory): + """Extract libraries from .deb packages.""" extract_directory = os.path.join(work_directory, 'extracted') if os.path.exists(extract_directory): shutil.rmtree(extract_directory, ignore_errors=True) @@ -149,7 +149,8 @@ def ExtractSharedLibraries(deb_paths, work_directory, output_directory): continue for filename in filenames: - if not filename.endswith('.so') and '.so.' not in filename: + if (not filename.endswith('.so') and '.so.' not in filename and + not filename.endswith('.a') and '.a' not in filename): continue file_path = os.path.join(root, filename) @@ -268,6 +269,11 @@ def GetBuildList(package_name): apt_cache = apt.Cache() pkg = apt_cache[package_name] + if pkg.section == 'libdevel': + # Ignore dependencies from -dev packages to keep things simple. These must + # be specified alongside the corresponding runtime package. + return [package_name] + dependencies = [] _CollectDependencies(apt_cache, pkg, {}, dependencies) return dependencies @@ -332,8 +338,8 @@ class MSanBuilder(object): else: extract_directory = output_directory - extracted_paths = ExtractSharedLibraries(deb_paths, self.work_dir, - extract_directory) + extracted_paths = ExtractLibraries(deb_paths, self.work_dir, + extract_directory) for extracted_path in extracted_paths: if not os.path.islink(extracted_path): PatchRpath(extracted_path, extract_directory)