guzuta icon indicating copy to clipboard operation
guzuta copied to clipboard

mirrorlist permuted on build, resulting in 404

Open 3nprob opened this issue 3 years ago • 0 comments

I am using guzuta as part of building arch packages with this script and repos.

Build host Manjaro ARM (aarch64), freshly installed.

chroots are prepared:

$ tree -L 2 ./chroot-aarch64
./chroot-aarch64
├── root
│   ├── bin -> usr/bin
│   ├── boot
│   ├── dev
│   ├── etc
│   ├── home
│   ├── lib -> usr/lib
│   ├── mnt
│   ├── opt
│   ├── proc
│   ├── root
│   ├── run
│   ├── sbin -> usr/bin
│   ├── srv
│   ├── sys
│   ├── tmp
│   ├── usr
│   └── var
├── root.lock
├── user
│   ├── bin -> usr/bin
│   ├── boot
│   ├── dev
│   ├── etc
│   ├── home
│   ├── lib -> usr/lib
│   ├── mnt
│   ├── opt
│   ├── proc
│   ├── root
│   ├── run
│   ├── sbin -> usr/bin
│   ├── srv
│   ├── sys
│   ├── tmp
│   ├── usr
│   └── var
└── user.lock

mirrorlists prior to building

$ cat ./chroot-aarch64/user/etc/pacman.d/mirrorlist
Server = http://mirror.archlinuxarm.org/$arch/$repo
$ cat ./chroot-aarch64/root/etc/pacman.d/mirrorlist
Server = http://mirror.archlinuxarm.org/$arch/$repo
$ cat /etc/pacman.d/mirrorlist
#Server = https://manjaro.moson.eu/arm-stable/$repo/$arch
Server = http://dk.mirror.archlinuxarm.org/$arch/$repo

Attempting to build fails (continuing will also 404 on packages)

$ guzuta build --arch aarch64 --chroot-dir ./chroot-aarch64 --repo-name danctnix --repo-dir ./repo/danctnix/aarch64 --srcdest ./sources --logdest ./logs PKGBUILDS/danctnix/amazfish
==> Synchronizing chroot copy [/home/user/dev/Pine64-Arch/chroot-aarch64/root] -> [user]...done
:: Synchronizing package databases...
 core.db failed to download
 extra is up to date
 community.db failed to download
error: failed retrieving file 'core.db' from dk.mirror.archlinuxarm.org : The requested URL returned error: 404
error: failed retrieving file 'community.db' from dk.mirror.archlinuxarm.org : The requested URL returned error: 404
error: failed to synchronize all databases (failed to retrieve some files)
^C
==> ERROR: Aborted by user! Exiting...
==> ERROR: Aborting...

mirrorlists post attempting build

$ cat ./chroot-aarch64/root/etc/pacman.d/mirrorlist
Server = http://mirror.archlinuxarm.org/$arch/$repo
$ cat ./chroot-aarch64/user/etc/pacman.d/mirrorlist
Server = http://dk.mirror.archlinuxarm.org/aarch64/extra

makepkg.conf

$ grep -vE '^#|^\s*$' ./chroot-aarch64/user/etc/makepkg.conf
DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
          'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')
VCSCLIENTS=('bzr::bzr'
            'fossil::fossil'
            'git::git'
            'hg::mercurial'
            'svn::subversion')
CARCH="aarch64"
CHOST="aarch64-unknown-linux-gnu"
CPPFLAGS=""
CFLAGS="-march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
BUILDENV=(!distcc color !ccache check !sign)
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
INTEGRITY_CHECK=(sha256)
STRIP_BINARIES="--strip-all"
STRIP_SHARED="--strip-unneeded"
STRIP_STATIC="--strip-debug"
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
DBGSRCDIR="/usr/src/debug"
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
COMPRESSZST=(zstd -c -z -q -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q)
COMPRESSLZ=(lzip -c -f)
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'


$ diff ./chroot-aarch64/user/etc/makepkg.conf ./chroot-aarch64/root/etc/makepkg.conf

$ diff ./chroot-aarch64/user/etc/makepkg.conf /etc/makepkg.conf
42c42
< CPPFLAGS=""
---
> #CPPFLAGS=""
50c50
< #MAKEFLAGS="-j2"
---
> MAKEFLAGS="-j$(($(nproc)+1))"
140c140
< COMPRESSXZ=(xz -c -z -)
---
> COMPRESSXZ=(xz -c -z - --threads=0)
152c152
< PKGEXT='.pkg.tar.xz'
---
> PKGEXT='.pkg.tar.zst'

Expected behavior

chroot mirrorlist is untouched, or copied verbatim from root

Actual behavior

chroot mirrorlist is templated from host /etc/mirrorlist, replacing $repo with extra, making all other repos fail to update and fetch packages

Even chmodding it to 400 does not prevent this.

3nprob avatar Feb 03 '22 09:02 3nprob