kpcyrd / rebuilderd

Independent verification of binary packages - reproducible builds
GNU General Public License v3.0
352 stars 23 forks source link

rebuilderd-sync with local repo? #143

Closed iyanmv closed 10 months ago

iyanmv commented 10 months ago

Hi,

I'm trying to configure rebuilderd to fetch packages from a local repo I keep with paru.

This is my /etc/rebuilderd-sync.conf

## rebuild all of archlinux core
[profile."archlinux-core"]
distro = "archlinux"
suite = "core"
architectures = ["x86_64"]
source = "https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch"

## packages I maintain in AUR (and their dependencies)
[profile."iyanmv-aur"]
distro = "archlinux"
suite = "iyanmv"
architectures = ["x86_64"]
source = "/home/iyan/ArchLinux/repos/iyanmv/os/x86_64"

And this is the error I get when trying to start the service

× rebuilderd-sync@iyanmv-aur.service - rebuilderctl sync: periodically import packages
     Loaded: loaded (/usr/lib/systemd/system/rebuilderd-sync@.service; static)
     Active: failed (Result: exit-code) since Sat 2023-11-11 21:05:21 CET; 4min 58s ago
   Duration: 16ms
TriggeredBy: ● rebuilderd-sync@iyanmv-aur.timer
    Process: 1536333 ExecStart=/usr/bin/rebuildctl pkgs sync-profile iyanmv-aur (code=exited, status=1/FAILURE)
   Main PID: 1536333 (code=exited, status=1/FAILURE)
        CPU: 18ms

Nov 11 21:05:21 ilum systemd[1]: Started rebuilderctl sync: periodically import packages.
Nov 11 21:05:21 ilum rebuildctl[1536333]: [2023-11-11T20:05:21Z INFO  rebuildctl::schedule] Reading "/home/iyan/ArchLinux/repos/iyanmv/os/x86_64/iyanmv.db"...
Nov 11 21:05:21 ilum rebuildctl[1536333]: Error: Permission denied (os error 13)
Nov 11 21:05:21 ilum systemd[1]: rebuilderd-sync@iyanmv-aur.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 21:05:21 ilum systemd[1]: rebuilderd-sync@iyanmv-aur.service: Failed with result 'exit-code'.

Since I couldn't find in the documentation how to configure sources to use local repos I also tried following the /etc/pacman.conf syntax, i.e.,

source = "file:///home/iyan/ArchLinux/repos/iyanmv/os/x86_64"

But that also didn't work. The error I get in that case is:

× rebuilderd-sync@iyanmv-aur.service - rebuilderctl sync: periodically import packages
     Loaded: loaded (/usr/lib/systemd/system/rebuilderd-sync@.service; static)
     Active: failed (Result: exit-code) since Sat 2023-11-11 21:13:10 CET; 2s ago
   Duration: 17ms
TriggeredBy: ● rebuilderd-sync@iyanmv-aur.timer
    Process: 1538385 ExecStart=/usr/bin/rebuildctl pkgs sync-profile iyanmv-aur (code=exited, status=1/FAILURE)
   Main PID: 1538385 (code=exited, status=1/FAILURE)
        CPU: 19ms

Nov 11 21:13:10 ilum systemd[1]: Started rebuilderctl sync: periodically import packages.
Nov 11 21:13:10 ilum rebuildctl[1538385]: [2023-11-11T20:13:10Z INFO  rebuildctl::schedule] Reading "file:///home/iyan/ArchLinux/repos/iyanmv/os/x86_64/iyanmv.db"...
Nov 11 21:13:10 ilum rebuildctl[1538385]: Error: No such file or directory (os error 2)
Nov 11 21:13:10 ilum systemd[1]: rebuilderd-sync@iyanmv-aur.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 21:13:10 ilum systemd[1]: rebuilderd-sync@iyanmv-aur.service: Failed with result 'exit-code'.

So I guess the first option is the correct one, but there seems to be some permissions issue. Am I doing something wrong or is this an issue to be fixed here?

kpcyrd commented 10 months ago

This won't work unfortunately (even if rebuilderd can open the package database), rebuilderd uses archlinux-repro which is specific to Arch Linux and will attempt to fetch the PKGBUILD from gitlab.archlinux.org:archlinux/packaging/packages/${pkgbase}.

You would need an aur-repro tool that does:

If the package has dependencies from your paru repository:

iyanmv commented 10 months ago

Oh, I see... it's more complicated than I thought. Thanks for the explanation. I was not interested in being able to reproduce arbitrary old versions of my packages, just the last one. I will try a more manual setup.

kpcyrd commented 10 months ago

I've experimented with this and uploaded https://github.com/kpcyrd/aur-repro

iyanmv commented 10 months ago

Cool! I will try it