From 552a1c7bb19da3cbce18f98da6bb8286a366d7e1 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 15 Dec 2020 19:40:59 +0900 Subject: [PATCH] remove "apparmor" build tag (Always compile AppArmor support) The apparmor tag was introduced in a01ed80 (2014) to make cgo dependency on libapparmor optional. However, the cgo dependency was removed in db093f6 (2017), so it is no longer meaningful to keep apparmor build tag. Close #2704 Signed-off-by: Akihiro Suda --- Makefile | 2 +- README.md | 5 +++-- libcontainer/apparmor/{apparmor.go => apparmor_linux.go} | 2 -- .../{apparmor_disabled.go => apparmor_unsupported.go} | 2 +- script/release.sh | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) rename libcontainer/apparmor/{apparmor.go => apparmor_linux.go} (98%) rename libcontainer/apparmor/{apparmor_disabled.go => apparmor_unsupported.go} (91%) diff --git a/Makefile b/Makefile index 7576261f3..92839234c 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g") RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN)) PROJECT := github.com/opencontainers/runc -BUILDTAGS ?= seccomp selinux apparmor +BUILDTAGS ?= seccomp selinux COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true) COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),"$(COMMIT_NO)-dirty","$(COMMIT_NO)") VERSION := $(shell cat ./VERSION) diff --git a/README.md b/README.md index ec37e9ead..0f84f1de0 100644 --- a/README.md +++ b/README.md @@ -63,16 +63,17 @@ To change build tags from the default, set the `BUILDTAGS` variable for make, e.g. ```bash -make BUILDTAGS='seccomp apparmor' +make BUILDTAGS='seccomp' ``` | Build Tag | Feature | Enabled by default | Dependency | |-----------|------------------------------------|--------------------|------------| | seccomp | Syscall filtering | yes | libseccomp | | selinux | selinux process and mount labeling | yes | | -| apparmor | apparmor profile support | yes | | | nokmem | disable kernel memory accounting | no | | +The following build tags were used earlier, but are now obsoleted: + - **apparmor** (since runc v1.0.0-rc93 the feature is always enabled) ### Running the test suite diff --git a/libcontainer/apparmor/apparmor.go b/libcontainer/apparmor/apparmor_linux.go similarity index 98% rename from libcontainer/apparmor/apparmor.go rename to libcontainer/apparmor/apparmor_linux.go index 7ae9cf802..73965f12d 100644 --- a/libcontainer/apparmor/apparmor.go +++ b/libcontainer/apparmor/apparmor_linux.go @@ -1,5 +1,3 @@ -// +build apparmor,linux - package apparmor import ( diff --git a/libcontainer/apparmor/apparmor_disabled.go b/libcontainer/apparmor/apparmor_unsupported.go similarity index 91% rename from libcontainer/apparmor/apparmor_disabled.go rename to libcontainer/apparmor/apparmor_unsupported.go index d4110cf0b..0bc473f81 100644 --- a/libcontainer/apparmor/apparmor_disabled.go +++ b/libcontainer/apparmor/apparmor_unsupported.go @@ -1,4 +1,4 @@ -// +build !apparmor !linux +// +build !linux package apparmor diff --git a/script/release.sh b/script/release.sh index 17dd577b8..407051360 100755 --- a/script/release.sh +++ b/script/release.sh @@ -27,7 +27,7 @@ function build_project() { builddir="$(dirname "$1")" # Build with all tags enabled. - make -C "$root" COMMIT_NO= BUILDTAGS="seccomp selinux apparmor" static + make -C "$root" COMMIT_NO= BUILDTAGS="seccomp selinux" static mv "$root/$project" "$1" }