Giter Club home page Giter Club logo

archlinux-repro's Introduction

repro

repro is intended to be a tool for users to verify packages distributed by Arch Linux.

The current goals are:

  • Recreate packages given a .BUILDINFO file, or .pkg.tar.xz
  • Download and verify needed packages from archive.archlinux.org
  • Be a simple and easily auditable code
  • Distribution independent. One should be able to verify Arch packages on Debian.

Work in progress. Please read the code before using.

Dependencies

  • asciidoc (make)
  • coreutils
  • curl
  • gnupg
  • systemd
  • bsdtar
  • zstd

archlinux-repro's People

Contributors

adityasaky avatar allanmcrae avatar andrin-geiger avatar anthraxx avatar coderobe avatar eli-schwartz avatar evelikov avatar fantasquex avatar fergus-dall avatar foutrelis avatar foxboron avatar inglor avatar jelly avatar juergenhoetzel avatar kolayne avatar kpcyrd avatar kyrias avatar maximbaz avatar progandy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archlinux-repro's Issues

epoch not handled when comparing packages

==> Finished making: grub 2:2.04-5 (Thu 30 Apr 2020 08:47:25 AM UTC)
==> Cleaning up...
  -> Delete snapshot for build...
==> Comparing hashes...
diff: ./build/grub-2_2.04-5-x86_64.pkg.tar.zst: No such file or directory
==> ERROR: Package is not reproducible

Whatever code that tries to find the package in build does not handle epoch

buildinfo can fail in hard to debug ways

I tried to run buildinfo on a debian system and got this obscure error:

$ /usr/local/bin/buildinfo -ff cjdns-20.5-1-x86_64.pkg.tar.zst
/usr/local/bin/buildinfo: line 47: data["${key}"]: bad array subscript
pkgname=
pkgbase=
pkgver=
pkgbuild_sha256sum=
packager=
builddate=
builddir=
buildenv=
options=
installed=
$ 

after some troubleshooting it turned out zstd wasn't installed and tar failed. I would expect an error message that is pointing me towards tar.

shellcheck issues suppressed that shouldn't have been

# shellcheck disable=SC2059

# shellcheck disable=SC2059

# shellcheck disable=SC2059

# shellcheck disable=SC2059

These are valid semantic errors that can lead to printf doing the wrong thing when the variables used contain format strings. As it stands though, this behavior is expected for one of the variables used here.

I'd probably nest the printfs - one for the mesg formatting, and one for the rest.
Just in case some future terminal with more in-band signaling ends up using % in their escape sequences ;)

Alternatively, consider something like "%s ... ${mesg}" "${BOLD}" ... and whatnot, where everything but mesg is separated into printf formatting


archlinux-repro/repro.in

Lines 115 to 118 in a1dc7bd

# shellcheck disable=SC2140
mount -t overlay overlay \
-o lowerdir="$BUILDDIRECTORY/root",upperdir="$BUILDDIRECTORY/${build}_upperdir",workdir="$BUILDDIRECTORY/${build}_workdir" \
"$BUILDDIRECTORY/${build}"

This is also a valid issue. As it currently stands it looks like you may have intended for the quotes to end up in the args as literals, but right now they're all interpreted by your shell. The entire arg should be wrapped in quotes.


archlinux-repro/repro.in

Lines 259 to 260 in a1dc7bd

# shellcheck disable=SC2086
exec_nspawn build --bind="$(readlink -e ${cachedir}):/cache" pacman -U ${packages[*]} --noconfirm

Should be "${packages[@]}" instead of ${packages[*]}. What it's currently doing is basically "join all the arguments by the first character of IFS (space), split them by IFS and expand each of them as globs, and use those as args for the commandline you're building"


archlinux-repro/repro.in

Lines 319 to 328 in a1dc7bd

