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

apt-cache show fails on package that does exist (libtk8.6) #106

Closed
bruno-digitbio opened this issue Jun 16, 2023 · 3 comments
Closed

apt-cache show fails on package that does exist (libtk8.6) #106

bruno-digitbio opened this issue Jun 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@bruno-digitbio
Copy link

Package validation is currently done by using apt-cache show ${package}. However, on the latest version of the GitHub actions runner for Ubuntu, some packages (e.g., libtk8.6) are not visible to apt-cache until after an apt-get update.

This means that cache-apt-pkgs-action errors our during validation even though the package would successfully install after an apt-fast update.

Minimal reproducible example:

jobs:
  example-broken-job:
    name: example-broken-job
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          # Fetch the current and previous commits.
          fetch-depth: 2
          submodules: 'recursive'
      - name: Install apt dependencies for Bazel bootstrapping
        uses: awalsh128/cache-apt-pkgs-action@v1
        with:
          packages: libtk8.6
          version: 1.0

To reproduce the issue directly in a runner:

$ docker attach $(docker run --name github-actions-ubuntu-2 -d -i -t catthehacker/ubuntu:act-latest /bin/bash)
root@e6d223c9b85a:/tmp# apt-cache show libtk8.6
N: Unable to locate package libtk8.6
N: Couldn't find any package by glob 'libtk8.6'
N: Couldn't find any package by regex 'libtk8.6'
E: No packages found
root@e6d223c9b85a:/tmp# apt-get install libtk8.6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libtk8.6
E: Couldn't find any package by glob 'libtk8.6'
E: Couldn't find any package by regex 'libtk8.6'
root@e6d223c9b85a:/tmp# apt-get update
<SNIP>
root@e6d223c9b85a:/tmp# apt-cache show libtk8.6
Package: libtk8.6
Architecture: amd64
Version: 8.6.12-1build1
Multi-Arch: same
Priority: optional
Section: libs
Source: tk8.6
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Tcl/Tk Packagers <pkg-tcltk-devel@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 2367
Provides: libtk
Depends: libtcl8.6 (>= 8.6.0-2), libc6 (>= 2.35), libfontconfig1 (>= 2.12.6), libx11-6, libxft2 (>> 2.1.1), libxss1
Suggests: tk8.6
Conflicts: libtk-img (<< 1.2.5), tk40 (<= 4.0p3-2), tk8.6 (<< 8.6.0-2)
Replaces: tk8.6 (<< 8.6.0-2)
Filename: pool/main/t/tk8.6/libtk8.6_8.6.12-1build1_amd64.deb
Size: 783834
MD5sum: 0b77eaf674cddbcf4be3ae5daf33a5da
SHA1: e915a51f975e2c9f9f06105500dd346f939edc73
SHA256: fd394fe34bce405d66079518f122917e434dc269315ed4125dc982d31a03684d
SHA512: ab375b502a641ee170f940fd8775aa0fc1033f5c499886bcc8d9fb06b3bf5da2cd53cc8de6b96abec898215b8de70ec741c2bfad3ae9af4a94d4647988efc064
Homepage: http://www.tcl.tk/
Description: Tk toolkit for Tcl and X11 v8.6 - run-time files
Description-md5: 01d90661559e5ce16fbf055f91aff291
Task: ubuntustudio-desktop
@bruno-digitbio
Copy link
Author

Happy to help with a PR if there is an approach to solving this that you like but don't have bandwidth to implement.

@awalsh128
Copy link
Owner

Thanks for you patience. I haven't had a lot of time lately to look into issues.

Created a regression test in awalsh128/cache-apt-pkgs-action-ci@9730b39 but I am having trouble recreating the issue.

Can you take a look at my setup and see if I am missing something? If we can confirm the scenario as being an Apt update issue, we could possibly do a fallback where if apt-cache show fails, we perform an update. It was taken out awhile ago to speed up the restore process.

@awalsh128 awalsh128 added the bug Something isn't working label Oct 30, 2023
@awalsh128 awalsh128 added the help wanted Extra attention is needed label Oct 30, 2023
@awalsh128 awalsh128 removed the help wanted Extra attention is needed label Mar 3, 2024
@awalsh128
Copy link
Owner

This should be okay now since the Golang version (has regression coverage too). Going to close out. Feel free to re-open if you still have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants