CI: Run annocheck for libruby.so

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 <vondruch@redhat.com>
This commit is contained in:
Jun Aruga 2024-08-07 14:24:21 +02:00 committed by Jun Aruga
parent 584559d86a
commit aed468ae0b
3 changed files with 12 additions and 6 deletions

View File

@ -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:

View File

@ -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

View File

@ -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-} "${@}"