xdg_repro_dir="${xdg_config_home:-$home/.config}/repro"
if [[ "$repro_conf" = "$configdir/repro.conf" ]]; then
if [[ -r "$xdg_repro_dir/repro.conf" ]]; then
# shellcheck source=/dev/null
source "$xdg_repro_dir/repro.conf"
elif [[ -r "$home/.repro.conf" ]]; then
# shellcheck source=/dev/null
source "$home/.repro.conf"
fi
fi

$home is not a thing, you probably wanted $HOME

Fix gpg --verify usage

I didn't pay attention and missed the fact that the quoted line in #44 was actually from master:

https://github.com/Foxboron/archlinux-repro/blob/88253732fd408b424fa52a853690adb1069fd263/buildinfo#L104-L106

Running gpg --verify like that is exploitable given a malicious mirror.

          gpg may assume that a single argument is a file with a detached
          signature, and it will try to find a matching data file by
          stripping certain suffixes. Using this historical feature to
          verify a detached signature is strongly discouraged; you should
          always specify the data file explicitly.

Specifically, putting a inline signature in ${filename}.sig by somebody from /etc/pacman.d/gnupg/pubring.gpg would skip verification of ${filename}.

Details about this kind of bug over here: https://ctftime.org/task/6731

Restrictive umask causes permission errors

