xbps-src binary-bootstrap fails
System
- xuname:
Void 5.4.10_2 x86_64 AuthenticAMD - package:
xbps-0.57.1_8 (xbps-src ->glic-locales, ca-certificates)
Expected behavior
xbps-src binary-bootstrap should complete without error
Actual behavior
For the last 2 weeks or more, with newly git-cloned void-packages, I find that ./xbps-src binary-bootstrap fails with errors in the INSTALL scripts for glibc-locales and ca-certificates as follows:
ERROR: glibc-locales: [configure] INSTALL script failed to execute the post ACTION: No such file or directory
Failed to reconfigure `glibc-locales': No such file or directory
ca-certificates: configuring ...
ERROR: ca-certificates: [configure] INSTALL script failed to execute the post ACTION: No such file or directory
Failed to reconfigure `ca-certificates': No such file or directory
It seems the missing file may be a useable /tmp directory. I have created a temporary work-around by creating a void-packages/masterdir/tmp directory:
cd void-packages
./xbps-src zap
mkdir masterdir/tmp
./xbps-src binary-bootstrap
This succeeds as expected.
Works for me, any more details?
At the moment I have limited time to devote to this, and do not yet know if there are new expectations for a "tmp" directory in the scripts, or whether the tmp directory was previously created somehow in void-packages, and this no longer occurs.
please try
mkdir -p gh18282-host gh18282-master
./xbps-src -H gh18282-host -m gh18282-master binary-bootstrap
Works here here.
Maybe you corrupted your masterdir? Did you work from current (back when, you opened this issue) master?
I just realized I failed to list this with my errors, which is what prompted the work-around:
=> xbps-src: removing autodeps, please wait... mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': No such file or directory
Error still occurs after trying your suggested steps above. Initial error occurred on pristine new install. Occurs on my older Void partition as well, but did not occur before sometime near the end of 2019. I reproduced again today on new install:
xbps-install -Su
xbps-install xtools
cd /usr/local/builds
git clone https://github.com/void-linux/void-packages
cd void-packages
./xbps-src binary-bootstrap
Error Occurs.
./xbps-src zap
./xbps-src binary-bootstrap
Error Occurs.
cd ..
rm -R void-packages
git clone https://github.com/void-linux/void-packages
cd void-packages
./xbps-src binary-bootstrap
Error Occurs.
mkdir -p gh18282-host gh18282-master
./xbps-src -H gh18282-host -m gh18282-master binary-bootstrap
Error Occurs. I am very curious why you do not experience it. I know I am not quite the only one.
Yes. See comments above.
/bin/bash -x xbps-src binary-bootstrap causes readlink to resolve incorrectly.
/bin/bash -x ./xbps-src binary-bootstrap output is here:
https://pastebin.com/kJ0aVDEZ
I don't know where mktemp is called, neither glibc-locales or ca-certificates INSTALL scripts use it explicitly, but assume it must be called from within the chroot, since it expects /tmp to exist, and can not find it. mktemp works fine for me outside of chroot. xbps-src "zaps" and "cleans" the "masterdir/tmp" directory, but never creates it. For some reason, I need to create it now, and this resolves all errors..
I noticed that binary-bootstrap fails with this error if it is invoked from uid 0.
Thank you. I confirm that the error only occurs when run as uid 0. This is still true even if I (unwisely) test a change of all permissions in ..void-packages to 777. In the past this did not occur, and I have run xbps-src as root mostly because of the convenience of automatically building some packages from within a custom Void install script.
Likely explanations that come to my mind should not have been solved by the creation of a masterdir/tmp directory, as is the case, so more insights are welcome. I accept the will of the maintainers if the decision is to just not allow running xbps-src as root.
running it as root is not recommended, not sure if that's a documented restriction though.
I accept the criticism. Although running as root is never recommended if avoidable, it has been tempting, and successful until recently, for me to use xbps-src within a larger Install script which MUST run with elevated privileges. This is of course easily changed. The current documentation for xbps-src has a mild statement that running it as root is not required. I had known this, but we should be aware that most "xbps-" commands require elevated privileges in common usage, so this could be a trap for the unwary.
So the maintainers have at least three basic options, if not more.
-
(1) Ignore errors that only occur running as root, and place a stronger admonition/warning in the documentation.
-
(2) Repair the xbps-src binary-bootstrap process to work for root. For now, this might be as simple as creating a "tmp" subdirectory.
-
(3) Modifying xbps-src to prevent running as uid 0.
I think one of these should happen, but not up to me. Depending on your decision, you may close this when you feel appropriate.