From ab35eb49af76fe6959e8f9d289af2d6b03c6b2eb Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Fri, 12 Jul 2019 04:06:39 -0700 Subject: [PATCH] Make embedding the sandbox code the default PiperOrigin-RevId: 257778382 Change-Id: Ib6dc472355092c08b905e42978efe7f47703c128 --- sandboxed_api/bazel/sapi.bzl | 2 +- sandboxed_api/docs/library.md | 4 ++-- sandboxed_api/examples/stringop/lib/BUILD.bazel | 1 - sandboxed_api/examples/sum/lib/BUILD.bazel | 1 - sandboxed_api/examples/zlib/BUILD.bazel | 1 - sandboxed_api/tools/generator2/BUILD | 1 - 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sandboxed_api/bazel/sapi.bzl b/sandboxed_api/bazel/sapi.bzl index b74f201..bfc59df 100644 --- a/sandboxed_api/bazel/sapi.bzl +++ b/sandboxed_api/bazel/sapi.bzl @@ -145,7 +145,7 @@ def sapi_library( lib, lib_name, namespace = "", - embed = False, + embed = True, add_default_deps = True, srcs = [], hdrs = [], diff --git a/sandboxed_api/docs/library.md b/sandboxed_api/docs/library.md index 5d27a08..5f81f04 100644 --- a/sandboxed_api/docs/library.md +++ b/sandboxed_api/docs/library.md @@ -23,7 +23,7 @@ sapi_library( srcs = [], # Extra code compiled with the SAPI library hdrs = [] # Leave empty if embedded SAPI libraries are used, and the # default sandbox policy is sufficient. - embed = True, + embed = True, # This is the default functions = [ "deflateInit_", "deflate", @@ -48,7 +48,7 @@ sapi_library( in the library. * **`embed`** - whether the SAPI library should be embedded inside host code, so the SAPI Sandbox can be initialized with the - `::sapi::Sandbox::Sandbox(FileToc*)` constructor. + `::sapi::Sandbox::Sandbox(FileToc*)` constructor. This is the default. * **`lib`** - (mandatory) the library target you want to sandbox and expose to the host code. * **`lib_name`** - (mandatory) name of the object which is proxying your library diff --git a/sandboxed_api/examples/stringop/lib/BUILD.bazel b/sandboxed_api/examples/stringop/lib/BUILD.bazel index 31a95d5..b4bbc22 100644 --- a/sandboxed_api/examples/stringop/lib/BUILD.bazel +++ b/sandboxed_api/examples/stringop/lib/BUILD.bazel @@ -40,7 +40,6 @@ sapi_library( name = "stringop-sapi", srcs = [], hdrs = ["sandbox.h"], - embed = True, functions = [ "duplicate_string", "reverse_string", diff --git a/sandboxed_api/examples/sum/lib/BUILD.bazel b/sandboxed_api/examples/sum/lib/BUILD.bazel index b805434..fea8406 100644 --- a/sandboxed_api/examples/sum/lib/BUILD.bazel +++ b/sandboxed_api/examples/sum/lib/BUILD.bazel @@ -44,7 +44,6 @@ sapi_library( name = "sum-sapi", srcs = [], hdrs = ["sandbox.h"], - embed = True, functions = [ "sum", "sums", diff --git a/sandboxed_api/examples/zlib/BUILD.bazel b/sandboxed_api/examples/zlib/BUILD.bazel index 22c8f11..4d018e9 100644 --- a/sandboxed_api/examples/zlib/BUILD.bazel +++ b/sandboxed_api/examples/zlib/BUILD.bazel @@ -23,7 +23,6 @@ sapi_library( name = "zlib-sapi", srcs = [], hdrs = [], - embed = True, functions = [ "deflateInit_", "deflate", diff --git a/sandboxed_api/tools/generator2/BUILD b/sandboxed_api/tools/generator2/BUILD index dde3466..c26e29a 100644 --- a/sandboxed_api/tools/generator2/BUILD +++ b/sandboxed_api/tools/generator2/BUILD @@ -60,7 +60,6 @@ cc_library( # Targets for testing if generated code compiles sapi_library( name = "tests_sapi_generator", - embed = True, input_files = [ "testdata/tests.cc", "testdata/tests2.cc",