Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: update RHEL 8 cross compiler container #3274

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ansible/roles/docker/files/cc-selector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
# cross-compiler-ubuntu1804-armv7-gcc-6
# cross-compiler-ubuntu1804-armv7-gcc-8
# cross-compiler-rhel8-armv7-gcc-8-glibc-2.28
# cross-compiler-rhel8-armv7-gcc-10-glibc-2.28

rpi_newer_tools_base="/opt/raspberrypi/rpi-newer-crosstools/"
base_4_9_4="${rpi_newer_tools_base}x64-gcc-4.9.4-binutils-2.28/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-"
base_6="${rpi_newer_tools_base}x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-"
base_8="${rpi_newer_tools_base}x64-gcc-8.3.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-"
base_8_glibc_2_28="${rpi_newer_tools_base}x64-gcc-8.3.0-glibc-2.28/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-"
base_10_glibc_2_28="${rpi_newer_tools_base}x64-gcc-10.3.0-glibc-2.28/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-"

flags_armv6="-march=armv6zk"
flags_armv7="-march=armv7-a"
Expand All @@ -22,15 +24,15 @@ function run {
local label="$1"

export arm_type=$(echo $label | sed -E 's/^cross-compiler-(ubuntu1[68]04|rhel8)-(armv[67])-gcc-.*$/\2/')
export gcc_version=$(echo $label | sed -E 's/^cross-compiler-(ubuntu1[68]04|rhel8)-armv[67]-gcc-(4\.9\.4|6|8)/\2/')
export gcc_version=$(echo $label | sed -E 's/^cross-compiler-(ubuntu1[68]04|rhel8)-armv[67]-gcc-(4\.9\.4|6|8|10)/\2/')
export git_branch="cc-${arm_type}"
export host_os=$(echo $label | sed -E 's/^cross-compiler-(ubuntu1[68]04|rhel8)-(armv[67])-gcc-.*$/\1/')

if [[ ! "$arm_type" =~ ^armv[67]$ ]]; then
echo "Could not determine ARM type from '$label'"
exit 1
fi
if [[ ! "$gcc_version" =~ ^(4\.9\.4|6|8|8-glibc-2.28)$ ]]; then
if [[ ! "$gcc_version" =~ ^(4\.9\.4|6|8|8-glibc-2.28|10-glibc-2.28)$ ]]; then
echo "Could not determine ARM type from '$label'"
exit 1
fi
Expand All @@ -52,7 +54,7 @@ function run {
# Additional gcc versions are installed via gcc-toolset-<n> packages.
# No such package exists for the default gcc version (8 on RHEL 8).
if [ "${current_gcc_version}" != "${gcc_host_version}" ]; then
if ! . /opt/gcc-toolset-${gcc_host_version}/enable; then
if ! . /opt/rh/gcc-toolset-${gcc_host_version}/enable; then
echo "Host gcc version mismatch (wanted ${gcc_host_version} but got ${current_gcc_version})."
exit 1
fi
Expand Down
11 changes: 9 additions & 2 deletions ansible/roles/docker/templates/rhel8_arm_cross.Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@ RUN dnf install --disableplugin=subscription-manager -y \
git \
glibc-devel.i686 \
java-17-openjdk-headless \
make \
libatomic.i686 \
libstdc++-devel \
libstdc++-devel.i686 \
make \
python3.8 \
procps-ng \
xz \
&& dnf --disableplugin=subscription-manager clean all

RUN dnf install --disableplugin=subscription-manager -y \
http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/gcc-toolset-10-gcc-10.3.1-1.2.el8_5.x86_64.rpm \
http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/gcc-toolset-10-gcc-c++-10.3.1-1.2.el8_5.x86_64.rpm \
http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.i686.rpm \
http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.x86_64.rpm \
http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/gcc-toolset-10-runtime-10.1-0.el8.x86_64.rpm

RUN groupadd -r -g {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \
&& adduser -r -m -d /home/{{ server_user }}/ \
-g {{ server_user_gid.stdout_lines[0] }} \
Expand All @@ -45,7 +52,7 @@ ENV PYTHON /usr/bin/python3

RUN pip3 install tap2junit=={{ tap2junit_version }}

RUN git clone https://github.com/rvagg/rpi-newer-crosstools.git /opt/raspberrypi/rpi-newer-crosstools
RUN git clone --depth=1 https://github.com/rvagg/rpi-newer-crosstools.git /opt/raspberrypi/rpi-newer-crosstools

COPY cc-selector.sh /opt/raspberrypi/cc-selector.sh

Expand Down
3 changes: 3 additions & 0 deletions jenkins/scripts/VersionSelectorScript.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def buildExclusions = [
[ /^debian8-docker-armv7$/, releaseType, lt(10) ],
[ /^debian8-docker-armv7$/, anyType, gte(12) ],
[ /^debian9-docker-armv7$/, anyType, lt(10) ],
[ /^debian10-armv7l$/, anyType, gte(20) ], // gcc 10 requires newer libstdc++
[ /^pi1-docker$/, releaseType, gte(10) ],
[ /^cross-compiler-ubuntu1604-armv[67]-gcc-4.9/, anyType, gte(12) ],
[ /^cross-compiler-ubuntu1604-armv[67]-gcc-6/, anyType, lt(12) ],
Expand All @@ -65,6 +66,8 @@ def buildExclusions = [
[ /^cross-compiler-ubuntu1804-armv7-gcc-8/, anyType, lt(16) ],
[ /^cross-compiler-ubuntu1804-armv7-gcc-8/, anyType, gte(18) ],
[ /^cross-compiler-rhel8-armv7-gcc-8-glibc-2.28/,anyType, lt(18) ],
[ /^cross-compiler-rhel8-armv7-gcc-8-glibc-2.28/,anyType, gte(20) ],
[ /^cross-compiler-rhel8-armv7-gcc-10-glibc-2.28/,anyType, lt(20) ],
[ /^ubuntu1604-arm64/, anyType, gte(14) ],

// Windows -----------------------------------------------
Expand Down