From aed468ae0bb38ec364c0e6f0d5bfbc314d1aea0a Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 7 Aug 2024 14:24:21 +0200 Subject: [PATCH] CI: Run annocheck for libruby.so MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with the `--shared` option, most functionality is kept in `libruby.so`. Therefore also run annocheck for `libruby.so`. Use `ARG IN_DIR` to propagate multiple files into the container instead of `ARG FILES` in the `Dockerfile-copy`. Because the `COPY` syntax in Dockerfile doesn't support copying the multiple files. https://stackoverflow.com/questions/61599384/specify-multiple-files-in-arg-to-copy-in-dockerfile Co-authored-by: Vít Ondruch --- common.mk | 4 ++-- tool/annocheck/Dockerfile-copy | 5 ++--- tool/test-annocheck.sh | 9 ++++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common.mk b/common.mk index a0c41e04e0..0a88bd249c 100644 --- a/common.mk +++ b/common.mk @@ -1666,8 +1666,8 @@ no-test-bundler-parallel: # The annocheck supports ELF format binaries compiled for any OS and for any # architecture. It is designed to be independent of the host OS and the # architecture. The test-annocheck.sh requires docker or podman. -test-annocheck: $(PROGRAM) - $(tooldir)/test-annocheck.sh $(PROGRAM) +test-annocheck: $(PROGRAM) $(LIBRUBY_SO) + $(tooldir)/test-annocheck.sh $(PROGRAM) $(LIBRUBY_SO) GEM = up sync-default-gems: diff --git a/tool/annocheck/Dockerfile-copy b/tool/annocheck/Dockerfile-copy index e658d12ddc..0a79f3a50a 100644 --- a/tool/annocheck/Dockerfile-copy +++ b/tool/annocheck/Dockerfile-copy @@ -1,7 +1,6 @@ FROM docker.io/fedora:latest -ARG FILES +ARG IN_DIR RUN dnf -y install annobin-annocheck -RUN mkdir /work -COPY ${FILES} /work +COPY ${IN_DIR} /work WORKDIR /work diff --git a/tool/test-annocheck.sh b/tool/test-annocheck.sh index 0224152d00..92b3c9adae 100755 --- a/tool/test-annocheck.sh +++ b/tool/test-annocheck.sh @@ -15,6 +15,7 @@ set -x DOCKER="$(command -v docker || command -v podman)" TAG=ruby-fedora-annocheck TOOL_DIR=$(dirname "${0}") +TMP_DIR="tmp/annocheck" DOCKER_RUN_VOLUME_OPTS= if [ -z "${CI-}" ]; then @@ -27,7 +28,13 @@ else # volume in container in container on GitHub Actions # <.github/workflows/compilers.yml>. TAG="${TAG}-copy" - "${DOCKER}" build --rm -t "${TAG}" --build-arg=FILES="${*}" -f ${TOOL_DIR}/annocheck/Dockerfile-copy . + rm -rf "${TMP_DIR}" + mkdir -p "${TMP_DIR}" + for file in "${@}"; do + cp -p "${file}" "${TMP_DIR}" + done + "${DOCKER}" build --rm -t "${TAG}" --build-arg=IN_DIR="${TMP_DIR}" -f ${TOOL_DIR}/annocheck/Dockerfile-copy . + rm -rf "${TMP_DIR}" fi "${DOCKER}" run --rm -t ${DOCKER_RUN_VOLUME_OPTS} "${TAG}" annocheck --verbose ${TEST_ANNOCHECK_OPTS-} "${@}"