awalsh128 / cache-apt-pkgs-action

Cache APT packages in GitHub Actions
Other
204 stars 35 forks source link

Package name and version not in the correct format for dpkg. #45

Closed tamascsaba closed 2 years ago

tamascsaba commented 2 years ago

I try to install mplayer, but I got an error:

E: No packages found
10:58:36   * Caching libgbm-dev[22.0.1-1ubuntu2.1] to /home/runner/cache-apt-pkgs/libgbm-dev[22.0.1-1ubuntu2.1].tar.gz...
dpkg-query: error: --listfiles needs a valid package name but 'libgbm-dev[22.0.1-1ubuntu2.1]' is not: illegal package name in specifier 'libgbm-dev[22.0.1-1ubuntu2.1]': character '[' not allowed (only letters, digits and characters '-+._')

cache-apt-pkgs-action try to compress the package, but it is not possible, because the filename is not valid. Other improvement what I suggest is use zstd compression. It is much faster and supported in hosted runners.: https://github.com/actions/virtual-environments/issues/89 You can use with: tar -caf package.tar.zst package-directory

awalsh128 commented 2 years ago

Linux only has forward slash as an illegal character so the filename is okay but it looks like the fully qualified package name is not when passed to dpkg. Could you send me the logs and your action inputs?

Also thanks for the tip for the optimization. Opened issue #46 to track this.

tamascsaba commented 2 years ago

Of course it is really simple:

uses: awalsh128/cache-apt-pkgs-action@latest
with:
  packages: mplayer
  version: 1.0

Log:

