Skip to content

Commit bf87da8

Browse files
authored
Merge branch 'master' into pr_lazy_fpsimd_2
2 parents 89957c6 + ddfc723 commit bf87da8

File tree

708 files changed

+35684
-7831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

708 files changed

+35684
-7831
lines changed

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: minimal
2+
sudo: required
3+
dist: xenial
4+
cache:
5+
directories:
6+
- /home/travis/.cache/bazel/
7+
services:
8+
- docker
9+
matrix:
10+
include:
11+
- os: linux
12+
arch: amd64
13+
env: RUNSC_PATH=./bazel-bin/runsc/linux_amd64_pure_stripped/runsc
14+
- os: linux
15+
arch: arm64
16+
env: RUNSC_PATH=./bazel-bin/runsc/linux_arm64_pure_stripped/runsc
17+
script:
18+
- uname -a
19+
- make DOCKER_RUN_OPTIONS="" BAZEL_OPTIONS="build runsc:runsc" bazel && $RUNSC_PATH --alsologtostderr --network none --debug --TESTONLY-unsafe-nonroot=true --rootless do ls

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ will need to be added to the appropriate `BUILD` files, and the `:gopath` target
3232
will need to be re-run to generate appropriate symlinks in the `GOPATH`
3333
directory tree.
3434

35+
Dependencies can be added by using `go mod get`. In order to keep the
36+
`WORKSPACE` file in sync, run `tools/go_mod.sh` in place of `go mod`.
37+
3538
### Coding Guidelines
3639

3740
All Go code should conform to the [Go style guidelines][gostyle]. C++ code
@@ -47,7 +50,7 @@ Definitions for the rules below:
4750
`core`:
4851

4952
* `//pkg/sentry/...`
50-
* Transitive dependencies in `//pkg/...`, `//third_party/...`.
53+
* Transitive dependencies in `//pkg/...`, etc.
5154

5255
`runsc`:
5356

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM ubuntu:bionic
1+
FROM fedora:31
22

3-
RUN apt-get update && apt-get install -y curl gnupg2 git python python3 python3-distutils python3-pip
4-
RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \
5-
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
6-
RUN apt-get update && apt-get install -y bazel && apt-get clean
3+
RUN dnf install -y dnf-plugins-core && dnf copr enable -y vbatts/bazel
4+
5+
RUN dnf install -y bazel2 git gcc make golang gcc-c++ glibc-devel python3 which python3-pip python3-devel libffi-devel openssl-devel pkg-config glibc-static
6+
7+
RUN pip install pycparser
78

89
WORKDIR /gvisor

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ UID := $(shell id -u ${USER})
22
GID := $(shell id -g ${USER})
33
GVISOR_BAZEL_CACHE := $(shell readlink -f ~/.cache/bazel/)
44

5+
# The --privileged is required to run tests.
6+
DOCKER_RUN_OPTIONS ?= --privileged
7+
58
all: runsc
69

710
docker-build:
@@ -19,7 +22,7 @@ bazel-server-start: docker-build
1922
-v "$(CURDIR):$(CURDIR)" \
2023
--workdir "$(CURDIR)" \
2124
--tmpfs /tmp:rw,exec \
22-
--privileged \
25+
$(DOCKER_RUN_OPTIONS) \
2326
gvisor-bazel \
2427
sh -c "while :; do sleep 100; done" && \
2528
docker exec --user 0:0 -i gvisor-bazel sh -c "groupadd --gid $(GID) --non-unique gvisor && useradd --uid $(UID) --non-unique --gid $(GID) -d $(HOME) gvisor"

WORKSPACE

Lines changed: 87 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,49 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
44
# Load go bazel rules and gazelle.
55
http_archive(
66
name = "io_bazel_rules_go",
7-
sha256 = "b27e55d2dcc9e6020e17614ae6e0374818a3e3ce6f2024036e688ada24110444",
7+
sha256 = "94f90feaa65c9cdc840cd21f67d967870b5943d684966a47569da8073e42063d",
88
urls = [
9-
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.21.0/rules_go-v0.21.0.tar.gz",
10-
"https://github.com/bazelbuild/rules_go/releases/download/v0.21.0/rules_go-v0.21.0.tar.gz",
9+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.22.0/rules_go-v0.22.0.tar.gz",
10+
"https://github.com/bazelbuild/rules_go/releases/download/v0.22.0/rules_go-v0.22.0.tar.gz",
1111
],
1212
)
1313

