Mirrorlist trigger generates broken PKGBUILD
Closed this issue · 2 comments
Summary
The mirrorlist trigger seemingly generates a broken PKGBUILD.
Steps to reproduce
- Supply the following config:
[mirrorlist]
target = mirrorlist_generator
[mirrorlist_generator]
description = Chaotic-AUR mirrorlist
homepage = https://aur.chaotic.cx
servers = https://geo-mirror.chaotic.cx/$repo/$arch
package = chaotic-mirrorlist
path = /etc/pacman.d/chaotic-mirrorlist
- Run
ahriman add --now chaotic-mirrorlist
- Observe the error
Expected behavior
Have the mirrorlist built successfully.
Logs
[ahriman@9ced5ab24909 /]$ ahriman add --now chaotic-mirrorlist
[ERROR 2023-08-15 10:35:54,235] [stderr]: process exception
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/ahriman/application/handlers/handler.py", line 100, in call
cls.run(args, architecture, configuration, report=args.report)
File "/usr/lib/python3.11/site-packages/ahriman/application/handlers/add.py", line 46, in run
application.add(args.package, args.source, args.username)
File "/usr/lib/python3.11/site-packages/ahriman/application/application/application_packages.py", line 150, in add
fn(name, username)
File "/usr/lib/python3.11/site-packages/ahriman/application/application/application_packages.py", line 101, in _add_local
package = Package.from_build(source_dir, self.architecture, username)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/ahriman/models/package.py", line 263, in from_build
srcinfo_source = Package._check_output("makepkg", "--printsrcinfo", cwd=path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/ahriman/core/util.py", line 150, in check_output
raise subprocess.CalledProcessError(status_code, process.args)
subprocess.CalledProcessError: Command '('makepkg', '--printsrcinfo')' returned non-zero exit status 12.
Version is latest ahriman:edge
container.
The generated PKGBUILD looks as follows:
pkgrel=1
arch=(any)
license=(Unlicense)
pkgdesc='Chaotic-AUR PGP keyring'
pkgname=chaotic-keyring
pkgver=20230815
url=https://aur.chaotic.cx
install=chaotic-keyring.install
package() {
install -Dm644 "$srcdir/chaotic-aur.gpg" "$pkgdir/usr/share/pacman/keyrings/chaotic-aur.gpg"
install -Dm644 "$srcdir/chaotic-aur-revoked" "$pkgdir/usr/share/pacman/keyrings/chaotic-aur-revoked"
install -Dm644 "$srcdir/chaotic-aur-trusted" "$pkgdir/usr/share/pacman/keyrings/chaotic-aur-trusted"
}
source=(chaotic-aur-revoked chaotic-aur-trusted chaotic-aur.gpg)
sha512sums=(cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 7102597cdb29e266b8b2d1f4b23258cabd4d5911fcd05cfd1189d04249cb7e7dc033fdecf564eec78828dd5fe0e4392588c368103c5d9a62fb9a9682a56f2ea2 564ceb8e219543c9c4fdf559ea9140f1d30f3f3d5148148e9e76ca41b609a24fb1b8c0adaf5f621bde7adbb901be0c3e9495fc073018c69911505c036e2766f7)
license=(Unlicense)
pkgdesc='Chaotic-AUR mirrorlist'
pkgname=chaotic-mirrorlist
pkgver=20230815
url=https://aur.chaotic.cx
backup=(etc/pacman.d/chaotic-mirrorlist)
package() {
install -Dm644 "$srcdir/mirrorlist" "$pkgdir/etc/pacman.d/chaotic-mirrorlist"
}
source=(mirrorlist)
sha512sums=(ef01757175d06bacd99da08e9e9a48e7f4b7fe8f86e366b33bfbc120ddae3e40f9e6c444b9c0edaea1553c991a5120f238a6f9976c6449435862aee6a6624c39)
oh btw I found misconfiguration in your links before (highlighted)
triggers = ahriman.core.gitremote.RemotePullTrigger *ahriman.core.support.KeyringTrigger ahriman.core.support.MirrorlistTrigger* ahriman.core.report.ReportTrigger
I don't think it is something you really wanted to do, because it literally says that KeyringTrigger
and MirrorlistTrigger
must be generated on each application run. Well at least current preview of these features aren't supposed to work like it, it is just manual run repo-create-mirrorlist
or whatever, just before you would like to build.
The main issue from my point of view here is that package will be automatically generated (at least version bump)
Also I'd say that you have both keyring_generator.package
and mirrorlist_generator.package
pointing to the same package, which generates this pkgbuild. And after that it leads to some files (e.g. install) being removed, though they are referenced in PKGBUILD
Oh! I was not aware of that, but makes perfect sense thinking about it.
After removing the triggers, the PKGBUILD is now correctly created. Seems I'm to blame here 😅