Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makerepropkg download used buid config #74

Closed
wants to merge 2 commits into from

Conversation

jelly
Copy link
Member

@jelly jelly commented Nov 10, 2021

No description provided.

@jelly jelly force-pushed the feature/makerepropkg-download-configs branch from b7b51df to bebcffd Compare November 10, 2021 20:09
@jelly
Copy link
Member Author

jelly commented Nov 10, 2021

@anthraxx Be aware I force pushed your branch so the tests run.

@jelly
Copy link
Member Author

jelly commented Nov 10, 2021

For testing this PR:

Test building a new package with extra-x86_64-build records the build tool

cd /tmp/
archco filesystem
PATH=/home/jelle/projects/devtools/:$PATH extra-x86_64-build
tar xvf filesystem-2021.05.31-1-x86_64.pkg.tar.zst .BUILDINFO

Verify the buildtool was recorded:

[jelle@t14s][~/projects/devtools]%grep buildtool /tmp/filesystem/trunk/.BUILDINFO
buildtool = devtools
buildtoolver = 20210202-git

Now we want to reproduce this package, it should fail as the git version is unreleased:

[jelle@t14s][/tmp/filesystem/trunk]%/home/jelle/projects/devtools/makerepropkg filesystem-2021.05.31-1-x86_64.pkg.tar.zst
  -> retrieving 'devtools-20210202-git.pkg.tar.zst'...
curl: (22) The requested URL returned error: 404

  -> retrieving 'devtools-20210202-git.pkg.tar.xz'...
curl: (22) The requested URL returned error: 404

  -> retrieving 'devtools-20210202-git.pkg.tar'...
curl: (22) The requested URL returned error: 404

==> ERROR: failed to retrieve devtools-20210202-git

reproduce package with an old devtools version

Test reproducing a package with a different devtools version we previously released which contains changes which make the build output different. So we pick 20191212 which does not include zst compression yet.

cd /home/jelle/projects/devtools
make BUILDTOOLVER=20191212 -B

cd /tmp/
archco filesystem
PATH=/home/jelle/projects/devtools/:$PATH extra-x86_64-build
cd /tmp
wget https://archive.archlinux.org/packages/f/filesystem/filesystem-2019.10-2-x86_64.pkg.tar.xz
wget https://raw.githubusercontent.com/archlinux/svntogit-packages/8cb5773ffa42e06f5be0bcf46e7d86f07cce9f84/trunk/PKGBUILD

vim filesystem-2019.10-2-x86_64.pkg.tar.xz 

Edit the BUILDINFO and add:

buildtool = devtools
buildtoolver = 20191212
[jelle@t14s][/tmp]%/home/jelle/projects/devtools/makerepropkg filesystem-2019.10-2-x86_64.pkg.tar.xz
  -> retrieving 'devtools-20191212.pkg.tar.zst'...
curl: (22) The requested URL returned error: 404

  -> retrieving 'devtools-20191212.pkg.tar.xz'...
curl: (22) The requested URL returned error: 404

  -> retrieving 'devtools-20191212.pkg.tar'...
curl: (22) The requested URL returned error: 404

Even when setting pkgrel it does not work.

buildtoolver = 20191212-1

Setting the $arch works

buildtoolver = 20191212-1-any

Of course the rebuild fails due to GPG

[jelle@t14s][/tmp]%/home/jelle/projects/devtools/makerepropkg filesystem-2019.10-2-x86_64.pkg.tar.xz
  -> retrieving 'devtools-20191212-1-any.pkg.tar.zst'...
############################################################################################################################################ 100.0%curl: (22) The requested URL returned error: 404

  -> retrieving 'devtools-20191212-1-any.pkg.tar.xz'...
############################################################################################################################################ 100.0%
  -> retrieving 'devtools-20191212-1-any.pkg.tar.xz.sig'...
############################################################################################################################################ 100.0%
  -> using makepkg.conf from devtools-20191212-1-any
Create subvolume '/var/lib/archbuild/reproducible/root'
==> Creating install root at /var/lib/archbuild/reproducible/root
==> Installing packages to /var/lib/archbuild/reproducible/root
warning: database file for 'core' does not exist (use '-Sy' to download)
warning: database file for 'extra' does not exist (use '-Sy' to download)
warning: database file for 'community' does not exist (use '-Sy' to download)
loading packages...
error: '/var/cache/pacman/pkg/bash-5.0.011-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/binutils-2.33.1-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/bison-3.4.2-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/gcc-9.2.0-4-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/gcc-libs-9.2.0-4-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/glibc-2.30-2-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/gnupg-2.2.17-2-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/guile-2.2.6-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/iana-etc-20191030-1-any.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libassuan-2.5.3-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libatomic_ops-7.6.10-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libcap-2.27-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libnl-3.5.0-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libpcap-1.9.1-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libssh2-1.9.0-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libunistring-0.9.10-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/libusb-1.0.23-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/pinentry-1.1.0-4-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/readline-8.0.001-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: '/var/cache/pacman/pkg/shadow-4.7-2-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)

Issues

What about existing packages with a buildtool defined?!! These will all break:

  • We can't edit the BUILDINFO, breaks the signature
  • We could fallback to the an older devtools version (hardcode the old release) so it fetches the correct .BUILDINFO
  • We don't check the BUILDINFO format in this patch (I think it was updated to 2 in the last pacman)

@anthraxx anthraxx force-pushed the feature/makerepropkg-download-configs branch 2 times, most recently from 300ae7d to 4d733f6 Compare November 11, 2021 23:45
Copy link
Member Author

@jelly jelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I opened the PR I can't request changes or approve it, I think the PR just needs two small improvements and the new makerepropkg option should be documented in the man page.

Tested the changes locally and the fallback seems to work with a build package, setting a faulty version BUILDTOOLVER=20210202-4-any shows that the devtools package is trying to get fetched. So to me it looks good to go :)

makerepropkg.in Outdated Show resolved Hide resolved
makerepropkg.in Show resolved Hide resolved
@anthraxx anthraxx force-pushed the feature/makerepropkg-download-configs branch 3 times, most recently from 6ee7b90 to 754963b Compare November 16, 2021 20:13
Use the recorded buildtool in order to download the matching dist
package and use the appropriate makepkg.conf for reproducing the
package. This is required as the flags are not recorded in the BUILDINFO
hence we need to provide the matching config that declared those flags.
This adds proper namespace locking as well to fix screwing up the
running makerepropkg process.
@anthraxx anthraxx force-pushed the feature/makerepropkg-download-configs branch from 754963b to 29bff53 Compare November 16, 2021 21:46
@anthraxx
Copy link
Member

merged via cli

@anthraxx anthraxx closed this Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants