FS#74547 - [devtools/pacman] parallel builds may error because the cache directory is shared

Attached to Project: Pacman
Opened by lilydjwg (lilydjwg) - Sunday, 24 April 2022, 03:37 GMT
Last edited by Allan McRae (Allan) - Saturday, 02 September 2023, 11:42 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version 6.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

When building multiple packages at the same time, they may download the same package at the same time. One of them gets the error like:

error: wcslib: signature from "Antonio Rojas <arojas@archlinux.org>" is invalid
:: File /var/cache/pacman/pkg/wcslib-7.10-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

The other gets:

wcslib-7.10-1-x86_64.pkg.tar.zst failed to downloaderror: could not rename /var/cache/pacman/pkg/wcslib-7.10-1-x86_64.pkg.tar.zst.part to /var/cache/pacman/pkg/wcslib-7.10-1-x86_64.pkg.tar.zst (No such file or directory)
warning: failed to retrieve some files
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

This happens because the latter curl finds that a partially downloaded file exists, and uses O_APPEND to write to the file.

I suggest pacman to hold a flock during download in the cache directory and wait until it unlocks.
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 02 September 2023, 11:42 GMT
Reason for closing:  Duplicate
Additional comments about closing:  FS#23501

Loading...