Commit 8def47b9 authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

Revert "Reland "Fuchsia: remove "shell" capability and add dynamic libraries to packages.""

This reverts commit 54c93b85.

Reason for revert: Multiple nontrivial failures in FYI https://ci.chromium.org/buildbot/chromium.fyi/Fuchsia/16409

Original change's description:
> Reland "Fuchsia: remove "shell" capability and add dynamic libraries to packages."
> 
> Removing the "shell" capability allows packaged apps to load dynamic libraries
> from the package. In addition, it prevents the app from using any
> system-provided libraries, in favor of the package supplying all of its
> data and dynamic library dependencies.
> 
> This CL includes the system libraries from the SDK's "dist" directory in
> packages built using the package() GN template.
> 
> 
> Bug: 823927
> Change-Id: Ibc22913658f73d992e563e829a377be66f61f805
> Reviewed-on: https://chromium-review.googlesource.com/1025046
> Reviewed-by: Scott Graham <scottmg@chromium.org>
> Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#552950}

TBR=kmarshall@chromium.org,scottmg@chromium.org

Change-Id: I1b0b9517c878d1c4483efbba3e46502d875b194f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 823927
Reviewed-on: https://chromium-review.googlesource.com/1026811Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553305}
parent 2dc6d046
......@@ -74,10 +74,8 @@ def _GetStrippedPath(bin_path):
"""Finds the stripped version of the binary |bin_path| in the build
output directory."""
# Skip the resolution step for binaries that don't have stripped counterparts,
# like system libraries or other libraries built outside the Chromium build.
if not '.unstripped' in bin_path:
return bin_path
raise Exception('File "%s" is not in an .unstripped directory.' % bin_path)
return os.path.normpath(os.path.join(bin_path,
os.path.pardir,
......@@ -106,21 +104,20 @@ def BuildManifest(root_dir, out_dir, app_name, app_filename,
next_path = next_path.strip()
if os.path.isdir(next_path):
for root, _, files in os.walk(next_path):
for current_file in files:
if current_file.startswith('.'):
for next_file in files:
if next_file.startswith('.'):
continue
expanded_files.add(os.path.abspath(
os.path.join(root, current_file)))
expanded_files.add(os.path.abspath(os.path.join(root, next_file)))
else:
expanded_files.add(os.path.abspath(next_path))
# Format and write out the manifest contents.
app_found = False
for current_file in expanded_files:
if _IsBinary(current_file):
current_file = _GetStrippedPath(current_file)
for next_file in expanded_files:
if _IsBinary(next_file):
next_file = _GetStrippedPath(next_file)
in_package_path = MakePackagePath(os.path.join(out_dir, current_file),
in_package_path = MakePackagePath(os.path.join(out_dir, next_file),
[root_dir, out_dir])
if in_package_path == app_filename:
in_package_path = 'bin/app'
......@@ -130,14 +127,7 @@ def BuildManifest(root_dir, out_dir, app_name, app_filename,
# environments with differing parent directory structures,
# e.g. builder bots and swarming clients.
output.write('%s=%s\n' % (in_package_path,
os.path.relpath(current_file, out_dir)))
# Use libc.so's dynamic linker by aliasing libc.so to ld.so.1.
# Fuchsia always looks for the linker implementation in ld.so.1.
if os.path.basename(in_package_path) == 'libc.so':
output.write('%s=%s\n' % (os.path.dirname(in_package_path) + '/ld.so.1',
os.path.relpath(current_file, out_dir)))
os.path.relpath(next_file, out_dir)))
if not app_found:
raise Exception('Could not locate executable inside runtime_deps.')
......
......@@ -8,12 +8,3 @@ declare_args() {
# Path to Fuchsia SDK.
fuchsia_sdk = "//third_party/fuchsia-sdk/sdk"
}
# Compute the arch-specific path to packages' dynamic library dependencies.
if (current_cpu == "arm64") {
dist_libroot = fuchsia_sdk + "/arch/arm64/dist"
} else if (current_cpu == "x64") {
dist_libroot = fuchsia_sdk + "/arch/x64/dist"
} else {
dist_libroot = ""
}
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//build/config/fuchsia/config.gni")
import("//build/config/sysroot.gni")
# Creates a Fuchsia .far package file.
#
......@@ -35,7 +34,7 @@ template("package") {
_bundle_target = "${pkg.package_name}__bundle"
# Generates a manifest file based on the GN runtime deps
# suitable for "pm" tool consumption.
# suitable for "far" tool consumption.
action(_write_manifest_target) {
forward_variables_from(invoker,
[
......@@ -48,7 +47,6 @@ template("package") {
inputs = [
_runtime_deps_file,
"//build/config/fuchsia/sandbox_policy",
]
outputs = [
......@@ -57,11 +55,6 @@ template("package") {
data_deps = pkg.deps
# Include the SDK's core dynamic libraries in the package.
data = [
dist_libroot,
]
args = [
rebase_path("//"),
rebase_path(root_out_dir),
......
{
"features": [ "persistent-storage", "system-temp" ]
"features": [ "persistent-storage",
"shell",
"system-temp" ]
}
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