1414
http_archive(
1515
name = "bazel_gazelle",
16-
sha256 = "86c6d481b3f7aedc1d60c1c211c6f76da282ae197c3b3160f54bd3a8f847896f",
16+
sha256 = "d8c45ee70ec39a57e7a05e5027c32b1576cc7f16d9dd37135b0eddde45cf1b10",
1717
urls = [
18-
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.1/bazel-gazelle-v0.19.1.tar.gz",
19-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.1/bazel-gazelle-v0.19.1.tar.gz",
18+
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
19+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
2020
],
2121
)
2222

23-
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
23+
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
2424

2525
go_rules_dependencies()
2626

2727
go_register_toolchains(
28-
go_version = "1.13.6",
28+
go_version = "1.14",
2929
nogo = "@//:nogo",
3030
)
3131

3232
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
3333

3434
gazelle_dependencies()
3535

36+
# TODO(gvisor.dev/issue/1876): Move the statement to "External repositories"
37+
# block below once 1876 is fixed.
38+
#
39+
# The com_google_protobuf repository below would trigger downloading a older
40+
# version of org_golang_x_sys. If putting this repository statment in a place
41+
# after that of the com_google_protobuf, this statement will not work as
42+
# expectd to download a new version of org_golang_x_sys.
43+
go_repository(
44+
name = "org_golang_x_sys",
45+
importpath = "golang.org/x/sys",
46+
sum = "h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=",
47+
version = "v0.0.0-20200302150141-5c8b2ff67527",
48+
)
49+
3650
# Load C++ rules.
3751
http_archive(
3852
name = "rules_cc",
@@ -54,16 +68,19 @@ http_archive(
5468
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
5569
],
5670
)
71+
5772
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
73+
5874
rules_proto_dependencies()
75+
5976
rules_proto_toolchains()
6077

6178
# Load python dependencies.
6279
git_repository(
6380
name = "rules_python",
64-
commit = "94677401bc56ed5d756f50b441a6a5c7f735a6d4",
81+
commit = "abc4869e02fe9b3866942e89f07b7341f830e805",
6582
remote = "https://github.com/bazelbuild/rules_python.git",
66-
shallow_since = "1573842889 -0500",
83+
shallow_since = "1583341286 -0500",
6784
)
6885

6986
load("@rules_python//python:pip.bzl", "pip_import")
@@ -82,11 +99,11 @@ pip_install()
8299
# See releases at https://releases.bazel.build/bazel-toolchains.html
83100
http_archive(
84101
name = "bazel_toolchains",
85-
sha256 = "a653c9d318e42b14c0ccd7ac50c4a2a276c0db1e39743ab88b5aa2f0bc9cf607",
86-
strip_prefix = "bazel-toolchains-2.0.2",
102+
sha256 = "b5a8039df7119d618402472f3adff8a1bd0ae9d5e253f53fcc4c47122e91a3d2",
103+
strip_prefix = "bazel-toolchains-2.1.1",
87104
urls = [
88-
"https://github.com/bazelbuild/bazel-toolchains/releases/download/2.0.2/bazel-toolchains-2.0.2.tar.gz",
89-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/2.0.2.tar.gz",
105+
"https://github.com/bazelbuild/bazel-toolchains/releases/download/2.1.1/bazel-toolchains-2.1.1.tar.gz",
106+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/2.1.1.tar.gz",
90107
],
91108
)
92109

