Closed ptr1337 closed 2 years ago
hi, thanks for asking!
To clarify, since the term "rebuild" is slightly overloaded, I'm assuming you already have a x86_64_v3
repository that you're trying to reproduce for reproducible builds. Using it to monitor and recompile a x86_64
repository into a x86_64_v3
repository is an interesting idea that might work, but it's outside of the scope of the projects involved.
Reproducing a x86_64_v3
repository works like this:
rebuildctl pkgs sync --print-json archlinux cachyos-v3 'https://mirror.cachyos.org/repo/$arch/$repo' --architecture x86_64_v3
Output:
Removing --print-json
would import the packages into rebuilderd instead of printing them to stdout. Inside of each package there's a .BUILDINFO
containing something like this:
format = 2
pkgname = wrapland-kwinft
pkgbase = wrapland-kwinft
pkgver = 5.23.0-1
pkgarch = x86_64_v3
pkgbuild_sha256sum = a05862f88aad365a9ace9b024f06a83c763e2b9ff4f1da62b54f2a17d1d8524d
packager = CachyOS <admin@cachyos.org>
builddate = 1636460102
builddir = /tmp/pkg
startdir = /tmp/pkg
buildtool = makepkg
[...]
The 5th line is pkgarch = x86_64_v3
, indicating that it needs to be built for this architecture to reproduce it.
The change to set pkgarch from the buildinfo file into makepkg.conf probably needs to be set here:
and here:
Only archlinux-repro works with rebuilderd at the moment, but it only works with packages built from Arch Linux PKGBUILDs:
Running this with a pkgbase that isn't in Arch Linux fails like this:
% asp checkout wrapland-kwinft
error: unknown package: wrapland-kwinft
If there's a pkgbase with an identical name it would then attempt to find a revision with an identical pkgbuild_sha256sum
, which would fail if the PKGBUILD was modified downstream.
You'd also need to run an archive for your downstream distro that:
1) has all current+old versions of all your packages (since they might be a build dependency for some of your packages)
2) redirects every 404 to https://archive.archlinux.org/packages/...
so you don't need to mirror all of it
You can control the archive url like this (the .pkg.tar.
at the end is intentional and not a bug):
% ARCH_ARCHIVE_CACHE='https://archive.example.com/packages' buildinfo -p wrapland-kwinft-5.23.0-1-x86_64_v3.pkg.tar.zst | head
https://archive.example.com/packages/a/acl/acl-2.3.1-1-x86_64.pkg.tar.
https://archive.example.com/packages/a/archlinux-keyring/archlinux-keyring-20211028-1-any.pkg.tar.
https://archive.example.com/packages/a/argon2/argon2-20190702-3-x86_64.pkg.tar.
https://archive.example.com/packages/a/attr/attr-2.5.1-1-x86_64.pkg.tar.
https://archive.example.com/packages/a/audit/audit-3.0.5-1-x86_64.pkg.tar.
https://archive.example.com/packages/a/autoconf/autoconf-2.71-1-any.pkg.tar.
https://archive.example.com/packages/a/automake/automake-1.16.5-1-any.pkg.tar.
https://archive.example.com/packages/a/avahi/avahi-0.8+22+gfd482a7-1-x86_64.pkg.tar.
https://archive.example.com/packages/b/base/base-2-2-any.pkg.tar.
https://archive.example.com/packages/b/bash/bash-5.1.008-1-x86_64.pkg.tar.
If you have a patched archlinux-repro
that implements this I can help integrate it in rebuilderd later (there are possibly some minor changes in rebuilderd necessary since this hasn't been done before).
Thanks!
Hey,
Thanks for your perfectly written comment!
The main goal is to provide only arch based packages with the -v3 arch since this would be the correct solution to provide the archlinux packages with optimized march, since I don’t like from other repo maintainers solution to provide the optimized packages without setting the correct architecture.
Also it would be a big extension for the arch based distro which I develop right now.
The aur packages are not needed to provide them automatically with rebuilderd.
I‘ll try to provide the needed patches.
Regards and thanks!
Hey @kpcyrd,
thanks first for your latest commit. Mostly i know how to get it patched, The only thing which i don't get it really solved, how ill get the arch the upstream arch packages, change the to arch(x86_64_v3) in the PKGBUILD, If I change it, the .SRCINFO will be wrong and it wont build it. A solution could be just adding --skipchecksums to the makeflags which is not really the goal of it.
Changing the compile flags is not the problem, also chaing the CHOST.
Hello,
First thanks for providing such a nice project.
I got a question, i saw youve implemented to provide different march's. But i dont understand the code so far. My goal is to provide a repo which rebuilds several arch packages.
But at the makepkg.conf needs to be set the CARCH="x86_64_v3". Also at the PKGBUILD's its needed to change the arch=(x86_64) to arch=(x86_64_v3). And of course the CFFLAGS and the CXXFLAGS needs to be changed to -v3.
For me its personally the correct way to provide optimized v3 packages. To use this packages the user need to change his pacman.conf to Architectures= x86_64 x86_64_v3, until arch got a solution to provide this natively with pacman, right now they are using uname -m which only gives the x86 architecture out.
I read the code so far but dont get a solution that the packages still synced and compiled with this march.
Regards.