Skip to content

Commit

Permalink
ci: update libtinfo5 installation for Ubuntu 24.04
Browse files Browse the repository at this point in the history
As per actions/runner-images#10636
`ubuntu-latest` is now Ubuntu 24.04 instead of 22.04 which [does not]
have `libtinfo5` in the default PPAs

[does not]: https://packages.ubuntu.com/search?keywords=libtinfo

Unfortunately all of the LLVM binary releases still for Ubuntu still
target 18.04 and contain binaries linked against `libtinfo5` — bumping
the version of LLVM we use in our tests' toolchains will not solve this
problem.

Pinning CI to use Ubuntu 22.04 is an option; however this PR installs
`libtinfo5` on the Ubuntu 24.04 runners manually instead.
  • Loading branch information
rrbutani committed Oct 11, 2024
1 parent 4f3101e commit d12b3fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- if: startsWith(matrix.os, 'ubuntu')
name: Install APT packages
run: sudo apt-get -y install libtinfo5
run: tests/scripts/ubuntu_install_libtinfo.sh
- uses: actions/checkout@v4
- name: Test
env:
Expand All @@ -52,8 +51,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- if: startsWith(matrix.os, 'ubuntu')
name: Install APT packages
run: sudo apt-get -y install libtinfo5
run: tests/scripts/ubuntu_install_libtinfo.sh
- uses: actions/checkout@v4
- name: Test
env:
Expand Down Expand Up @@ -102,8 +100,7 @@ jobs:
bzlmod: [true, false]
runs-on: ubuntu-latest
steps:
- name: Install APT packages
run: sudo apt-get -y install libtinfo5
- run: tests/scripts/ubuntu_install_libtinfo.sh
- uses: actions/checkout@v4
- name: Test
env:
Expand All @@ -116,8 +113,7 @@ jobs:
bzlmod: [true, false]
runs-on: ubuntu-latest
steps:
- name: Install APT packages
run: sudo apt-get -y install libtinfo5
- run: tests/scripts/ubuntu_install_libtinfo.sh
- uses: actions/checkout@v4
- name: Download and Extract LLVM distribution
env:
Expand Down
18 changes: 18 additions & 0 deletions tests/scripts/ubuntu_install_libtinfo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

Check failure on line 1 in tests/scripts/ubuntu_install_libtinfo.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shfmt

Incorrect formatting, autoformat by running 'trunk fmt'

# Ubuntu 24.04 does not have libtinfo5 in its PPAs:
#
# However, the LLVM binary releases hosted up upstream still target Ubuntu 18.04
# as of this writing and contain binaries linked against `libtinfo5`.
#
# This script installs `libtinfo5` using the `.deb` from Ubuntu 22.04's PPAs:
# https://packages.ubuntu.com/jammy-updates/amd64/libtinfo5/download

set -euo pipefail

readonly pkg="$(mktemp --suffix=.deb)"

Check warning on line 13 in tests/scripts/ubuntu_install_libtinfo.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2155)

[new] Declare and assign separately to avoid masking return values.
trap EXIT 'rm -f "$pkg"'

curl -L https://mirrors.kernel.org/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb -o "$pkg"

Check notice on line 16 in tests/scripts/ubuntu_install_libtinfo.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.
dpkg -i "$pkg"

Check notice on line 17 in tests/scripts/ubuntu_install_libtinfo.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.

0 comments on commit d12b3fe

Please sign in to comment.