msan_builder: Build -dev packages, and include .a libraries in output.

This commit is contained in:
Oliver Chang 2017-12-15 12:57:11 -08:00
parent 8b75981da9
commit c2388b53fc
2 changed files with 18 additions and 5 deletions

View File

@ -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

View File

@ -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)