From 460beece050864221d131f836fc5ddb995aab487 Mon Sep 17 00:00:00 2001 From: Christopher Mead Date: Tue, 17 Dec 2024 14:49:43 -0700 Subject: [PATCH] Alternate fix for libasound, R package install for ubuntu 22 or 24, unit test dependencies for 22/24 (#5778) Alternate fix for libasound Support for installing R packages quickly on Ubuntu 24 Support for unit testing on ubuntu 24 ### QA Notes All tests should pass --- .github/actions/install-r/action.yml | 19 ++++++- .github/actions/setup-build-env/action.yml | 17 +++++- .../actions/setup-unit-test-env/action.yml | 57 +++++++++++++------ .github/workflows/test-unit.yml | 2 +- scripts/test.sh | 4 +- 5 files changed, 75 insertions(+), 24 deletions(-) diff --git a/.github/actions/install-r/action.yml b/.github/actions/install-r/action.yml index e308c935350..5cc2189b263 100644 --- a/.github/actions/install-r/action.yml +++ b/.github/actions/install-r/action.yml @@ -17,6 +17,21 @@ runs: curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-"$(arch)"-latest.tar.gz | sudo tar xz -C /usr/local rig add "$R_VERSION" + - name: Configure Posit PPM for Ubuntu 22.04 with Custom HTTP User-Agent + shell: bash + run: | + echo "Configuring R to use Posit Package Manager for Jammy..." + cat < ~/.Rprofile + options( + repos = c(RSPM = "https://packagemanager.posit.co/cran/__linux__/jammy/latest"), + HTTPUserAgent = sprintf( + "R/%s (%s) R (%s)", + getRversion(), "ubuntu-2404", + paste(getRversion(), R.version\$platform, R.version\$arch, R.version\$os) + ) + ) + EOF + - name: Check R Installation shell: bash run: | @@ -26,8 +41,6 @@ runs: shell: bash run: | echo "Installing R development packages..." - # Download a sample DESCRIPTION file if not provided curl -s https://raw.githubusercontent.com/posit-dev/qa-example-content/main/DESCRIPTION --output DESCRIPTION - # Install development dependencies using pak Rscript -e "if (!requireNamespace('pak', quietly = TRUE)) install.packages('pak', repos = 'https://cran.rstudio.com')" - Rscript -e "pak::local_install_dev_deps(ask = FALSE)" + Rscript -e "options(pak.install_binary = TRUE); pak::local_install_dev_deps(ask = FALSE)" diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index df699d574ac..4523064966c 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -6,11 +6,24 @@ runs: - name: Install Build Dependencies shell: bash run: | - sudo apt-get update + # Detect Ubuntu version + UBUNTU_VERSION=$(lsb_release -rs) + echo "Running on Ubuntu version: $UBUNTU_VERSION" + + # Install libasound2 or libasound2t64 based on version + if [[ "$UBUNTU_VERSION" == "24.04" ]]; then + echo "Installing libasound2t64 for Ubuntu 24.04" + sudo apt-get update + sudo apt-get install -y libasound2t64 + else + echo "Installing libasound2 for older Ubuntu versions" + sudo apt-get update + sudo apt-get install -y libasound2 + fi sudo apt-get install -y \ vim curl build-essential clang make cmake git \ libsodium-dev libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb \ - libgtk-3-0 libgbm1 libnss3 libnspr4 libasound2 libkrb5-dev libcairo-dev \ + libgtk-3-0 libgbm1 libnss3 libnspr4 libkrb5-dev libcairo-dev \ libsdl-pango-dev libjpeg-dev libgif-dev pandoc - name: Install Node packages diff --git a/.github/actions/setup-unit-test-env/action.yml b/.github/actions/setup-unit-test-env/action.yml index 27782447b7b..ce19ff4ac46 100644 --- a/.github/actions/setup-unit-test-env/action.yml +++ b/.github/actions/setup-unit-test-env/action.yml @@ -7,21 +7,44 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get install -y \ - libwoff1 \ - libvpx7 \ - libevent-2.1-7 \ - libgstreamer-plugins-base1.0-0 \ - libgstreamer1.0-0 \ - libflite1 \ - libavif13 \ - libhyphen0 \ - libmanette-0.2-0 \ - libgl1-mesa-glx \ - libx264-dev \ - libgstreamer-gl1.0-0 \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - libgles2-mesa + UBUNTU_VERSION=$(lsb_release -rs) + echo "Detected Ubuntu version: $UBUNTU_VERSION" + + if [[ "$UBUNTU_VERSION" == "24.04" ]]; then + sudo apt-get install -y \ + libwoff1 \ + libvpx9 \ + libevent-2.1-7 \ + libgstreamer-plugins-base1.0-0 \ + libgstreamer1.0-0 \ + libflite1 \ + libavif16 \ + libhyphen0 \ + libmanette-0.2-0 \ + libgl1-mesa-dri \ + libx264-dev \ + libgstreamer-gl1.0-0 \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + libgles2 + else + sudo apt-get install -y \ + libwoff1 \ + libvpx7 \ + libevent-2.1-7 \ + libgstreamer-plugins-base1.0-0 \ + libgstreamer1.0-0 \ + libflite1 \ + libavif13 \ + libhyphen0 \ + libmanette-0.2-0 \ + libgl1-mesa-glx \ + libx264-dev \ + libgstreamer-gl1.0-0 \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + libgles2-mesa + fi diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 006805dd3da..4a20d264e19 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -11,7 +11,7 @@ permissions: jobs: unit-tests: name: unit - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 30 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/test.sh b/scripts/test.sh index ae0d88cc734..020ae9b0ef0 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -8,7 +8,9 @@ else ROOT=$(dirname $(dirname $(readlink -f $0))) # --disable-dev-shm-usage: when run on docker containers where size of /dev/shm # partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory - LINUX_EXTRA_ARGS="--disable-dev-shm-usage" + # --- Start Positron --- + LINUX_EXTRA_ARGS="--disable-dev-shm-usage --no-sandbox" + # --- End Positron --- fi cd $ROOT