Skip to content

Commit

Permalink
CI: Run annocheck for libruby.so
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
junaruga and voxik committed Aug 7, 2024
1 parent 60bbd9e commit 41bbbfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions tool/annocheck/Dockerfile-copy
Original file line number Diff line number Diff line change
@@ -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
9 changes: 8 additions & 1 deletion tool/test-annocheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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-} "${@}"

0 comments on commit 41bbbfd

Please sign in to comment.