2022-08-08T05:13:01.2972967Z ##[group]Run awalsh128/cache-apt-pkgs-action@latest
2022-08-08T05:13:01.2973542Z with:
2022-08-08T05:13:01.2974090Z   packages: mplayer
2022-08-08T05:13:01.2974322Z   version: 1
2022-08-08T05:13:01.2974780Z   refresh: false
2022-08-08T05:13:01.2975973Z ##[endgroup]
2022-08-08T05:13:01.3363510Z ##[group]Run /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/pre_cache_action.sh \
2022-08-08T05:13:01.3364037Z /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/pre_cache_action.sh \
2022-08-08T05:13:01.3364375Z   ~/cache-apt-pkgs \
2022-08-08T05:13:01.3364607Z   "1" \
2022-08-08T05:13:01.3364988Z   mplayer
2022-08-08T05:13:01.3365282Z echo "CACHE_KEY=$(cat ~/cache-apt-pkgs/cache_key.md5)" >> $GITHUB_ENV
2022-08-08T05:13:01.3437365Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2022-08-08T05:13:01.3437681Z env:
2022-08-08T05:13:01.3437933Z   NODE_OPTIONS: --max_old_space_size=8192
2022-08-08T05:13:01.3438214Z   TZ: Asia/Kathmandu
2022-08-08T05:13:01.3438452Z ##[endgroup]
2022-08-08T05:13:01.3832469Z 10:58:01 -n Validating action arguments (version='1', packages='mplayer ')...
2022-08-08T05:13:01.3854457Z 10:58:01 done.
2022-08-08T05:13:01.3868370Z 10:58:01 -n Verifying packages...
2022-08-08T05:13:01.3943895Z 
2022-08-08T05:13:01.3944763Z WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2022-08-08T05:13:01.3945282Z 
2022-08-08T05:13:01.6432810Z 
2022-08-08T05:13:01.6433849Z WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2022-08-08T05:13:01.6434502Z 
2022-08-08T05:13:01.8716465Z done.
2022-08-08T05:13:01.8733660Z 10:58:01 Creating cache key...
2022-08-08T05:13:01.8877559Z 10:58:01 - Normalized package list is 'mplayer=2:1.4+ds1-3build1 '.
2022-08-08T05:13:01.8891259Z 10:58:01 - Value to hash is 'mplayer=2:1.4+ds1-3build1  @ 1'.
2022-08-08T05:13:01.8937874Z 10:58:01 - Value hashed as '848fc64253761e4903398f91fa1617b2'.
2022-08-08T05:13:01.8954870Z 10:58:01 done.
2022-08-08T05:13:01.8969725Z 10:58:01 Hash value written to /home/runner/cache-apt-pkgs/cache_key.md5
2022-08-08T05:13:01.9051773Z ##[group]Run actions/cache@v3
2022-08-08T05:13:01.9052002Z with:
2022-08-08T05:13:01.9052202Z   path: ~/cache-apt-pkgs
2022-08-08T05:13:01.9052484Z   key: cache-apt-pkgs_848fc64253761e4903398f91fa1617b2
2022-08-08T05:13:01.9052728Z env:
2022-08-08T05:13:01.9052942Z   NODE_OPTIONS: --max_old_space_size=8192
2022-08-08T05:13:01.9053191Z   TZ: Asia/Kathmandu
2022-08-08T05:13:01.9053430Z   CACHE_KEY: 848fc64253761e4903398f91fa1617b2
2022-08-08T05:13:01.9053646Z ##[endgroup]
2022-08-08T05:13:02.2212441Z Cache not found for input keys: cache-apt-pkgs_848fc64253761e4903398f91fa1617b2
2022-08-08T05:13:02.2298926Z ##[group]Run /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/post_cache_action.sh \
2022-08-08T05:13:02.2299559Z /home/runner/work/_actions/awalsh128/cache-apt-pkgs-action/latest/post_cache_action.sh \
2022-08-08T05:13:02.2299859Z   ~/cache-apt-pkgs \
2022-08-08T05:13:02.2300062Z   / \
2022-08-08T05:13:02.2300241Z   "" \
2022-08-08T05:13:02.2300410Z   mplayer
2022-08-08T05:13:02.2300720Z function create_list { local list=$(cat ~/cache-apt-pkgs/manifest_${1}.log | tr '\n' ','); echo ${list:0:-1}; };
2022-08-08T05:13:02.2301096Z echo "::set-output name=package-version-list::$(create_list main)"
2022-08-08T05:13:02.2301663Z echo "::set-output name=all-package-version-list::$(create_list all)"
2022-08-08T05:13:02.2366816Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2022-08-08T05:13:02.2367865Z   CACHE_KEY: 848fc64253761e4903398f91fa1617b2
2022-08-08T05:13:02.2368084Z ##[endgroup]
2022-08-08T05:13:02.2690204Z 10:58:02 Clean installing and caching 1 package(s).
2022-08-08T05:13:02.2709342Z 10:58:02 Package list:
2022-08-08T05:13:02.2725954Z 10:58:02 - mplayer
2022-08-08T05:13:02.2739969Z 10:58:02 Updating APT package list...
2022-08-08T05:13:08.5308539Z done.
2022-08-08T05:13:08.5326003Z 10:58:08 Clean installing and caching 1 packages...
2022-08-08T05:13:08.5397347Z 
2022-08-08T05:13:08.5398591Z WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2022-08-08T05:13:08.5399143Z 
2022-08-08T05:13:09.9081603Z 10:58:09 - mplayer
2022-08-08T05:13:09.9095644Z 10:58:09   * Version: 2:1.4+ds1-3build1
2022-08-08T05:13:09.9118577Z 10:58:09   * Dependencies: i965-va-driver:2.4.1+dfsg1-1 intel-media-va-driver:22.3.1+dfsg1-1ubuntu1 liba52-0.7.4:0.7.4-20 libaa1:1.4p5-50build1 libaacs0:0.11.1-1 libass9:1:0.15.2-1 libasyncns0:0.8-6build2 libaudio2:1.9.4-7build1 libavcodec58:7:4.4.2-0ubuntu0.22.04.1 libavformat58:7:4.4.2-0ubuntu0.22.04.1 libavutil56:7:4.4.2-0ubuntu0.22.04.1 libbdplus0:0.2.0-1 libbluray2:1:1.3.1-1 libbs2b0:3.1.0+dfsg-2.2build1 libcaca0:0.99.beta19-2.2ubuntu4 libcdio-cdda2:10.2+2.0.0-1build3 libcdio-paranoia2:10.2+2.0.0-1build3 libcdio19:2.1.0-3build1 libchromaprint1:1.5.1-2 libcodec2-1.0:1.0.1-3 libdca0:0.0.7-2 libdrm-intel1:2.4.110-1ubuntu1 libdv4:1.0.0-14build1 libdvdnav4:6.1.1-1 libdvdread8:6.1.2-1 libegl-mesa0:22.0.5-0ubuntu0.1 libegl1:1.4.0-1 libenca0:1.19-1 libfaad2:2.10.0-2 libflac8:1.3.3-2build2 libgbm-dev[22.0.1-1ubuntu2.1] libgbm1[22.0.1-1ubuntu2.1] libgl1-mesa-dri[22.0.1-1ubuntu2.1] libglapi-mesa[22.0.1-1ubuntu2.1] libglx-mesa0[22.0.1-1ubuntu2.1] libgme0:0.6.3-2 libgsm1:1.0.19-1 libigdgmm12:22.1.2+ds1-1 libjack-jackd2-0:1.9.20~dfsg-1 libldb2:2:2.4.4-0ubuntu0.1 liblirc-client0:0.10.1-6.3ubuntu1 libmad0:0.15.1b-10ubuntu1 libmfx1:22.3.0-1 libmng2:2.0.3+dfsg-3 libmp3lame0:3.100-3build2 libmpeg2-4:0.5.1-9 libmpg123-0:1.29.3-1build1 libogg0:1.3.5-0ubuntu3 libopenal-data:1:1.19.1-2build3 libopenal1:1:1.19.1-2build3 libopenmpt0:0.6.1-1 libopus0:1.3.1-0.1build2 libpciaccess0:0.16-3 libpostproc55:7:4.4.2-0ubuntu0.22.04.1 libpulse0:1:15.99.1+dfsg1-1ubuntu1 libsamplerate0:0.2.2-1build1 libsdl1.2debian:1.2.15+dfsg2-6 libshine3:3.1.1-2 libsmbclient:2:4.15.9+dfsg-0ubuntu0.2 libsndfile1:1.0.31-2build1 libsndio7.0:1.8.1-1.1 libsoxr0:0.1.3-4build2 libspeex1:1.2~rc1.2-1.1ubuntu3 libsrt1.4-gnutls:1.4.4-4 libssh-gcrypt-4:0.9.6-2build1 libswresample3:7:4.4.2-0ubuntu0.22.04.1 libswscale5:7:4.4.2-0ubuntu0.22.04.1 libtdb1:1.4.5-2build1 libtheora0:1.1.1+dfsg.1-15ubuntu4 libtwolame0:0.4.0-2build2 libudfread0:1.1.2-1 libva-drm2:2.14.0-1 libva-x11-2:2.14.0-1 libva2:2.14.0-1 libvdpau1:1.4-3build2 libvorbis0a:1.3.7-1build2 libvorbisenc2:1.3.7-1build2 libvorbisfile3:1.3.7-1build2 libvorbisidec1:1.2.1+git20180316-7 libvpx7:1.11.0-2ubuntu2 libwbclient0[2:4.15.5~dfsg-0ubuntu5] libx264-163:2:0.163.3060+git5db6aa6-2build1 libxv1:2:1.0.11-1build2 libxvidcore4:2:1.3.7-1 libxvmc1:2:1.0.12-2build2 libxxf86dga1:2:1.1.5-0ubuntu3 libzvbi-common:0.2.35-19 libzvbi0:0.2.35-19 mesa-va-drivers:22.0.5-0ubuntu0.1 mesa-vdpau-drivers:22.0.5-0ubuntu0.1 ocl-icd-libopencl1:2.2.14-3 python3-ldb:2:2.4.4-0ubuntu0.1 python3-talloc:2.3.3-2build1 samba-libs:2:4.15.9+dfsg-0ubuntu0.2 va-driver-all:2.14.0-1 vdpau-driver-all:1.4-3build2
2022-08-08T05:13:09.9122778Z 10:58:09   * Installing...
2022-08-08T05:13:26.2442255Z done.
2022-08-08T05:13:26.2464901Z 10:58:26   * Caching mplayer to /home/runner/cache-apt-pkgs/mplayer:2:1.4+ds1-3build1.tar.gz...
2022-08-08T05:13:26.5189573Z 10:58:26 done (compressed size 2.4M).
2022-08-08T05:13:26.5215057Z 10:58:26   * Caching i965-va-driver to /home/runner/cache-apt-pkgs/i965-va-driver:2.4.1+dfsg1-1.tar.gz...
2022-08-08T05:13:26.6219647Z 10:58:26 done (compressed size 416K).
2022-08-08T05:13:26.6236659Z 10:58:26   * Caching intel-media-va-driver to /home/runner/cache-apt-pkgs/intel-media-va-driver:22.3.1+dfsg1-1ubuntu1.tar.gz...
2022-08-08T05:13:27.1082674Z 10:58:27 done (compressed size 2.9M).
2022-08-08T05:13:27.1105247Z 10:58:27   * Caching liba52-0.7.4 to /home/runner/cache-apt-pkgs/liba52-0.7.4:0.7.4-20.tar.gz...
2022-08-08T05:13:27.1363232Z 10:58:27 done (compressed size 36K).
2022-08-08T05:13:27.1395126Z 10:58:27   * Caching libaa1 to /home/runner/cache-apt-pkgs/libaa1:1.4p5-50build1.tar.gz...
2022-08-08T05:13:27.1663143Z 10:58:27 done (compressed size 56K).
2022-08-08T05:13:27.1683071Z 10:58:27   * Caching libaacs0 to /home/runner/cache-apt-pkgs/libaacs0:0.11.1-1.tar.gz...
2022-08-08T05:13:27.1996591Z 10:58:27 done (compressed size 68K).
2022-08-08T05:13:27.2022599Z 10:58:27   * Caching libass9 to /home/runner/cache-apt-pkgs/libass9:1:0.15.2-1.tar.gz...
2022-08-08T05:13:27.2383166Z 10:58:27 done (compressed size 104K).
2022-08-08T05:13:27.2402007Z 10:58:27   * Caching libasyncns0 to /home/runner/cache-apt-pkgs/libasyncns0:0.8-6build2.tar.gz...
2022-08-08T05:13:27.2622723Z 10:58:27 done (compressed size 16K).
2022-08-08T05:13:27.2643109Z 10:58:27   * Caching libaudio2 to /home/runner/cache-apt-pkgs/libaudio2:1.9.4-7build1.tar.gz...
2022-08-08T05:13:27.2948665Z 10:58:27 done (compressed size 56K).
2022-08-08T05:13:27.2969543Z 10:58:27   * Caching libavcodec58 to /home/runner/cache-apt-pkgs/libavcodec58:7:4.4.2-0ubuntu0.22.04.1.tar.gz...
2022-08-08T05:13:28.0262111Z 10:58:28 done (compressed size 6.2M).
2022-08-08T05:13:28.0280335Z 10:58:28   * Caching libavformat58 to /home/runner/cache-apt-pkgs/libavformat58:7:4.4.2-0ubuntu0.22.04.1.tar.gz...
2022-08-08T05:13:28.2306168Z 10:58:28 done (compressed size 1.2M).
2022-08-08T05:13:28.2330311Z 10:58:28   * Caching libavutil56 to /home/runner/cache-apt-pkgs/libavutil56:7:4.4.2-0ubuntu0.22.04.1.tar.gz...
2022-08-08T05:13:28.3193149Z 10:58:28 done (compressed size 308K).
2022-08-08T05:13:28.3224152Z 10:58:28   * Caching libbdplus0 to /home/runner/cache-apt-pkgs/libbdplus0:0.2.0-1.tar.gz...
2022-08-08T05:13:28.3667595Z 10:58:28 done (compressed size 56K).
2022-08-08T05:13:28.3692976Z 10:58:28   * Caching libbluray2 to /home/runner/cache-apt-pkgs/libbluray2:1:1.3.1-1.tar.gz...
2022-08-08T05:13:28.4341687Z 10:58:28 done (compressed size 168K).
2022-08-08T05:13:28.4364114Z 10:58:28   * Caching libbs2b0 to /home/runner/cache-apt-pkgs/libbs2b0:3.1.0+dfsg-2.2build1.tar.gz...
2022-08-08T05:13:28.4690263Z 10:58:28 done (compressed size 12K).
2022-08-08T05:13:28.4716479Z 10:58:28   * Caching libcaca0 to /home/runner/cache-apt-pkgs/libcaca0:0.99.beta19-2.2ubuntu4.tar.gz...
2022-08-08T05:13:28.5573459Z 10:58:28 done (compressed size 248K).
2022-08-08T05:13:28.5593740Z 10:58:28   * Caching libcdio-cdda2 to /home/runner/cache-apt-pkgs/libcdio-cdda2:10.2+2.0.0-1build3.tar.gz...
2022-08-08T05:13:28.5847637Z 10:58:28 done (compressed size 20K).
2022-08-08T05:13:28.5870607Z 10:58:28   * Caching libcdio-paranoia2 to /home/runner/cache-apt-pkgs/libcdio-paranoia2:10.2+2.0.0-1build3.tar.gz...
2022-08-08T05:13:28.6167841Z 10:58:28 done (compressed size 16K).
2022-08-08T05:13:28.6185849Z 10:58:28   * Caching libcdio19 to /home/runner/cache-apt-pkgs/libcdio19:2.1.0-3build1.tar.gz...
2022-08-08T05:13:28.6556979Z 10:58:28 done (compressed size 68K).
2022-08-08T05:13:28.6578573Z 10:58:28   * Caching libchromaprint1 to /home/runner/cache-apt-pkgs/libchromaprint1:1.5.1-2.tar.gz...
2022-08-08T05:13:28.6832979Z 10:58:28 done (compressed size 32K).
2022-08-08T05:13:28.6847714Z 10:58:28   * Caching libcodec2-1.0 to /home/runner/cache-apt-pkgs/libcodec2-1.0:1.0.1-3.tar.gz...
2022-08-08T05:13:29.3547147Z 10:58:29 done (compressed size 8.8M).
2022-08-08T05:13:29.3566637Z 10:58:29   * Caching libdca0 to /home/runner/cache-apt-pkgs/libdca0:0.0.7-2.tar.gz...
2022-08-08T05:13:29.3887484Z 10:58:29 done (compressed size 100K).
2022-08-08T05:13:29.3907386Z 10:58:29   * Caching libdrm-intel1 to /home/runner/cache-apt-pkgs/libdrm-intel1:2.4.110-1ubuntu1.tar.gz...
2022-08-08T05:13:29.4595952Z 10:58:29 done (compressed size 72K).
2022-08-08T05:13:29.4616502Z 10:58:29   * Caching libdv4 to /home/runner/cache-apt-pkgs/libdv4:1.0.0-14build1.tar.gz...
2022-08-08T05:13:29.4914693Z 10:58:29 done (compressed size 64K).
2022-08-08T05:13:29.4964060Z 10:58:29   * Caching libdvdnav4 to /home/runner/cache-apt-pkgs/libdvdnav4:6.1.1-1.tar.gz...
2022-08-08T05:13:29.5246762Z 10:58:29 done (compressed size 40K).
2022-08-08T05:13:29.5266169Z 10:58:29   * Caching libdvdread8 to /home/runner/cache-apt-pkgs/libdvdread8:6.1.2-1.tar.gz...
2022-08-08T05:13:29.5577982Z 10:58:29 done (compressed size 60K).
2022-08-08T05:13:29.5596542Z 10:58:29   * Caching libegl-mesa0 to /home/runner/cache-apt-pkgs/libegl-mesa0:22.0.5-0ubuntu0.1.tar.gz...
2022-08-08T05:13:29.6061392Z 10:58:29 done (compressed size 120K).
2022-08-08T05:13:29.6082229Z 10:58:29   * Caching libegl1 to /home/runner/cache-apt-pkgs/libegl1:1.4.0-1.tar.gz...
2022-08-08T05:13:29.6589548Z 10:58:29 done (compressed size 32K).
2022-08-08T05:13:29.6613221Z 10:58:29   * Caching libenca0 to /home/runner/cache-apt-pkgs/libenca0:1.19-1.tar.gz...
2022-08-08T05:13:29.6971647Z 10:58:29 done (compressed size 68K).
2022-08-08T05:13:29.6995042Z 10:58:29   * Caching libfaad2 to /home/runner/cache-apt-pkgs/libfaad2:2.10.0-2.tar.gz...
2022-08-08T05:13:29.7548221Z 10:58:29 done (compressed size 320K).
2022-08-08T05:13:29.7564606Z 10:58:29   * Caching libflac8 to /home/runner/cache-apt-pkgs/libflac8:1.3.3-2build2.tar.gz...
2022-08-08T05:13:29.7909443Z 10:58:29 done (compressed size 116K).
2022-08-08T05:13:29.7997422Z 
2022-08-08T05:13:29.7998327Z WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2022-08-08T05:13:29.7998835Z 
2022-08-08T05:13:30.0218692Z E: No packages found
2022-08-08T05:13:30.0258948Z 10:58:30   * Caching libgbm-dev[22.0.1-1ubuntu2.1] to /home/runner/cache-apt-pkgs/libgbm-dev[22.0.1-1ubuntu2.1].tar.gz...
2022-08-08T05:13:30.0501360Z dpkg-query: error: --listfiles needs a valid package name but 'libgbm-dev[22.0.1-1ubuntu2.1]' is not: illegal package name in specifier 'libgbm-dev[22.0.1-1ubuntu2.1]': character '[' not allowed (only letters, digits and characters '-+._')
2022-08-08T05:13:30.0501868Z 
2022-08-08T05:13:30.0502398Z Use --help for help about querying packages.
2022-08-08T05:13:30.0530376Z tar: Cowardly refusing to create an empty archive
2022-08-08T05:13:30.0531002Z Try 'tar --help' or 'tar --usage' for more information.
2022-08-08T05:13:30.0573850Z ##[error]Process completed with exit code 123.
awalsh128 commented 2 years ago

Hey @tamascsaba, try using the action at latest again. It was on an older rev. It may still be an issue but I'd like to see the latest results because a lot was revamped. Include the logs too please, thanks.

awalsh128 commented 2 years ago

I put it as a test on the CI and it completes successfully. https://github.com/awalsh128/cache-apt-pkgs-action-ci/runs/7800343992?check_suite_focus=true

Although it isn't pulling in the same dependencies. If you are still seeing failures, could you also share the OS distro you are using? I am testing against ubuntu-latest.

awalsh128 commented 2 years ago

Going to close this out. Feel free to open if it is still a problem.