Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.

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 David Thurstenson (thurstylark) - Wednesday, 27 April 2022, 20:51 GMT
Task Type Feature Request
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version 6.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No



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 <>" 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