summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIan Lewis <ianlewis@google.com>2020-01-30 23:32:12 -0500
committerIan Lewis <ianlewis@google.com>2020-03-11 09:21:05 +0900
commit5f723ac601e8ea6eb3216f60fce49b771ef87e0a (patch)
tree01c3c122be9f39bbf554b0e842398f3cce5ae3f8
parent6eb4ea30088a19428d6dfde965985e844b7a9a2a (diff)
Fix corrupted bazel install errors.
Previously /tmp/gvisor-website was used for the bazel output_user_root but the host could delete a subset of the files under /tmp causing it to become corrupted. This commit updates the Makefile to use the bazel_user_root directory under the repository root directory for caching bazel packages.
-rw-r--r--.gitignore1
-rw-r--r--Makefile25
2 files changed, 14 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index ec372978f..dd1346c01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
bin/
+bazel_user_root/
public/
resources/
node_modules/
diff --git a/Makefile b/Makefile
index 9abdcfc3e..6b0cc0968 100644
--- a/Makefile
+++ b/Makefile
@@ -83,26 +83,24 @@ node_modules: package.json package-lock.json
--entrypoint 'npm' \
node ci
-upstream/gvisor/bazel-bin/runsc/linux_amd64_pure_stripped/runsc: upstream-gvisor
- mkdir -p /tmp/gvisor-website/build_output
+bin/generate-syscall-docs: $(GEN_SOURCE)
+ mkdir -p bin/
+ go build -o bin/generate-syscall-docs gvisor.dev/website/cmd/generate-syscall-docs
+
+compatibility-docs: bin/generate-syscall-docs
+ # bazel_user_root is used for caching bazel packages.
+ mkdir -p bazel_user_root/
docker run \
--rm \
-v $(PWD)/upstream/gvisor:/workspace \
- -v /tmp/gvisor-website/build_output:/tmp/gvisor-website/build_output \
+ -v $(PWD)/bazel_user_root:/bazel_user_root \
-w /workspace \
--entrypoint 'sh' \
l.gcr.io/google/bazel \
-c '\
groupadd --gid $(shell id -g) $(shell id -gn) && \
useradd --uid $(shell id -u) --gid $(shell id -g) -ms /bin/bash $(USER) && \
- su $(USER) -c "bazel --output_user_root=/tmp/gvisor-website/build_output build //runsc"'
-
-bin/generate-syscall-docs: $(GEN_SOURCE)
- mkdir -p bin/
- go build -o bin/generate-syscall-docs gvisor.dev/website/cmd/generate-syscall-docs
-
-compatibility-docs: bin/generate-syscall-docs upstream/gvisor/bazel-bin/runsc/linux_amd64_pure_stripped/runsc
- ./upstream/gvisor/bazel-bin/runsc/linux_amd64_pure_stripped/runsc help syscalls -o json | ./bin/generate-syscall-docs -out ./content/docs/user_guide/compatibility/
+ su $(USER) -c "bazel --output_user_root=/bazel_user_root run //runsc -- help syscalls -o json"' | ./bin/generate-syscall-docs -out ./content/docs/user_guide/compatibility/
.PHONY: compatibility-docs
check: check-markdown check-html
@@ -173,5 +171,8 @@ htmlproofer-docker-image:
.PHONY: htmlproofer-docker-image
clean:
- rm -rf public/ resources/ node_modules/ upstream/ content/docs/user_guide/compatibility/linux/
+ifneq ("$(wildcard bazel_user_root/)","")
+ chmod -R +w bazel_user_root/
+endif
+ rm -rf bazel_user_root/ public/ resources/ node_modules/ upstream/ content/docs/user_guide/compatibility/linux/
.PHONY: clean