← Back to issue list

repo: use debian.arfile instead of dpkg-deb

View original Github issue

Metadata

Project
snapcraft
Number
#1878
Type
pull request
State
merged
Author
kalikiana
Labels
—
Created
Updated
Closed

Current evaluation

Merged as commit fa287bec3: snapcraft/internal/sources/_deb.py stopped shelling out to dpkg-deb and used debian.arfile to extract debs, avoiding tar/sshfs utime failures. Later reverted by #2111 (c008b93be).

Resolution: closed resolved

Reason: PR #1878 was approved and merged into master as commit fa287bec3 (+3/-7 in snapcraft/internal/sources/_deb.py), porting the existing debian.arfile approach from sources to the repo plugin to work around a tar-over-sshfs dpkg-deb bug. The change shipped successfully, though a follow-up rollback PR (#2111, c008b93be) later restored dpkg-deb due to extraction slowdowns.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? ----- $ cd snapcraft/tests/integration/snaps/python-hello $ SNAPCRAFT_CONTAINER_BUILDS=<remote> snapcraft tar: ./usr/bin/pdb3.5: Cannot utime: No such file or directory tar: ./usr/share/doc/python3.5/changelog.Debian.gz: Cannot utime: No such file or directory tar: Exiting with failure status due to previous errors dpkg-deb: error: subprocess tar returned error exit status 2 Error while provisioning '/home/cris/build_python-hello/parts/python- part/ubuntu/download/python3.5_3.5.2-2ubuntu0~16.04.4_amd64.deb' From my research it seems to be a bug concerning tar, which dpkg-deb is using, in combination with sshfs and the wrong libc. [See the references here](https://github.com/ValveSoftware/steam-for-linux/issues/2358). We're already using debian.arfile in `snapcraft/internal/sources/_deb.py` which is doing pretty much the same thing, except it's not hitting the bug, so I'm porting repo to the same approach.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged as commit fa287bec3: snapcraft/internal/sources/_deb.py stopped shelling out to dpkg-deb and used debian.arfile to extract debs, avoiding tar/sshfs utime failures. Later reverted by #2111 (c008b93be).
stealth/space-bunny-alpha — closed resolved Merged in fa287bec3: repo sources switched from shelling out to dpkg-deb to native debian.arfile extraction, fixing tar/sshfs provisioning errors. Later rolled back by #2111 (c008b93be) on build performance grounds.
stealth/space-bunny-alpha — closed resolved Merged in #1878 (fa287bec3), replacing dpkg-deb with debian.arfile in repo sources to avoid tar/sshfs failures; #2111 later reverted it because extraction caused severe build performance regressions.
stealth/space-bunny-alpha — closed resolved Merged as fa287bec3 (#1878), switching repo DEB extraction from dpkg-deb to debian.arfile; later reverted by #2111 after severe build performance regressions.
qwen/qwen3.6-35b-a3b — — Merged a fix replacing dpkg-deb with debian.arfile in the repo source handler to bypass a tar and sshfs bug. Reviewers approved the change and suggested extracting shared extraction logic in a follow-up.
qwen3.6-35b-a3b-mtp-q6 — — Replaced dpkg-deb with debian.arfile in the repo module to fix a tar and sshfs compatibility bug. Reviewers suggested extracting shared logic, but the change was merged as-is.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#2111 (confidence 95%)

    Merged rollback commit c008b93be reverted fa287bec3, restoring dpkg-deb for deb extraction after debian.arfile caused severe build slowdowns (fixes LP #1767119).

  • Related To: snapcraft#1729 (confidence 70%)

    Earlier commit ff83bf338 'sources: use arfile to extract debs' introduced the debian.arfile approach that #1878 ported to the repo plugin.

Related issues

Issue Project State Summary Similarity
#2111 repo: rollback to using dpkg-deb for deb extraction snapcraft merged Merged as commit c008b93be: reverts fa287bec3 (#1878), restoring dpkg-deb for deb extraction after debian.arfile caused severe build slowdowns (18s vs 5m10s pull). Fixes LP #1767119.
79%
#1729 sources: use arfile to extract debs snapcraft merged Merged as commit ff83bf338: _deb.py now uses debian.arfile.ArFile to extract data.tar* from .deb sources instead of DebFile, fixing LP: #1731478 where apt_inst import broke non-Debian hosts.
75%
#3083 repo: revert logic to get deb_arch snapcraft merged Merged #3083 as 5d20937cb, reverting host-side deb_arch lookup to avoid requiring dpkg-architecture before entering the build environment (SNAPCRAFT-1K1).
72%