...
(1/1) installing devtools                                                                                                       [#############################################################################] 100%
Optional dependencies for devtools
    btrfs-progs: btrfs support
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
'/usr/share/devtools/makepkg-x86_64.conf' -> '/mnt/etc/makepkg.conf'
Generating locales...
  en_US.UTF-8... done
  de_DE.UTF-8... done
Generation complete.
Sorry, user root is not allowed to execute '/bin/bash -c bash -c .\ /etc/profile;\ .\ /env;\ cd\ /startdir;\ makepkg\ --syncdeps\ --clean\ --noconfirm\ --skippgpcheck' as builduser on <packagename>130297.
-> Delete snapshot for <packagename>

I get this error message when I run "repro -d packagename.tar.zst"

However the user that executed this command is not root, but instead a normal user in the wheel group (which is in the sudoers file)
I was able to successfully execute the command on a different system, but whatever the cause for this is, the users as setup the same and the error message is rather misleading.

Any clue whats broken here?

Use overlayfs instead of rsync/btrfs

The entire things with rsync or btrfs should just be removed in favor of overlayfs. devtools also wants this, so any solutions here can be ported back into the devtools project.

Automatically import signing key

Since we know the fingerprint of the key that is expected to sign the bootstrap image we could automatically import it if it's not imported yet. This would remove one common error case and drop one step from the list of manual steps.

Make mirror and remote directory for bootstrap images (more) configurable

We are currently discussing the cleanup of our release artifact directories (https://gitlab.archlinux.org/archlinux/releng/-/issues/11). One project affected by this change would be archlinux-repro, as the mirror and remote directory for the bootstrap image are currently only overridable via BOOTSTRAPMIRROR. While technically this suffices, the directory structure will soon be more explicit (in regards to per-type artifact directory structure).

To make this a little more flexible I propose to decouple the mirror and the directory from one another. A similar approach has been chosen for releng (which relies on the iso release artifact).

This ticket is here to track the progress for this change for archlinux-repro and to propose an implementation for this situation.

Add a configuration file!

Make it possible to configure the following bash variables:

  readonly build_directory=/var/lib/repro
  readonly config_dir=/home/fox/Git/prosjekter/Bash/devtools-repro
  readonly bootstrap_mirror=https://mirror.archlinux.no/iso/latest

Plans/Ideas for the tool

Features:

  • Rebuild packages based on .BUILDINFO
  • Build a package N times with different environments, compare builds
  • Config directory with profiles/config files to change the build environment

Commands could be:
repro - Build package two times and compare (default)
<reposetory>-repro extra-repro testing-repro etc. repository to use when building
repor check *.tar.gz - Rebuild package based on .BUILDINFO

Switches:

  • --random-profiles=4

Output error codes from makepkg

Not sure how easy this is, but for a CI setup it would be nice to know why reproducing fails. A recent makepkg outputs error codes when the build fails which make it easy to identify the build failure.

See man makepkg ERRORS section for the possible codes, which should be passed out as output of repro or only a subset.

Running repro in parallel

I'm trying to run repro multiple times (giving each their own $BUILDDIRECTORY) for mass rebuilds but I ran into issues with:

Failed to allocate scope: Unit root.scope already exists

It seems this is because repro builds in /var/lib/repro/root, with root then becoming the machine name in nspawn, which has to be unique.

galera not building since it uses rsync

As galera uses rsync in source=() and devtools depends on rsync and downloads outside of the build chroot the build succeeds. However with repro that won't work:

==> Retrieving sources...
==> ERROR: The download program rsync is not installed.
  -> Downloading galera-26.4.4.tar.gz...
/usr/share/makepkg/source/file.sh: line 72: $'\E[1m': command not found
==> ERROR: Failure while downloading rsync://rsync.osuosl.org/mariadb/mariadb-10.4.13/galera-26.4.4/src/galera-26.4.4.tar.gz
    Aborting...
  -> Delete snapshot for galera_14838...

Handle existing snapshot

Create a snapshot of '/mnt/msata/repro/root' in '/mnt/msata/repro/build1/root'
ERROR: cannot snapshot '/mnt/msata/repro/root': File exists

This probably needs a bash trap because the build might fail or the script might fail and we would like to clean up nicely afterwards.

Compile package without network

Using unshare -n we can disable internet access in nspawn. build_package needs to be updated to first install dependencies and download the source, then unshare network access and build the package.

No clear error when GPG signature errors

Rebuilding ant shows some GPG errors and systemd-nspawn exit's. No clear error is however shown when repro exits.

error: 'cache/java-environment-common-3-1-any.pkg.tar.xz': invalid or corrupted package (PGP signature)
error: 'cache/java-runtime-common-3-1-any.pkg.tar.xz': invalid or corrupted package (PGP signature)
warning: downgrading package json-c (0.14-2 => 0.13.1-2)

Some nspawn subshells ignore errors

I noticed this error:

(13/21) Warn about old perl modules
(14/21) Updating fontconfig cache...
(15/21) Probing GDK-Pixbuf loader modules...
(16/21) Updating GIO module cache...
(17/21) Compiling GSettings XML schema files...
(18/21) Probing GTK3 input method modules...
(19/21) Updating icon theme caches...
(20/21) Updating the info directory file...
(21/21) Updating the desktop file MIME type cache...
Installing devtools from https://archive.archlinux.org/packages/d/devtools-20220207-2-any.pkg.tar.zst
:: Retrieving packages...
 devtools-20220207-2-any.pkg.tar.zst failed to download
error: failed retrieving file 'devtools-20220207-2-any.pkg.tar.zst' from archive.archlinux.org : Connection timeout after 10000 ms
warning: failed to retrieve some files
cp: cannot stat '/usr/share/devtools/makepkg-x86_64.conf': No such file or directory
%

The rebuild failing due to the connection timeout is expected, but it seems the error was ignored and the script continued running (attempting to copy a file).

This is because the code is running in a nspawn subshell that doesn't use -x:

archlinux-repro/repro.in

Lines 481 to 502 in 7768f33

# shellcheck disable=SC2086
EPHEMERAL=1 exec_nspawn root \
--bind="${build_root_dir}:/mnt" \
--bind-ro="$KEYRINGCACHE/$keyring_package:/gnupg" \
--bind="$(readlink -e ${cachedir}):/var/cache/pacman/pkg" \
--bind="$(readlink -e ${cachedir}):/cache" \
bash -bash "${packages[@]}" <<-__END__
rm --recursive /etc/pacman.d/gnupg/
cp --target-directory=/etc/pacman.d/ --recursive /gnupg
echo "faked-system-time ${SOURCE_DATE_EPOCH}" >> /etc/pacman.d/gnupg/gpg.conf
pacstrap -G -U /mnt --needed "\$@"
echo "Installing devtools from $DEVTOOLS_PKG"
# Ignore all dependencies since we only want the file
# Saves us a few seconds and doesn't download a bunch of things
# we are getting rid off
if [[ "$DEVTOOLS_PKG" == https* ]]; then
pacman --noconfirm --needed -Udd "$DEVTOOLS_PKG"
else
pacman --noconfirm --needed -Sddu "$DEVTOOLS_PKG"
fi
cp -v /usr/share/devtools/makepkg-x86_64.conf /mnt/etc/makepkg.conf
__END__

Refactor build functions

The build functions are very similar, they should become a bash function, cause we love less loc.

Check for /var/lib/build/root

We could probably base everything off the devtools /var/lib/build/root instead of doing our own thing. Helps us save diskspace and could be faster.

Add configuration file options

Currently I still use my own patch since stuff is in a different location for me and my / is rather small.

 repro.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repro.sh b/repro.sh
index 30628d6..23c3130 100755
--- a/repro.sh
+++ b/repro.sh
@@ -4,11 +4,11 @@
 
 set -eE -o pipefail
 
-readonly build_directory=/var/lib/repro
+readonly build_directory=/mnt/msata/repro
 readonly bootstrap_mirror=https://mirror.archlinux.no/iso/latest
 readonly bootstrap_img=archlinux-bootstrap-"$(date +%Y.%m)".01-"$(uname -m)".tar.gz
 
-readonly config_dir=/home/fox/Git/prosjekter/Bash/devtools-repro
+readonly config_dir=/home/jelle/projects/devtools-repro
 
 pacman_conf=$config_dir/pacman.conf
 makepkg_conf=$config_dir/makepkg.conf

static analysis report for repro.in: found issues

printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2

Don't use variables in the printf format string. Use printf "..%s.." "$foo".


printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2

Don't use variables in the printf format string. Use printf "..%s.." "$foo".


printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2

Don't use variables in the printf format string. Use printf "..%s.." "$foo".


printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2

Don't use variables in the printf format string. Use printf "..%s.." "$foo".


rm -rf "$BUILDDIRECTORY"/{${build},${build}_upperdir,${build}_workdir,${build}_disorder} || true

Use "${var:?}" to ensure this never expands to / .
Double quote to prevent globbing and word splitting.


mkdir -p "$BUILDDIRECTORY"/{${build},${build}_upperdir,${build}_workdir}

Double quote to prevent globbing and word splitting.


-o lowerdir="$BUILDDIRECTORY/root",upperdir="$BUILDDIRECTORY/${build}_upperdir",workdir="$BUILDDIRECTORY/${build}_workdir" \

Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A"B"C"?


-o lowerdir="$BUILDDIRECTORY/root",upperdir="$BUILDDIRECTORY/${build}_upperdir",workdir="$BUILDDIRECTORY/${build}_workdir" \

Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A"B"C"?


exec_nspawn $build \

Double quote to prevent globbing and word splitting.


cp $makepkg_conf "$BUILDDIRECTORY"/root/etc/makepkg.conf

Double quote to prevent globbing and word splitting.


cp $pacman_conf "$BUILDDIRECTORY"/root/etc/pacman.conf

Double quote to prevent globbing and word splitting.


cp $makepkg_conf "$BUILDDIRECTORY"/root/etc/makepkg.conf

Double quote to prevent globbing and word splitting.


cp $pacman_conf "$BUILDDIRECTORY"/root/etc/pacman.conf

Double quote to prevent globbing and word splitting.


cp $makepkg_conf "$BUILDDIRECTORY"/root/etc/makepkg.conf

Double quote to prevent globbing and word splitting.


cp $pacman_conf "$BUILDDIRECTORY"/root/etc/pacman.conf

Double quote to prevent globbing and word splitting.


while IFS=$'=' read key value; do

read without -r will mangle backslashes.


printf 'PACKAGER=' "${PACKAGER@Q}" > $BUILDDIRECTORY/build/home/builduser/.makepkg.conf

This printf format string has no variables. Other arguments are ignored.
Possible misspelling: PACKAGER may not be assigned, but packager is.


exec_nspawn build --bind="$(readlink -e ${cachedir}):/cache" pacman -U ${packages[*]} --noconfirm

Double quote to prevent globbing and word splitting.


build_package "build" $builddir

Double quote to prevent globbing and word splitting.


sha512sum -b "$pkg" | read refference_build_checksum _

read without -r will mangle backslashes.
Modification of refference_build_checksum is local (to subshell caused by pipeline).


sha512sum -b ./build/"$(basename $pkgfile)" | read other_build_checksum _

Double quote to prevent globbing and word splitting.
read without -r will mangle backslashes.
Modification of other_build_checksum is local (to subshell caused by pipeline).


if [ "$refference_build_checksum" = "$other_build_checksum" ]; then

refference_build_checksum was modified in a subshell. That change might be lost.
other_build_checksum was modified in a subshell. That change might be lost.


PYTHONIOENCODING=utf-8 $DIFFOSCOPE "$pkg" ./build/"$(basename $pkg)" || true

Double quote to prevent globbing and word splitting.


case $arg in

Invalid flags are not handled. Add a *) case.


command_args=$@

Variable was used as an array but is now assigned a string.
Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.


source $REPRO_CONF

Double quote to prevent globbing and word splitting.


if [[ "$REPO_CONF" = "$CONFIGDIR/repro.conf" ]]; then

Possible misspelling: REPO_CONF may not be assigned, but REPRO_CONF is.

Rebuilding certificate stores may fail (can't load libffi)

The rebuild for glib2 is currently failing due to certificate issues:

==> Retrieving sources...
  -> Cloning glib git repo...
Cloning into bare repository '/startdir/glib'...
fatal: unable to access 'https://gitlab.gnome.org/GNOME/glib.git/': error setting certificate verify locations:  CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none
==> ERROR: Failure while downloading glib git repo

earlier in the logs there are some error messages that are likely related:

(1/4) Rebuilding certificate stores...
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
trust: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
(2/4) Warn about old perl modules

I'm not sure how and why this happens, I'm wondering if this a binary from the host system trying to load a library that doesn't exist inside the container.

Codestyle in `buildinfo` and `repro`

The codestyles differ a bit so we should try stick to one style. I think buildinfo is a good starting ground as most of it is commented and stuff.

@coderobe could probably layout some basics.

Error out before creating chroot

If you are in a directory which contains no PKGBUILD, a chroot will be prepared and then an error message is shown. The flow should be changed to first check if everything is available and then prepare chroots.

Lock the build snapshot

Currently running repro while another repro process is running causes issues because the 2nd process fails in create_snapshot but still runs remove_snapshot afterwards while the other process is running.

Preferably the 1st process would create a lock and the 2nd process would wait until it can acquire the lock.

Reproduce a package from the repository

This tool currently can detect reproducible build issue, but it does not reproducible packages from our repo yet. For that it requires either a BUILDINFO (or extract from pkg.tar.xz) and a PKGBUILD.

This means, we need to create a chroot:

  • Install all old packages (installed =). pacman -U -r ? Can't use daily repo since packages can be updated twice a day!
  • Modify makepkg.conf for possible passed variables (options/buildenv)
  • Set builddir
  • Set builddate

Getting PKGBUILD file can fail due to pacman database lock

When not being run directly on a PKGBUILD, repro runs a short script inside an ephemeral container based on the downloaded chroot. This script involves running pacman -S asp devtools --noconfirm to install tools required to download and validate the PKGBUILD file, which in turn will fail if pacman cannot take the lock on its database.

Early in it's run, repro will also try and update the chroot by running pacman -Syu --noconfirm inside it, which also takes the pacman database lock. In order to guard against this possibility, repro locks the file root.lock before doing this, and skips this step if it's already locked. However, the step above does not try and take this lock, so two instances of repro can try and run these two steps simultaneously.

The fact that the PKGBUILD step is run in an ephemeral container prevents it from damaging the update step, but not vice versa. If the snapshot used by the ephemeral container is taken while the update is in progress, it will include the lock file, and the PKGBUILD step will fail.

This can be seen by doing something like:

for i in {1..20}
do
    CACHEDIR=/path/to/cache repro ./acl-2.2.53-3-x86_64.pkg.tar.zst 2>output-${i} >output-${i} &
    sleep 1
done

Most of the spawned repro instances will fail due to this issue.

Taking a shared lock on root.lock for this step (lines 301-318 in repro.in) solves this issue, and will also prevent issues that may arise from operating in a chroot that is mid-upgrade. This should also be done for the other ephemeral containers used to set up the build chroot, though I haven't actually seen any issues from this yet, probably because chroot updates are relatively rare.

Also related to this lock, when setting up the chroot for the first time, repro attempts to take the lock, but doesn't check if this operation succeeds (line 215). Thus, multiple instances of repro can be trying to install the chroot at the same time. The correct order of operations should be:

if [ ! -d "$BUILDDIRECTORY"/root ]; then
    # block on the lock file
    nlock 9 "$BUILDDIRECTORY"/root.lock
    if [ -d "$BUILDDIRECTORY"/root ]; then
        # chroot was created by someone else, don't need to do anything
        unlock 9
    else
        # set up chroot
    fi
fi

Packages can fail to build due to expired signing keys in old keyrings

I recently set up a rebuilderd instance running on archlinux core, and discovered 54 packages fail to build because one or more of the packages in their build environment fails the GPG signature check. All the packages failing validation have valid signatures from the perspective of the current archlinux-keyring package, but in the old archlinux-keyring packages used in the builds, the signing keys have expired.

Specifically, the following two keys:
60411304C09D36628340EEFFCEB167EFB5722BD6 (eschwartz) expired on 2020-10-17, extended to 2022-07-10 in keyring version 20200817
E550FFFFD485E264A1717E30901C1C320EB0D45D (demize) expired on 2020-12-10, extended to 2022-02-03 in keyring version 20200422

Signed the following five packages:
asciidoc 9.0.2-1 (eschwartz)
autoconf-archive 1:2019.01.06-1 (eschwartz)
ncompress 4.2.4.6-1 (eschwartz)
pkgconf 1.6.3-2 (demize)
python2-typing 3.6.6-1 (demize)

Which are used along with pre-extension archlinux-keyring versions in the builds of the following packages:
automake 1.16.2-3
b43-fwcutter 019-3
base 2-2
ca-certificates 20181109-4
ca-certificates-utils 20181109-4
cracklib 2.9.7-2
crda 4.14-3
cronie 1.5.5-1
db 5.3.28-5
dbus 1.12.20-1
dbus-docs 1.12.20-1
diffutils 3.7-3
ding-libs 0.6.1-3
dmraid 1.0.0.rc16.3-12
dosfstools 4.1-3
findutils 4.7.0-2
flex 2.6.4-3
gdbm 1.18.1-3
gzip 1.10-3
hdparm 9.58-3
ifenslave 1.1.0-11
inetutils 1.9.4-8
ipw2100-fw 1.3-10
ipw2200-fw 3.1-8
jfsutils 1.1.15-7
ldns 1.7.1-2
libaio 0.3.112-2
libgssglue 0.4-4
libmnl 1.0.4-3
libmpc 1.1.0-2
libnl 3.5.0-2
libssh2 1.9.0-2
lzo 2.10-3
m4 1.4.18-3
minizip 1:1.2.11-4
mkinitcpio-nfs-utils 0.3-7
net-tools 1.60.20181103git-2
nilfs-utils 2.2.8-2
npth 1.6-2
patch 2.7.6-8
pinentry 1.1.0-5
pptpclient 1.10.0-2
procinfo-ng 2.0.304-8
psmisc 23.3-2
pth 2.0.7-7
reiserfsprogs 3.6.27-3
rpcbind 1.2.5-3
run-parts 4.8.6.1-2
sysfsutils 2.1.0-11
tar 1.32-3
vi 1:070224-4
which 2.21-5
wireless_tools 30.pre9-3
zlib 1:1.2.11-4

These packages don't appear broken on reproducible.archlinux.org because this issue only affects packages that were built before the developer in question updated their archlinux-keyring package to a version that includes the relevant key extension(s), that were rebuilt after the expiry. Assuming developers update reasonably frequently, that reproducible.archlinux.org rebuilds packages shortly after they are published, and that it doesn't rebuild packages after it gets a successful repro, all of these packages would have been checked within the remaining validity of the signing keys.

A related issue is that we ignore any key revocations that weren't in effect at the time the package was published. If you're hoping to get a chain of trust stretching from newer packages back to older packages, then the compromise of a signing key for an old package is a big problem. There's a compromise path like:

  1. Steal developer signing key
  2. Sign a compromised version of gcc at some old version which introduces a flaw into some other package
  3. Push compromised gcc to package archive
  4. Build compromised package using compromised gcc
  5. Publish compromised package
  6. The bad gcc is never checked, because it looks like an out-of-date package, and the new package reproduces because reproducers will use the bad gcc package, even if the signing key is later revoked

Always using the newest archlinux-keyring package would solve both of these issues, though it's still not clear to me how to recover from a compromised developer signing key.

Respect PKGEXT

repro check -l mypkg.pkg.tar generates build/mypkg.pkg.tar.xz, and of course hashes are different.

Probably low prio since all official packages use .pkg.tar.xz extension, but anyway.

Cannot run repro twice in a row within the same terminal

For example, after running repro -ndf /var/cache/pacman/pkg/python-autobahn-20.6.2-1-x86_64.pkg.tar.zst, running the same command in the same terminal again results in

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

Apparently the terminal is no longer attached(?) to a pts

$ ps | grep zsh
  62675 ?        00:00:00 zsh

This starts from 7470fa8 if I understand it correctly. If I remove the call setsid with

diff --git a/repro.in b/repro.in
index 0fb6f15..b0ed006 100755
--- a/repro.in
+++ b/repro.in
@@ -208,7 +208,7 @@ install -d -o builduser -g builduser /pkgdest
 install -d -o builduser -g builduser /srcpkgdest
 install -d -o builduser -g builduser /build
 __END__
-    exec_nspawn "$build" $args setsid -f -c -w sudo -iu builduser bash -c ". /etc/profile; cd /startdir; SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH makepkg -sc --noconfirm --skippgpcheck $cmds"
+    exec_nspawn "$build" $args sudo -iu builduser bash -c ". /etc/profile; cd /startdir; SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH makepkg -sc --noconfirm --skippgpcheck $cmds"
     mkdir -p "./build"
     for pkgfile in "$BUILDDIRECTORY/$build"/pkgdest/*; do
         mv "$pkgfile" "./build/"

Then running repro multiple times in a terminal works fine. Is there a reason to keep terminal capabilities during the build? The current behavior is quite inconvenient for a modify-and-test workflow.

repro only uses one core to build

I'm not sure if this is intentional, due to makepkg or due to nspawn. Having all cores available would be great when rebuilding core since it contains multiple gcc packages. :)

Extend profiles

On our test builder we also vary:

  • hostname
  • umask

Not yet

  • domain name
  • buildpath
  • env PATH
  • cpu type = possible to emulate? / cores?
  • env USER
  • uid
  • gid
  • filesystem - disorderfs? Better would be xfs/ext4
  • - shell - Not relevant for Arch, only option zsh?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.