Skip to content

Commit b9bab9c

Browse files
Merge pull request #1222 from jordancarlin/rhel-docker-install
Fix RHEL family installation in CI
2 parents ee6a1d8 + 434a3ee commit b9bab9c

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

.github/workflows/install.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- 'bin/wally-tool-chain-install.sh'
2020
- 'bin/wally-distro-check.sh'
2121
- 'bin/wally-package-install.sh'
22+
- '.github/workflows/install.yml'
2223
schedule:
2324
- cron: "0 7 * * 3" # Run at 12:00 AM Pacific Time on Wednesdays
2425

@@ -108,12 +109,12 @@ jobs:
108109
run: |
109110
if [ ${{ matrix.imageFamily }} == "debian" ]; then
110111
apt-get update
111-
apt-get install -y sudo git
112+
apt-get install -y git
112113
elif [ ${{ matrix.imageFamily }} == "redhat" ]; then
113-
dnf install -y sudo git
114+
dnf install -y git
114115
dnf install curl -y --allowerasing || true
115116
elif [ ${{ matrix.imageFamily }} == "suse" ]; then
116-
zypper install -y sudo git
117+
zypper install -y git
117118
fi
118119
# Only clone submodules needed for standard tests/regression to save space
119120
- uses: actions/checkout@v4
@@ -134,7 +135,9 @@ jobs:
134135
# Run main tool chain installation script, either as a user or system wide
135136
- name: Install
136137
run: |
137-
if [ -z ${{ matrix.user }} ]; then
138+
if [ ! -z ${{ matrix.image }} ]; then
139+
./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
140+
elif [ -z ${{ matrix.user }} ]; then
138141
sudo ./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
139142
else
140143
sudo ./bin/wally-package-install.sh
@@ -164,7 +167,7 @@ jobs:
164167
# Only the linux-testvectors are needed, so remove the rest of the buildroot to save space
165168
- name: Remove Buildroot to Save Space
166169
run: |
167-
sudo rm -rf $RISCV/buildroot/output/build
170+
rm -rf $RISCV/buildroot/output/build || sudo rm -rf $RISCV/buildroot/output/build
168171
df -h
169172
# Run standard regression, skipping distros that are known to be broken with Verilator
170173
- name: Regression

bin/wally-package-install.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ case "$FAMILY" in
5555
rhel)
5656
PYTHON_VERSION=python3.12
5757
PACKAGE_MANAGER="dnf -y"
58-
UPDATE_COMMAND="sudo $PACKAGE_MANAGER update"
58+
UPDATE_COMMAND="$PACKAGE_MANAGER update"
5959
GENERAL_PACKAGES+=(which "$PYTHON_VERSION" "$PYTHON_VERSION"-pip pkgconf-pkg-config gcc-c++ ssmtp)
6060
GNU_PACKAGES+=(libmpc-devel mpfr-devel gmp-devel zlib-devel expat-devel libslirp-devel ninja-build)
6161
QEMU_PACKAGES+=(glib2-devel libfdt-devel pixman-devel)
@@ -87,7 +87,7 @@ case "$FAMILY" in
8787
VERILATOR_PACKAGES+=(mold)
8888
fi
8989
PACKAGE_MANAGER="DEBIAN_FRONTEND=noninteractive apt-get -y"
90-
UPDATE_COMMAND="sudo $PACKAGE_MANAGER update && sudo $PACKAGE_MANAGER upgrade --with-new-pkgs"
90+
UPDATE_COMMAND="$PACKAGE_MANAGER update && $PACKAGE_MANAGER upgrade --with-new-pkgs"
9191
GENERAL_PACKAGES+=("$PYTHON_VERSION" python3-pip "$PYTHON_VERSION"-venv pkg-config g++ ssmtp)
9292
GNU_PACKAGES+=(autotools-dev libmpc-dev libmpfr-dev libgmp-dev build-essential ninja-build zlib1g-dev libexpat1-dev libglib2.0-dev libslirp-dev)
9393
QEMU_PACKAGES+=(libfdt-dev libpixman-1-dev)
@@ -100,7 +100,7 @@ case "$FAMILY" in
100100
PYTHON_VERSION=python3.12
101101
PYTHON_VERSION_PACKAGE=python312
102102
PACKAGE_MANAGER="zypper -n"
103-
UPDATE_COMMAND="sudo $PACKAGE_MANAGER update"
103+
UPDATE_COMMAND="$PACKAGE_MANAGER update"
104104
GENERAL_PACKAGES+=("$PYTHON_VERSION_PACKAGE" "$PYTHON_VERSION_PACKAGE"-pip pkg-config)
105105
GNU_PACKAGES+=(mpc-devel mpfr-devel gmp-devel zlib-devel libexpat-devel libslirp-devel ninja)
106106
QEMU_PACKAGES+=(glib2-devel libpixman-1-0-devel) # maybe also need qemu itself?
@@ -132,32 +132,32 @@ else
132132
section_header "Installing/Updating Dependencies from Package Manager"
133133
# Enable extra repos necessary for rhel
134134
if [ "$FAMILY" == rhel ]; then
135-
sudo dnf install -y dnf-plugins-core
136-
sudo dnf group install -y "Development Tools"
135+
dnf install -y dnf-plugins-core
136+
dnf group install -y "Development Tools"
137137
if [ "$ID" == rhel ]; then
138-
sudo subscription-manager repos --enable "codeready-builder-for-rhel-$RHEL_VERSION-$(arch)-rpms"
139-
sudo dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RHEL_VERSION.noarch.rpm"
138+
subscription-manager repos --enable "codeready-builder-for-rhel-$RHEL_VERSION-$(arch)-rpms"
139+
dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RHEL_VERSION.noarch.rpm"
140140
else # RHEL clone
141141
if (( RHEL_VERSION == 8 )); then
142-
sudo dnf config-manager -y --set-enabled powertools
142+
dnf config-manager -y --set-enabled powertools
143143
else # Version 9
144-
sudo dnf config-manager -y --set-enabled crb
144+
dnf config-manager -y --set-enabled crb
145145
fi
146-
sudo dnf install -y epel-release
146+
dnf install -y epel-release
147147
fi
148148
fi
149149

150150
# Update and Upgrade tools
151151
eval "$UPDATE_COMMAND"
152152
# Install packages listed above using appropriate package manager
153-
sudo $PACKAGE_MANAGER install "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}" "${VIVADO_PACKAGES[@]}"
153+
eval $PACKAGE_MANAGER install "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}" "${VIVADO_PACKAGES[@]}"
154154

155155
# Post install steps
156156
# Vivado looks for ncurses5 libraries, but Ubuntu 24.04 only has ncurses6
157157
# Create symbolic links to the ncurses6 libraries to fool Vivado
158158
if (( UBUNTU_VERSION >= 24 )); then
159-
sudo ln -vsf /lib/x86_64-linux-gnu/libncurses.so.6 /lib/x86_64-linux-gnu/libncurses.so.5
160-
sudo ln -vsf /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libntinfo.so.5
159+
ln -vsf /lib/x86_64-linux-gnu/libncurses.so.6 /lib/x86_64-linux-gnu/libncurses.so.5
160+
ln -vsf /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libntinfo.so.5
161161
fi
162162

163163
echo -e "${SUCCESS_COLOR}Packages successfully installed.${ENDC}"

0 commit comments

Comments
 (0)