void-linux / xbps

The X Binary Package System (XBPS)
https://voidlinux.org/xbps/
Other
821 stars 124 forks source link

INSTALL scripts cannot be unpacked without /tmp existing #566

Open classabbyamp opened 1 year ago

classabbyamp commented 1 year ago

noticed this when building the infra-nginx container:

#0 3.145 ERROR: nginx-1.24.0_1: [unpack] INSTALL script failed to execute pre ACTION: No such file or directory
#0 3.145 ERROR: nginx-1.24.0_1: [unpack] failed to unpack files from archive: No such file or directory

with debug on:

[*] Unpacking packages
nginx-1.24.0_1: unpacking ...
[DEBUG] xbps_pkg_exec_buffer: mkstemp No such file or directory
ERROR: nginx-1.24.0_1: [unpack] INSTALL script failed to execute pre ACTION: No such file or directory
ERROR: nginx-1.24.0_1: [unpack] failed to unpack files from archive: No such file or directory
[DEBUG] [trans] failed to unpack nginx-1.24.0_1: No such file or directory

eventually discovered it was caused by /tmp not existing in the container, so xbps could not use mkstemp when extracting the INSTALL script. This can then affect more dirs if trying to install/reconfigure base-files without /tmp existing, as it won't unpack the INSTALL script that creates dirs like /boot, /home, etc

https://github.com/void-linux/xbps/blob/e2ab72082e59f572ee5cae9f8aa3ddbc56a3017c/lib/package_script.c#L82-L87