[op] Fix //debian:debian.

Co-authored-by: Andrei Vagin <avagin@google.com>
PiperOrigin-RevId: 390232925
This commit is contained in:
Ayush Ranjan
2021-08-11 15:28:51 -07:00
committed by gVisor bot
co-authored by Andrei Vagin
parent 14d6cb4436
commit c2353e4055
5 changed files with 22 additions and 6 deletions
+1 -1
View File
@@ -444,7 +444,7 @@ $(RELEASE_ARTIFACTS)/%:
@mkdir -p $@
@$(call copy,//runsc:runsc,$@)
@$(call copy,//shim:containerd-shim-runsc-v1,$@)
@$(call copy,//debian:debian,$@)
@$(call deb_copy,//debian:debian,$@)
release: $(RELEASE_KEY) $(RELEASE_ARTIFACTS)/$(ARCH)
@mkdir -p $(RELEASE_ROOT)
+2 -2
View File
@@ -1245,8 +1245,8 @@ rbe_autoconfig(name = "rbe_default")
http_archive(
name = "rules_pkg",
sha256 = "6b5969a7acd7b60c02f816773b06fcf32fbe8ba0c7919ccdc2df4f8fb923804a",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.3.0/rules_pkg-0.3.0.tar.gz",
sha256 = "353b20e8b093d42dd16889c7f918750fb8701c485ac6cceb69a5236500507c27",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.5.0/rules_pkg-0.5.0.tar.gz",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
+1 -2
View File
@@ -28,12 +28,10 @@ pkg_deb(
amd64 = "amd64",
arm64 = "arm64",
),
changes = "runsc.changes",
conffiles = [
"/etc/containerd/runsc.toml",
],
data = ":debian-data",
deb = "runsc.deb",
# Note that the description_file will be flatten (all newlines removed),
# and therefore it is kept to a simple one-line description. The expected
# format for debian packages is "short summary\nLonger explanation of
@@ -42,6 +40,7 @@ pkg_deb(
homepage = "https://gvisor.dev/",
maintainer = "The gVisor Authors <gvisor-dev@googlegroups.com>",
package = "runsc",
package_file_name = "runsc.deb",
postinst = "postinst.sh",
version_file = version,
visibility = [
+9
View File
@@ -0,0 +1,9 @@
"""Formatter to extract the output files from pkg_deb."""
def format(target):
provider_map = providers(target)
return "\n".join([
provider_map["OutputGroupInfo"].out.to_list()[0].path,
provider_map["OutputGroupInfo"].deb.to_list()[0].path,
provider_map["OutputGroupInfo"].changes.to_list()[0].path,
])
+9 -1
View File
@@ -84,7 +84,7 @@ DOCKER_RUN_OPTIONS += -v "$(shell readlink -m $(GCLOUD_CONFIG)):$(GCLOUD_CONFIG)
DOCKER_RUN_OPTIONS += -v "/tmp:/tmp"
DOCKER_EXEC_OPTIONS := --user $(UID):$(GID)
DOCKER_EXEC_OPTIONS += --interactive
ifeq (true,$(shell test -t 0 && echo true))
ifeq (true,$(shell test -t 1 && echo true))
DOCKER_EXEC_OPTIONS += --tty
endif
@@ -199,9 +199,17 @@ build_paths = \
| xargs -r -n 1 -I {} readlink -f "{}" \
| xargs -r -n 1 -I {} bash -c 'set -xeuo pipefail; $(2)')
debian_paths = \
(set -euo pipefail; \
$(call wrapper,$(BAZEL) build $(BASE_OPTIONS) $(BAZEL_OPTIONS) $(1)) && \
$(call wrapper,$(BAZEL) cquery $(BASE_OPTIONS) $(BAZEL_OPTIONS) $(1) --output=starlark --starlark:file=debian/show_paths.bzl) \
| xargs -r -n 1 -I {} readlink -f "{}" \
| xargs -r -n 1 -I {} bash -c 'set -xeuo pipefail; $(2)')
clean = $(call header,CLEAN) && $(call wrapper,$(BAZEL) clean)
build = $(call header,BUILD $(1)) && $(call build_paths,$(1),echo {})
copy = $(call header,COPY $(1) $(2)) && $(call build_paths,$(1),cp -fa {} $(2))
deb_copy = $(call header,COPY $(1) $(2)) && $(call debian_paths,$(1),cp -fa {} $(2))
run = $(call header,RUN $(1) $(2)) && $(call build_paths,$(1),{} $(2))
sudo = $(call header,SUDO $(1) $(2)) && $(call build_paths,$(1),sudo -E {} $(2))
test = $(call header,TEST $(1)) && $(call wrapper,$(BAZEL) test $(TEST_OPTIONS) $(1))