Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Oct 15, 2024
1 parent 7d28303 commit 80c6c66
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 27 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/rtp.io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
workflow_dispatch:

env:
COMPILER: clang-18
COMPILER_OLD: clang-16
LLVM_VER: 18
LLVM_VER_OLD: 16
GHCR_REPO: ghcr.io/${{ github.repository_owner }}/opensips

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
RTPP_BRANCH: DOCKER
RTPPC_TYPE: rtp.io
RTPPROXY_DIST: ../../dist/rtpproxy
COMPILER: clang-${{ env.LLVM_VER }}
run: |
export CC="${COMPILER}"
cd dist/rtpproxy
Expand Down Expand Up @@ -150,7 +151,7 @@ jobs:
run: |
PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
sort -u | grep -v unknown | paste -sd ','`"
sort -u | grep -v unknown | ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
echo "Platforms: ${PLATFORMS}"
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
BUILD_IMAGE="${{ env.GHCR_REPO }}:rtp.io-${GIT_BRANCH}"
Expand All @@ -171,8 +172,8 @@ jobs:
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
BUILD_OS=debian-12
COMPILER=${{ env.COMPILER }}
COMPILER_OLD=${{ env.COMPILER_OLD }}
LLVM_VER=${{ env.LLVM_VER }}
LLVM_VER_OLD=${{ env.LLVM_VER_OLD }}
platforms: ${{ env.PLATFORMS }}
cache-from: ${{ env.CACHE_SPEC }}
cache-to: ${{ env.CACHE_SPEC }},mode=max
Expand Down
2 changes: 1 addition & 1 deletion Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ endif #ARCH, sparc64
#if ipaq/netwinder
ifeq ($(ARCH), arm)
# if gcc
ifeq ($(CC_NAME), gcc)
ifeq ($(CC_NAME:clang=gcc), gcc)
#common stuff
CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \
-Wall -marm
Expand Down
16 changes: 7 additions & 9 deletions docker/Dockerfile.rtp.io
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /src

ARG COMPILER=clang-18
ARG COMPILER_OLD=clang-16
ARG LLVM_VER=18
ARG LLVM_VER_OLD=16
ARG TARGETPLATFORM
ARG BUILD_OS=ubuntu-latest
RUN --mount=type=bind,source=scripts/build,target=scripts/build \
scripts/build/get-arch-buildargs.rtp.io platformopts
RUN --mount=type=bind,source=scripts/build,target=scripts/build \
env `scripts/build/get-arch-buildargs.rtp.io platformopts` \
env `./scripts/build/get-arch-buildargs.rtp.io platformopts` \
sh -x scripts/build/install_depends.sh
RUN apt-get install -y gpp python-is-python3 python3-pip
RUN --mount=type=bind,source=dist/voiptests/requirements.txt,target=requirements.txt \
Expand All @@ -33,15 +31,15 @@ RUN mkdir tmp && cd modules && mv ${KEEP_MODULES} ${SKIP_MODULES} ../tmp && \
rm -rf * && cd ../tmp && mv ${KEEP_MODULES} ${SKIP_MODULES} ../modules && \
cd .. && rmdir tmp
RUN EXCLUDE_MODULES_ADD="${SKIP_MODULES}" \
env `scripts/build/get-arch-buildargs.rtp.io platformopts` \
env `./scripts/build/get-arch-buildargs.rtp.io platformopts` \
sh -x scripts/build/do_build.sh
RUN apt-get install -y libsrtp2-dev lld-18
RUN env ONE_MODULE=rtp.io LDFLAGS="-flto -fuse-ld=lld" CFLAGS=-flto \
env `scripts/build/get-arch-buildargs.rtp.io platformopts` \
env `./scripts/build/get-arch-buildargs.rtp.io platformopts` \
sh -x scripts/build/do_build.sh
ARG CC=${COMPILER}
COPY --exclude=.git --exclude=.github dist/rtpproxy dist/rtpproxy
RUN cd dist/rtpproxy && ./configure
RUN eval `./scripts/build/get-arch-buildargs.rtp.io platformopts` && \
cd dist/rtpproxy && CC="${COMPILER}" ./configure

COPY --exclude=.git --exclude=.github dist/voiptests dist/voiptests

Expand Down
4 changes: 2 additions & 2 deletions scripts/build/do_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ MAKE_CMD="${MAKE_ENV} make"

if [ ! -z "${ONE_MODULE}" ]
then
env CC_EXTRA_OPTS="${CC_EXTRA_OPTS:-"-Werror"}" ${MAKE_CMD} \
env CC_EXTRA_OPTS="${CC_EXTRA_OPTS:-"-Werror -Wno-atomic-alignment"}" ${MAKE_CMD} \
-C "modules/${ONE_MODULE}"
else
env CC_EXTRA_OPTS="${CC_EXTRA_OPTS:-"-Werror"}" ${MAKE_CMD} \
env CC_EXTRA_OPTS="${CC_EXTRA_OPTS:-"-Werror -Wno-atomic-alignment"}" ${MAKE_CMD} \
exclude_modules="${EXCLUDE_MODULES}" "${@}" ${MAKE_TGT:-"all"}
fi
16 changes: 6 additions & 10 deletions scripts/build/get-arch-buildargs.rtp.io
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#!/bin/sh

set -e
set -x

fltplatforms() {
case "${BASE_IMAGE}" in
alpine:3.15)
FILT="grep -v -e ^linux/arm/v6\$" # bus error
;;
ubuntu:20.04)
FILT="grep -v -e ^linux/arm/v7\$" # broken cmake
case "${BUILD_OS}" in
debian*)
FILT="grep -v -e ^linux/arm/v5\$" # broken 64-bit stdatomics
;;
*)
FILT="cat"
Expand All @@ -19,20 +15,20 @@ fltplatforms() {
}

platformopts() {
out="COMPILER=clang-${LLVM_VER}"
case "${BUILD_OS}" in
debian*)
case "${TARGETPLATFORM}" in
linux/ppc64le | linux/arm/v7 | linux/mips64le | linux/arm/v5)
echo "COMPILER=${COMPILER_OLD}"
out="COMPILER=clang-${LLVM_VER_OLD}"
;;
esac
;;
esac
echo "${out}"
echo "${@}"
}

echo "BUILD_OS=${BUILD_OS} TARGETPLATFORM=${TARGETPLATFORM}" >&2

case "${1}" in
platformopts)
shift
Expand Down

0 comments on commit 80c6c66

Please sign in to comment.