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

Save DevKit downloaded rpms from bootstrap build to save download in final build #1052

Merged
merged 3 commits into from
Jun 24, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ jobs:
VALIDATE_DOCKERFILE_HADOLINT: false
# checkov fails
VALIDATE_CHECKOV: false
# ignore shell formatting checker
VALIDATE_SHELL_SHFMT: false
20 changes: 14 additions & 6 deletions pipelines/build/devkit/make_devkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ patch -p1 < ../Tools.gmk.patch

devkit_target="${ARCH}-linux-gnu"

if [ "${BASE_OS}" = "rhel" ]; then
mkdir -p ../../../build/devkit/${VERSION}/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}
# Downlod RPMS from RHEL (Requires machine to be attached to RHEL subscription)
if [ "${BASE_OS}" = "rhel" ] && [ "${ARCH}" = "s390x" ]; then
mkdir -p build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}
# Download RPMS from RHEL (Requires machine to be attached to RHEL subscription)
RPMDIR=/var/cache/yum/s390x/7Server/rhel-7-for-system-z-rpms/packages
pwd
for A in glibc glibc-headers glibc-devel cups-libs cups-devel libX11 libX11-devel xorg-x11-proto-devel alsa-lib alsa-lib-devel libXext libXext-devel libXtst libXtst-devel libXrender libXrender-devel libXrandr libXrandr-devel freetype freetype-devel libXt libXt-devel libSM libSM-devel libICE libICE-devel libXi libXi-devel libXdmcp libXdmcp-devel libXau libXau-devel libgcc libxcrypt zlib zlib-devel libffi libffi-devel fontconfig fontconfig-devel kernel-headers; do
if [ ! -z "$(ls $RPMDIR/${A}-[0-9]*${ARCH}*.rpm)" ]; then
cp -pv ${RPMDIR}/${A}-[0-9]*${ARCH}*.rpm "../../../build/devkit/${VERSION}/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}"
cp -pv ${RPMDIR}/${A}-[0-9]*${ARCH}*.rpm "build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}"
elif [ ! -z "$(ls $RPMDIR/${A}-[0-9]*noarch.rpm)" ]; then
cp -pv ${RPMDIR}/${A}-[0-9]*noarch.rpm "../../../build/devkit/${VERSION}/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}"
cp -pv ${RPMDIR}/${A}-[0-9]*noarch.rpm "build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}"
fi
done
# Temporary fudge to use Centos logic until we adjust Tools.gmk
Expand All @@ -66,10 +66,18 @@ cd make/devkit && pwd && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_O
# Move "bootstrap" devkit toolchain to a new folder and setup gcc toolchain to point at it
cd ../..
BOOTSTRAP_DEVKIT="$(pwd)/build/bootstrap_${devkit_target}-to-${devkit_target}"
mv build/devkit/result/${devkit_target}-to-${devkit_target} ${BOOTSTRAP_DEVKIT}
BOOTSTRAP_DOWNLOADED_RPMS="$(pwd)/build/bootstrap_rpms_${devkit_target}-to-${devkit_target}"

mv build/devkit/result/${devkit_target}-to-${devkit_target} "${BOOTSTRAP_DEVKIT}"
mv build/devkit/download/rpms/${ARCH}-linux-gnu-Centos${BASE_OS_VERSION} "${BOOTSTRAP_DOWNLOADED_RPMS}"

# Make final "DevKit" using the bootstrap devkit
rm -rf build/devkit

# Move saved bootstrap rpm downloads to final build folder
mkdir -p build/devkit/download/rpms
mv ${BOOTSTRAP_DOWNLOADED_RPMS} build/devkit/download/rpms/${ARCH}-linux-gnu-Centos${BASE_OS_VERSION}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut feel is that maybe using ln to make them appear in both locations might be nicer, but take or leave this as you wish.

Suggested change
mv ${BOOTSTRAP_DOWNLOADED_RPMS} build/devkit/download/rpms/${ARCH}-linux-gnu-Centos${BASE_OS_VERSION}
ln ${BOOTSTRAP_DOWNLOADED_RPMS} build/devkit/download/rpms/${ARCH}-linux-gnu-Centos${BASE_OS_VERSION}


echo "Building 'final' DevKit toolchain, using 'bootstrap' toolchain in ${BOOTSTRAP_DEVKIT}"
cd make/devkit && pwd && \
LD_LIBRARY_PATH="${BOOTSTRAP_DEVKIT}/lib64:${BOOTSTRAP_DEVKIT}/lib" \
Expand Down