Commit f068f5d9 authored by Ben Wells's avatar Ben Wells Committed by Commit Bot

Revert "Switch RPM packager to use new dependency system"

This reverts commit 54a27d88.

Reason for revert: Caused compile failure.

Original change's description:
> Switch RPM packager to use new dependency system
> 
> BUG=758654
> R=​thestig@chromium.org
> 
> Change-Id: Ib64eb4ace73d7803b083f4d40795193dedc288f7
> Reviewed-on: https://chromium-review.googlesource.com/655943
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#501104}

TBR=thestig@chromium.org,thomasanderson@chromium.org

Change-Id: I3d625e3098e7b60ca173b51c8616c8d34c58a5a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 758654
Reviewed-on: https://chromium-review.googlesource.com/662477Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Commit-Queue: Ben Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501134}
parent 8b63476e
......@@ -66,11 +66,6 @@ action_foreach("calculate_deb_dependencies") {
]
script = "debian/calculate_package_deps.py"
sources = packaging_files_binaries
inputs = [
"debian/deb_version.py",
"debian/dist-package-versions.json",
"debian/package_version_interval.py",
]
outputs = [
"$root_out_dir/deb_{{source_name_part}}.deps",
]
......@@ -90,8 +85,6 @@ action("merge_deb_dependencies") {
additional_deps = "debian/additional_deps"
inputs = [
additional_deps,
"debian/deb_version.py",
"debian/package_version_interval.py",
]
outputs = [
"$root_out_dir/deb_common.deps",
......@@ -110,9 +103,6 @@ action_foreach("calculate_rpm_dependencies") {
]
script = "rpm/calculate_package_deps.py"
sources = packaging_files_binaries
inputs = [
"rpm/dist-package-provides.json",
]
outputs = [
"$root_out_dir/rpm_{{source_name_part}}.deps",
]
......@@ -128,17 +118,10 @@ action("merge_rpm_dependencies") {
":calculate_rpm_dependencies",
]
script = "rpm/merge_package_deps.py"
additional_deps = "rpm/additional_deps"
inputs = [
additional_deps,
]
outputs = [
"$root_out_dir/rpm_common.deps",
]
args = [
"rpm_common.deps",
rebase_path(additional_deps, root_build_dir),
]
args = [ "rpm_common.deps" ]
args += rebase_path(get_target_outputs(":calculate_rpm_dependencies"),
root_build_dir)
}
......@@ -281,6 +264,7 @@ if (!is_chromeos) {
sources = [
"rpm/build.sh",
"rpm/chrome.spec.template",
"rpm/expected_deps_x86_64",
]
outputs = [
"$root_out_dir/installer/rpm/{{source_file_part}}",
......@@ -439,7 +423,6 @@ template("linux_package") {
}
deps = [
":installer_deps",
":merge_rpm_dependencies",
]
}
}
......
# lsb implies many dependencies and on Fedora or RHEL some of these are not
# needed at all (the most obvious one is qt3) and Chrome is usually the one
# who pulls them to the system by requiring the whole lsb. Require only
# lsb_release from the lsb as that's the only thing that we are using.
#
# nss (bundled) is optional in LSB 4.0. Also specify a more recent version
# for security and stability updates. While we depend on libnss3.so and not
# libssl3.so, force the dependency on libssl3 to ensure the NSS version is
# 3.28 or later, since libssl3 should always be packaged with libnss3.
#
# wget is for uploading crash reports with Breakpad.
#
# xdg-utils is still optional in LSB 4.0.
#
# zlib may not need to be there. It should be included with LSB.
# TODO(thestig): Figure out why there is an entry for zlib.
#
# We want to depend on the system SSL certs so wget can upload crash reports
# securely, but there's no common capability between the distros. Bugs filed:
# https://qa.mandriva.com/show_bug.cgi?id=55714
# https://bugzilla.redhat.com/show_bug.cgi?id=538158
# https://bugzilla.novell.com/show_bug.cgi?id=556248
#
# We want to depend on liberation-fonts as well, but there is no such package
# for Fedora. https://bugzilla.redhat.com/show_bug.cgi?id=1252564
# TODO(thestig): Use the liberation-fonts package once its available on all
# supported distros.
/usr/bin/lsb_release
libnss3.so(NSS_3.22)(64bit)
libssl3.so(NSS_3.28)(64bit)
wget
xdg-utils
zlib
......@@ -102,8 +102,83 @@ do_package() {
ADDITIONAL_CONFLICTS="xorg-x11-libX11 < 7.6_1 libX11 < 1.4.99"
REPLACES="$REPLACES $ADDITIONAL_CONFLICTS"
RPM_COMMON_DEPS="${BUILDDIR}/rpm_common.deps"
DEPENDS=$(cat "${RPM_COMMON_DEPS}" | tr '\n' ',')
# If we specify a dependecy of foo.so below, we would depend on both the
# 32 and 64-bit versions on a 64-bit machine. The current version of RPM
# we use is too old and doesn't provide %{_isa}, so we do this manually.
if [ "$ARCHITECTURE" = "x86_64" ] ; then
local EMPTY_VERSION="()"
local PKG_ARCH="(64bit)"
elif [ "$ARCHITECTURE" = "i386" ] ; then
local EMPTY_VERSION=""
local PKG_ARCH=""
fi
# Use find-requires script to make sure the dependencies are complete
# (especially libc versions).
DETECTED_DEPENDS="$(echo "${BUILDDIR}/chrome" | /usr/lib/rpm/find-requires)"
# Compare the expected dependency list to the generated list.
#
# In this comparison, we allow ld-linux.so's symbol version "GLIBC_2.3"
# to be present but don't require it, because it is hard to predict
# whether it will be generated. Referencing a __thread
# (thread-local/TLS) variable *sometimes* causes the compiler to generate
# a reference to __tls_get_addr() (depending on compiler options such as
# -fPIC vs. -fPIE). This function has symbol version "GLIBC_2.3". The
# linker *sometimes* optimizes away the __tls_get_addr() call using
# link-time code rewriting, but it might leave the symbol dependency in
# place -- there are no guarantees.
BAD_DIFF=0
if [ -r "$SCRIPTDIR/expected_deps_$ARCHITECTURE" ]; then
diff -u "$SCRIPTDIR/expected_deps_$ARCHITECTURE" \
<(echo "${DETECTED_DEPENDS}" | \
LANG=C sort | \
grep -v '^ld-linux.*\(GLIBC_2\.3\)') \
|| BAD_DIFF=1
fi
if [ $BAD_DIFF -ne 0 ] && [ -z "${IGNORE_DEPS_CHANGES:-}" ]; then
echo
echo "ERROR: Shared library dependencies changed!"
echo "If this is intentional, please update:"
echo "chrome/installer/linux/rpm/expected_deps_x86_64"
echo
exit $BAD_DIFF
fi
# lsb implies many dependencies and on Fedora or RHEL some of these are not
# needed at all (the most obvious one is qt3) and Chrome is usually the one
# who pulls them to the system by requiring the whole lsb. Require only
# lsb_release from the lsb as that's the only thing that we are using.
#
# nss (bundled) is optional in LSB 4.0. Also specify a more recent version
# for security and stability updates. While we depend on libnss3.so and not
# libssl3.so, force the dependency on libssl3 to ensure the NSS version is
# 3.28 or later, since libssl3 should always be packaged with libnss3.
#
# wget is for uploading crash reports with Breakpad.
#
# xdg-utils is still optional in LSB 4.0.
#
# zlib may not need to be there. It should be included with LSB.
# TODO(thestig): Figure out why there is an entry for zlib.
#
# We want to depend on the system SSL certs so wget can upload crash reports
# securely, but there's no common capability between the distros. Bugs filed:
# https://qa.mandriva.com/show_bug.cgi?id=55714
# https://bugzilla.redhat.com/show_bug.cgi?id=538158
# https://bugzilla.novell.com/show_bug.cgi?id=556248
#
# We want to depend on liberation-fonts as well, but there is no such package
# for Fedora. https://bugzilla.redhat.com/show_bug.cgi?id=1252564
# TODO(thestig): Use the liberation-fonts package once its available on all
# supported distros.
DEPENDS="/usr/bin/lsb_release, \
libnss3.so(NSS_3.22)${PKG_ARCH}, \
libssl3.so(NSS_3.28)${PKG_ARCH}, \
wget, \
xdg-utils, \
zlib, \
$(echo "${DETECTED_DEPENDS}" | tr '\n' ',')"
gen_spec
# Create temporary rpmbuild dirs.
......
......@@ -29,18 +29,16 @@ if exit_code != 0:
print 'stderr was ' + stderr
sys.exit(1)
requires = set([] if stdout == '' else stdout.rstrip('\n').split('\n'))
requires = [] if stdout == '' else stdout.rstrip('\n').split('\n')
script_dir = os.path.dirname(os.path.abspath(__file__))
provides_file = open(os.path.join(script_dir, 'dist-package-provides.json'))
distro_package_provides = json.load(provides_file)
remove_requires = set()
ret_code = 0
for distro in distro_package_provides:
for requirement in requires:
if any([requirement.startswith(shlib) for shlib in bundled_shlibs]):
remove_requires.add(requirement)
continue
if requirement not in distro_package_provides[distro]:
print >> sys.stderr, (
......@@ -49,8 +47,6 @@ for distro in distro_package_provides:
ret_code = 1
continue
if ret_code == 0:
requires = requires.difference(remove_requires)
with open(dep_filename, 'w') as dep_file:
for requirement in sorted(list(requires)):
dep_file.write(requirement + '\n')
dep_file.write(stdout)
sys.exit(ret_code)
ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)
libX11-xcb.so.1()(64bit)
libX11.so.6()(64bit)
libXcomposite.so.1()(64bit)
libXcursor.so.1()(64bit)
libXdamage.so.1()(64bit)
libXext.so.6()(64bit)
libXfixes.so.3()(64bit)
libXi.so.6()(64bit)
libXrandr.so.2()(64bit)
libXrender.so.1()(64bit)
libXss.so.1()(64bit)
libXtst.so.6()(64bit)
libasound.so.2()(64bit)
libatk-1.0.so.0()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.11)(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.15)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.2)(64bit)
libc.so.6(GLIBC_2.3.3)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_2.6)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
libc.so.6(GLIBC_2.9)(64bit)
libcairo.so.2()(64bit)
libcups.so.2()(64bit)
libdbus-1.so.3()(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libexpat.so.1()(64bit)
libfontconfig.so.1()(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libgconf-2.so.4()(64bit)
libgdk-3.so.0()(64bit)
libgdk_pixbuf-2.0.so.0()(64bit)
libgio-2.0.so.0()(64bit)
libglib-2.0.so.0()(64bit)
libgmodule-2.0.so.0()(64bit)
libgobject-2.0.so.0()(64bit)
libgtk-3.so.0()(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libnspr4.so()(64bit)
libnss3.so()(64bit)
libnssutil3.so()(64bit)
libpango-1.0.so.0()(64bit)
libpangocairo-1.0.so.0()(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libpthread.so.0(GLIBC_2.3.3)(64bit)
librt.so.1()(64bit)
librt.so.1(GLIBC_2.2.5)(64bit)
libsmime3.so()(64bit)
libxcb.so.1()(64bit)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment