FS#72980 - CheckSpace doesn't honor NoExtract

Attached to Project: Pacman
Opened by Clar Fon (lightdark) - Saturday, 11 December 2021, 12:47 GMT
Task Type Bug Report
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 6.0.0
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Summary and Info:

CheckSpace will currently check filesystems for all files in packages, regardless of NoExtract directives. The particular case I discovered this was for a docker container when the filesystem package needed to be updated; since Docker mounts /etc/hosts and /etc/resolv.conf read-only, pacman would refuse to update even if those files were added to NoExtract.

Steps to Reproduce:

Minimal test Dockerfile for the example I ran into:

FROM archlinux:base-devel-20211205.0.40756

RUN echo -e '[options]NoExtract=etc/hosts\nNoExtract=etc/resolv.conf\nCheckSpace' >> /etc/pacman.conf
RUN pacman -Syu filesystem --noconfirm
This task depends upon

Comment by Allan McRae (Allan) - Saturday, 11 December 2021, 13:12 GMT
What is the actual error message. Even better if you provide --debug output.
Comment by Clar Fon (lightdark) - Sunday, 12 December 2021, 01:16 GMT
Sure; I've attached a full log for the below dockerfile:

FROM archlinux:base-devel-20211205.0.40756

RUN echo -e '[options]NoExtract=etc/hosts\nNoExtract=etc/resolv.conf\nCheckSpace' >> /etc/pacman.conf
RUN pacman-key --init && pacman-key --populate archlinux
RUN pacman -Syu filesystem --noconfirm --debug


The relevant lines:

debug: loading fsinfo for /
debug: loading fsinfo for /etc/hosts
debug: loading fsinfo for /etc/resolv.conf
error: Partition /etc/resolv.conf is mounted read only
error: Partition /etc/hosts is mounted read only
debug: partition /, needed 0, cushion 161, free 2932631
debug: returning error 7 from _alpm_check_diskspace (../lib/libalpm/diskspace.c: 498) : not enough free disk space
error: not enough free disk space
error: failed to commit transaction (not enough free disk space)


Note: I'm not sure if the disk space check is taking into account the reduced space requirements from NoExtract files, although my specific issue is the read-only volume check. Both could be an issue.
   build.log (25.8 KiB)

Loading...