@@ -132,9 +149,9 @@ load(
132149
# This container is built from the Dockerfile in test/iptables/runner.
133150
container_pull(
134151
name = "iptables-test",
152+
digest = "sha256:a137d692a2eb9fc7bf95c5f4a568da090e2c31098e93634421ed88f3a3f1db65",
135153
registry = "gcr.io",
136154
repository = "gvisor-presubmit/iptables-test",
137-
digest = "sha256:a137d692a2eb9fc7bf95c5f4a568da090e2c31098e93634421ed88f3a3f1db65",
138155
)
139156

140157
load(
@@ -187,13 +204,27 @@ go_repository(
187204
version = "v0.0.0-20171129191014-dec09d789f3d",
188205
)
189206

207+
go_repository(
208+
name = "com_github_kr_pretty",
209+
importpath = "github.com/kr/pretty",
210+
sum = "h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=",
211+
version = "v0.2.0",
212+
)
213+
190214
go_repository(
191215
name = "com_github_kr_pty",
192216
importpath = "github.com/kr/pty",
193217
sum = "h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=",
194218
version = "v1.1.1",
195219
)
196220

221+
go_repository(
222+
name = "com_github_kr_text",
223+
importpath = "github.com/kr/text",
224+
sum = "h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=",
225+
version = "v0.1.0",
226+
)
227+
197228
go_repository(
198229
name = "com_github_opencontainers_runtime-spec",
199230
importpath = "github.com/opencontainers/runtime-spec",
@@ -223,30 +254,31 @@ go_repository(
223254
)
224255

225256
go_repository(
226-
name = "org_golang_x_crypto",
227-
importpath = "golang.org/x/crypto",
228-
sum = "h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=",
229-
version = "v0.0.0-20190308221718-c2843e01d9a2",
257+
name = "in_gopkg_check_v1",
258+
importpath = "gopkg.in/check.v1",
259+
sum = "h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=",
260+
version = "v1.0.0-20190902080502-41f04d3bba15",
230261
)
231262

232263
go_repository(
233-
name = "org_golang_x_net",
234-
importpath = "golang.org/x/net",
235-
sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=",
236-
version = "v0.0.0-20190311183353-d8887717615a",
264+
name = "org_golang_x_crypto",
265+
importpath = "golang.org/x/crypto",
266+
sum = "h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=",
267+
version = "v0.0.0-20191011191535-87dc89f01550",
237268
)
238269

239270
go_repository(
240-
name = "org_golang_x_text",
241-
importpath = "golang.org/x/text",
242-
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
243-
version = "v0.3.0",
271+
name = "org_golang_x_mod",
272+
importpath = "golang.org/x/mod",
273+
sum = "h1:p1YOIz9H/mGN8k1XkaV5VFAq9+zhN9Obefv439UwRhI=",
274+
version = "v0.2.1-0.20200224194123-e5e73c1b9c72",
244275
)
245276

246277
go_repository(
247-
name = "org_golang_x_tools",
248-
commit = "36563e24a262",
249-
importpath = "golang.org/x/tools",
278+
name = "org_golang_x_net",
279+
importpath = "golang.org/x/net",
280+
sum = "h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=",
281+
version = "v0.0.0-20190620200207-3b0461eec859",
250282
)
251283

252284
go_repository(
@@ -257,22 +289,31 @@ go_repository(
257289
)
258290

259291
go_repository(
260-
name = "org_golang_x_sys",
261-
importpath = "golang.org/x/sys",
262-
sum = "h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=",
263-
version = "v0.0.0-20190215142949-d0b11bdaac8a",
292+
name = "org_golang_x_text",
293+
importpath = "golang.org/x/text",
294+
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
295+
version = "v0.3.0",
264296
)
265297

266298
go_repository(
267299
name = "org_golang_x_time",
268-
commit = "c4c64cad1fd0a1a8dab2523e04e61d35308e131e",
269300
importpath = "golang.org/x/time",
301+
sum = "h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=",
302+
version = "v0.0.0-20191024005414-555d28b269f0",
270303
)
271304

272305
go_repository(
273306
name = "org_golang_x_tools",
274-
commit = "aa82965741a9fecd12b026fbb3d3c6ed3231b8f8",
275307
importpath = "golang.org/x/tools",
308+
sum = "h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ=",
309+
version = "v0.0.0-20191119224855-298f0cb1881e",
310+
)
311+
312+
go_repository(
313+
name = "org_golang_x_xerrors",
314+
importpath = "golang.org/x/xerrors",
315+
sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=",
316+
version = "v0.0.0-20191204190536-9bdfabe68543",
276317
)
277318

278319
go_repository(
@@ -330,3 +371,13 @@ http_archive(
330371
"https://github.com/google/googletest/archive/565f1b848215b77c3732bca345fe76a0431d8b34.tar.gz",
331372
],
332373
)
374+
375+
http_archive(
376+
name = "com_google_benchmark",
377+
sha256 = "3c6a165b6ecc948967a1ead710d4a181d7b0fbcaa183ef7ea84604994966221a",
378+
strip_prefix = "benchmark-1.5.0",
379+
urls = [
380+
"https://mirror.bazel.build/github.com/google/benchmark/archive/v1.5.0.tar.gz",
381+
"https://github.com/google/benchmark/archive/v1.5.0.tar.gz",
382+
],
383+
)

benchmarks/BUILD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
package(licenses = ["notice"])
22

3+
config_setting(
4+
name = "gcloud_rule",
5+
values = {
6+
"define": "gcloud=off",
7+
},
8+
)
9+
310
py_binary(
411
name = "benchmarks",
512
srcs = ["run.py"],
13+
data = select({
14+
":gcloud_rule": [],
15+
"//conditions:default": [
16+
"//tools/images:ubuntu1604",
17+
"//tools/images:zone",
18+
],
19+
}),
620
main = "run.py",
721
python_version = "PY3",
822
srcs_version = "PY3",
23+
tags = [
24+
"local",
25+
"manual",
26+
],
927
deps = ["//benchmarks/runner"],
1028
)

0 commit comments

Comments
 (0)