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

Error when some of the dependencies are already installed #36

Closed
krupkat opened this issue Jul 25, 2022 · 5 comments
Closed

Error when some of the dependencies are already installed #36

krupkat opened this issue Jul 25, 2022 · 5 comments

Comments

@krupkat
Copy link

krupkat commented Jul 25, 2022

Hello, thanks for the super useful repo!

I have an issue when caching the libgtk-3-dev package on Ubuntu 22.04, excerpt from my workflow:

jobs:
  build:
    runs-on: ubuntu-22.04

    steps:
    - uses: actions/checkout@v3
    - uses: awalsh128/cache-apt-pkgs-action@v1.1.0
      with:
          packages: libgtk-3-dev

Here is the error log:

...
09:49:08   * Caching libharfbuzz-gobject0 to /home/runner/cache-apt-pkgs/libharfbuzz-gobject0:2.7.4-1ubuntu3.1.tar.gz...
09:49:08     done (compressed size 28K).
09:49:08   * Caching libharfbuzz-icu0 to /home/runner/cache-apt-pkgs/libharfbuzz-icu0:2.7.4-1ubuntu3.1.tar.gz...
09:49:08     done (compressed size 8.0K).
E: Regex compilation error - Invalid range end
E: No packages found
09:49:08   * Caching libharfbuzz0b[2.7.4-1ubuntu3] to /home/runner/cache-apt-pkgs/libharfbuzz0b[2.7.4-1ubuntu3].tar.gz...
dpkg-query: error: --listfiles needs a valid package name but 'libharfbuzz0b[2.7.4-1ubuntu3]' is not: illegal package name in specifier 'libharfbuzz0b[2.7.4-1ubuntu3]': character '[' not allowed (only letters, digits and characters '-+._')
Use --help for help about querying packages.
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.
Error: Process completed with exit code 123.

I believe the get_dep_packages function will have to be updated to better handle the output from apt --dry-run. Here is what I get when running apt install --dry-run --yes libgtk-3-dev | grep "^Inst" | grep harfbuzz:

Inst libharfbuzz0b [2.7.4-1ubuntu3] (2.7.4-1ubuntu3.1 Ubuntu:22.04/jammy-updates, Ubuntu:22.04/jammy-security [amd64])
Inst gir1.2-harfbuzz-0.0 (2.7.4-1ubuntu3.1 Ubuntu:22.04/jammy-updates, Ubuntu:22.04/jammy-security [amd64])
Inst libharfbuzz-icu0 (2.7.4-1ubuntu3.1 Ubuntu:22.04/jammy-updates, Ubuntu:22.04/jammy-security [amd64])
Inst libharfbuzz-gobject0 (2.7.4-1ubuntu3.1 Ubuntu:22.04/jammy-updates, Ubuntu:22.04/jammy-security [amd64])
Inst libharfbuzz-dev (2.7.4-1ubuntu3.1 Ubuntu:22.04/jammy-updates, Ubuntu:22.04/jammy-security [amd64])

See the extra version number in square brackets on line 1 which means that there is already a 2.7.4-1ubuntu3 version of the libharfbuzz0b package installed and it will be replaced by the 2.7.4-1ubuntu3.1 version.

The other dependencies are fresh installs, so awk '{print $2 $3}' works fine to extract the version number.

@awalsh128
Copy link
Owner

Started a possible fix. It is succeeding locally but still need to run against new regression test.

If you want, you can try it out yourself from dev branch.

@krupkat
Copy link
Author

krupkat commented Jul 26, 2022

The fix from the dev branch worked, thanks a lot!

@awalsh128
Copy link
Owner

Great to hear. I'll update the issue once I have a release.

awalsh128 added a commit that referenced this issue Aug 3, 2022
* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.
awalsh128 added a commit that referenced this issue Aug 3, 2022
* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.
@awalsh128
Copy link
Owner

awalsh128 added a commit that referenced this issue Aug 3, 2022
* Fix issues #36, #37, and minor refactors. (#40) (#41)

* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.

* Update README.md to use latest release in examples.
awalsh128 added a commit that referenced this issue Aug 3, 2022
* Fix issues #36, #37, and minor refactors. (#40) (#41)

* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.

* Update README.md to use latest release in examples.
@krupkat
Copy link
Author

krupkat commented Aug 3, 2022

Thank you! Working great now!

awalsh128 added a commit that referenced this issue Sep 1, 2022
* Fix issues #36, #37, and minor refactors. (#40)

* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.

* Merge master to staging. (#43)

* Fix issues #36, #37, and minor refactors. (#40) (#41)

* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.

* Update README.md to use latest release in examples.
awalsh128 added a commit that referenced this issue Sep 1, 2022
* Fix issues #36, #37, and minor refactors. (#40) (#41)

* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.

* Update README.md to use latest release in examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants