jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
446 stars 78 forks source link

Failure when running in Ubuntu 20.04 container #242

Closed messmerd closed 4 weeks ago

messmerd commented 1 month ago

I'm running jurplel/install-qt-action@v4 within an ubuntu:20.04 container running on the ubuntu-latest build runner:

runs-on: ubuntu-latest
container: ubuntu:20.04

My Qt installation step is:

- name: Install Qt
  uses: jurplel/install-qt-action@v4
  with:
    version: '5.15.2'
    arch: 'gcc_64'
    archives: qtbase qtsvg qttools qtx11extras
    cache: true

This setup isn't working, and from the logs it appears that install-qt-action is trying to use Python 3.11.9 which expects a glibc version which isn't available on the system as well as printing a message about "zstd" being missing.

Here's the relevant portion of the output messages (with debugging enabled):

Setting up gstreamer1.0-gl:amd64 (1.16.3-0ubuntu1.3) ...
Setting up libglvnd-dev:amd64 (1.3.2-1~ubuntu0.20.04.2) ...
Setting up libgl1-mesa-dev:amd64 (21.2.6-0ubuntu0.1~20.04.2) ...
Processing triggers for libglib2.0-0:amd64 (2.64.6-1~ubuntu20.04.7) ...
Processing triggers for libc-bin (2.31-0ubuntu9.16) ...
Setting up libpulse-dev:amd64 (1:13.99.1-1ubuntu3.13) ...
##[debug]Resolved Keys:
##[debug]["install-qt-action-linux-6.5.0-1021-azure-desktop-gcc_64-5.15.2-/__w/lmms/Qt-==0.20.*-==3.1.*-qtbase-qtsvg-qttools-qtx11extras"]
##[debug]Checking zstd --quiet --version
##[debug]Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
##[debug]
##[debug]zstd version: null
##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/pwcaf1VPrxS7fgOXBPcMD3dvo9HUjny8wRXGhIgjwlGHKIWSGp/_apis/artifactcache/cache?keys=install-qt-action-linux-6.5.0-1021-azure-desktop-gcc_64-5.15.2-%2F__w%2Flmms%2FQt-%3D%3D0.20.*-%3D%3D3.1.*-qtbase-qtsvg-qttools-qtx11extras&version=3ab230e51801c7664d085e3f50065160a9156cc97720996ecd93bd08f6532c84
##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/pwcaf1VPrxS7fgOXBPcMD3dvo9HUjny8wRXGhIgjwlGHKIWSGp/_apis/artifactcache/caches?key=install-qt-action-linux-6.5.0-1021-azure-desktop-gcc_64-5.15.2-%2F__w%2Flmms%2FQt-%3D%3D0.20.*-%3D%3D3.1.*-qtbase-qtsvg-qttools-qtx11extras
##[debug]Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
Automatic cache miss, will cache this run
/__t/Python/3.11.9/x64/bin/python3 -m pip install setuptools wheel py7zr==0.20.*
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /__t/Python/3.11.9/x64/bin/python3)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
Error: Error: The process '/__t/Python/3.11.9/x64/bin/python3' failed with exit code 1
##[debug]Node Action run completed with exit code 1
##[debug]Finished: run
##[debug]Finishing: Install Qt

Please let me know if you know how to fix this. Thanks!

pzhlkj6612 commented 1 month ago

Interesting. I tried the following workflow and got a different error.

name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    container: ubuntu:20.04
    steps:
        - name: Install Qt
          uses: jurplel/install-qt-action@v4
          with:
            version: '5.15.2'
            arch: 'gcc_64'
            archives: qtbase qtsvg qttools qtx11extras
            cache: true

Output:

> Run jurplel/install-qt-action@v4
> Run actions/setup-python@v5
/usr/bin/docker exec  9b4f8e62bac0867a047bc7228e7c8aef70f8dec050d8926f02ccfd850ea1f4d7 sh -c "cat /etc/*release | grep ^ID"
> Installed versions
> Run jurplel/install-qt-action/action@v4
/usr/bin/docker exec  9b4f8e62bac0867a047bc7228e7c8aef70f8dec050d8926f02ccfd850ea1f4d7 sh -c "cat /etc/*release | grep ^ID"
Error: Error: Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

It seems that both of us failed when installing dependencies:

https://github.com/jurplel/install-qt-action/blob/f03f05556819ceb3781ee2f455ec44c339d683c0/action/src/main.ts#L284-L331

For now I have no idea why it happened.

messmerd commented 1 month ago

@pzhlkj6612 Looks like you need to install sudo. It's not pre-installed on ubuntu:20.04.

apt-get update && apt-get install -y sudo
messmerd commented 1 month ago

I tried installing zstd and now my error message is this:

Setting up libglib2.0-dev:amd64 (2.64.6-1~ubuntu20.04.7) ...
Processing triggers for libglib2.0-0:amd64 (2.64.6-1~ubuntu20.04.7) ...
Processing triggers for libglib2.0-0:i386 (2.64.6-1~ubuntu20.04.7) ...
Processing triggers for libc-bin (2.31-0ubuntu9.16) ...
Setting up libpulse-dev:amd64 (1:13.99.1-1ubuntu3.13) ...
##[debug]Resolved Keys:
##[debug]["install-qt-action-linux-6.5.0-1021-azure-desktop-gcc_64-5.15.2-/__w/lmms/Qt-==0.20.*-==3.1.*-qtbase-qtsvg-qttools-qtx11extras"]
##[debug]Checking zstd --quiet --version
##[debug]*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
##[debug]zstd version: null
##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/pwcaf1VPrxS7fgOXBPcMD3dvo9HUjny8wRXGhIgjwlGHKIWSGp/_apis/artifactcache/cache?keys=install-qt-action-linux-6.5.0-1021-azure-desktop-gcc_64-5.15.2-%2F__w%2Flmms%2FQt-%3D%3D0.20.*-%3D%3D3.1.*-qtbase-qtsvg-qttools-qtx11extras&version=74fa578b216ee68fbe23bcedf63b12defa5faf7ce10d9a959c44eb2f55a66d5f
##[debug]Resource Url: https://acghubeus1.actions.githubusercontent.com/pwcaf1VPrxS7fgOXBPcMD3dvo9HUjny8wRXGhIgjwlGHKIWSGp/_apis/artifactcache/caches?key=install-qt-action-linux-6.5.0-1021-azure-desktop-gcc_64-5.15.2-%2F__w%2Flmms%2FQt-%3D%3D0.20.*-%3D%3D3.1.*-qtbase-qtsvg-qttools-qtx11extras
##[debug]Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
Automatic cache miss, will cache this run
/__t/Python/3.11.9/x64/bin/python3 -m pip install setuptools wheel py7zr==0.20.*
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /__t/Python/3.11.9/x64/bin/python3)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
/__t/Python/3.11.9/x64/bin/python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /__t/Python/3.11.9/x64/lib/libpython3.11.so.1.0)
Error: Error: The process '/__t/Python/3.11.9/x64/bin/python3' failed with exit code 1
##[debug]Node Action run completed with exit code 1
##[debug]Finished: run
##[debug]Finishing: Install Qt

Note that it finds zstd now, but it fails to parse the version when it runs zstd --quiet --version.

When I run zstd --quiet --version on Ubuntu 22.04, I get:

1.4.8

But on Ubuntu 20.04, it is:

zstd command line interface 64-bits v1.4.4, by Yann Collet

This could probably be fixed with better parsing.

pzhlkj6612 commented 1 month ago

Looks like you need to install sudo. It's not pre-installed on ubuntu:20.04.

Hmm, using sudo in a Docker container looks a bit weird. I think the action itself should detect if it's running as a root first.

pzhlkj6612 commented 1 month ago

I've installed sudo but didn't make it work:

Get:107 http://archive.ubuntu.com/ubuntu focal/main amd64 libnpth0 amd64 1.6-1 [7736 B]
...
Get:156 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgstreamer-plugins-base1.0-0 amd64 1.16.3-0ubuntu1.3 [740 kB]
Setting up libwayland-server0:amd64 (1.18.0-1ubuntu0.1) ...
...
Setting up tzdata (2024a-0ubuntu0.20.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
  1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
  2. America     5. Arctic     8. Europe    11. SystemV
  3. Antarctica  6. Asia       9. Indian    12. US

<stopped here>

Why are our execution results not the same...? Maybe you have installed other packages before installing Qt?

messmerd commented 1 month ago

Yes, I install some other dependencies prior to installing Qt.

I'm working on the "linux" job of this build.yml: https://github.com/messmerd/lmms/blob/linux-vcpkg/.github/workflows/build.yml This is the bulk of the dependencies I install beforehand: https://github.com/messmerd/lmms/blob/linux-vcpkg/.github/workflows/deps-ubuntu-gcc-20.04.txt

And I ran into the tzdata issue too. It's difficult to install non-interactively. I used this:

sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common
messmerd commented 4 weeks ago

I tried using setup-python: false and it fixed the issue.

pzhlkj6612 commented 4 weeks ago

I tried using setup-python: false and it fixed the issue.

Good to hear that.

However the problem is still not found, so I may test it again later.