Source download with custom `DLAGENTS` fails in clean chroot
In some cases, sources need to be downloaded with a custom downloader, usually curl
or wget
. This can be done by specifying DLAGENTS
(e.g. DLAGENTS=("https::/usr/bin/wget -U "Mozilla" %u")
). For this to work, the called command (wget
in the example) has to be available.
However, sources are downloaded outside the chroot. This means that the command used in DLAGENTS
is the one on the host system - where it has to be installed. curl
sort of works since it's a dependency of pacman
(and therefore in base), but wget
just fails.
This issue happens with the genymotion
package:
==> Retrieving sources...
-> Found genymotion.desktop
==> ERROR: The download program wget is not installed.
Aborting...
==> ERROR: Could not download sources.
Steps to reproduce
- Uninstall
wget
or set up system withoutwget
installed. - Build
genymotion
in a clean chroot. - Build fails while downloading sources due to
wget
not being installed.
Analysis
wget
is declared in makedepends
, so it works when using makepkg -s
as it first installs dependencies, and only afterwards downloads the sources.
The relevant code in devtools
is src/makechrootpkg.in#L250. devtools
does not use makepkg -s
when downloading and verifying the sources.
Possible solutions
The easy workaround is to just manually install wget
or the missing software on the host system. Not pretty, but works.
Of course, devtools
must not install programs (wget
) on the host, so using makepkg -s
to automate this is not feasible.
The proper solution likely involves chroots in some form to first install the dependencies and then download the sources, like makepkg
does. The script in DLAGENTS
has complete access to the host system. Putting the download into the chroot
means that the sources aren't automatically saved on the host system - though devtools
might elect to copy the sources instead.
If you have questions or can't reproduce the issue, please let me know. Suggestions to solve this issue are always welcome.
-- Vekhir