Skip to content

Commit b75feed

Browse files
okunzcopybara-github
authored andcommitted
Update includes and build files for hello_sapi example.
PiperOrigin-RevId: 735780577 Change-Id: I31228f2d7b25ef36afe86ec8c61cf9003738dcc0
1 parent b9b7388 commit b75feed

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

sandboxed_api/examples/hello_sapi/BUILD

+13-7
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load(
16-
"@com_google_sandboxed_api//sandboxed_api/bazel:sapi.bzl",
17-
"sapi_library",
15+
load("//third_party/sandboxed_api/bazel:sapi.bzl", "sapi_library")
16+
17+
package(
18+
default_applicable_licenses = ["//third_party/sandboxed_api:license"],
19+
default_visibility = ["//third_party/sandboxed_api:__subpackages__"],
1820
)
1921

22+
licenses(["notice"])
23+
2024
# Library with code that should be sandboxed
2125
cc_library(
2226
name = "hello_lib",
@@ -30,7 +34,7 @@ sapi_library(
3034
functions = [
3135
"AddTwoIntegers",
3236
],
33-
generator_version = 1,
37+
generator_version = 2,
3438
input_files = ["hello_lib.cc"],
3539
lib = ":hello_lib",
3640
lib_name = "Hello",
@@ -52,8 +56,10 @@ cc_binary(
5256
srcs = ["hello_transacted.cc"],
5357
deps = [
5458
":hello_sapi",
55-
"@com_google_absl//absl/memory",
56-
"@com_google_absl//absl/status",
57-
"@com_google_sandboxed_api//sandboxed_api/util:status",
59+
"//third_party/absl/status",
60+
"//third_party/sandboxed_api:sapi",
61+
"//third_party/sandboxed_api/sandbox2:policy",
62+
"//third_party/sandboxed_api/sandbox2:policybuilder",
63+
"//third_party/sandboxed_api/util:status",
5864
],
5965
)

sandboxed_api/examples/hello_sapi/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,8 @@ target_link_libraries(hello_transacted PRIVATE
7979
hello::base
8080
hello::sapi
8181
sapi::sapi
82+
sandbox2::policy
83+
sandbox2::policybuilder
84+
sandbox2::util
85+
absl::status
8286
)

sandboxed_api/examples/hello_sapi/hello_main.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <iostream>
2424

2525
// Generated header
26-
#include "hello_sapi.sapi.h" // NOLINT(build/include)
26+
#include "third_party/sandboxed_api/examples/hello_sapi/hello_sapi.sapi.h"
2727

2828
int main() {
2929
std::cout << "Calling into a sandboxee to add two numbers...\n";

sandboxed_api/examples/hello_sapi/hello_transacted.cc

+7-8
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
#include <iostream>
2020
#include <memory>
2121

22-
#include "absl/memory/memory.h"
23-
#include "absl/status/status.h"
24-
22+
#include "third_party/absl/status/status.h"
2523
// Generated header
26-
#include "hello_sapi.sapi.h" // NOLINT(build/include)
27-
#include "sandboxed_api/sandbox2/policy.h"
28-
#include "sandboxed_api/sandbox2/policybuilder.h"
29-
#include "sandboxed_api/transaction.h"
30-
#include "sandboxed_api/util/status_macros.h"
24+
#include "third_party/sandboxed_api/examples/hello_sapi/hello_sapi.sapi.h"
25+
#include "third_party/sandboxed_api/sandbox.h"
26+
#include "third_party/sandboxed_api/sandbox2/policy.h"
27+
#include "third_party/sandboxed_api/sandbox2/policybuilder.h"
28+
#include "third_party/sandboxed_api/transaction.h"
29+
#include "third_party/sandboxed_api/util/status_macros.h"
3130

3231
namespace {
3332

0 commit comments

Comments
 (0)