Cannot build packages with inverted dependencies after each other
In !2146 (merged) we added support for conflicting dependencies. I noticed today that when you try to build a package with depends="!other ..."
, you afterwards cannot build other packages that have depends="other ..."
anymore.
Example:
$ ./pmbootstrap.py build unl0kr
[20:13:44] (native) install alpine-base
[20:13:45] (native) install abuild build-base ccache git
[20:13:49] (native) install !osk-sdl cryptsetup eudev-dev inih inih-dev libinput-dev libinput-libs libxkbcommon libxkbcommon-dev linux-headers meson
[20:13:51] (native) build x86_64/unl0kr-0.1.0_git20211123-r0.apk
[20:13:55] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[20:13:55] DONE!
$ ./pmbootstrap.py build postmarketos-mkinitfs
[20:14:07] (native) install cryptsetup-dev directfb mesa-gl mesa-gles scdoc sdl2-dev sdl2_ttf-dev ttf-dejavu
[20:14:12] (native) build x86_64/osk-sdl-0.66-r1.apk
[20:14:17] (native) install boot-deploy busybox-extras bzip2 device-mapper e2fsprogs e2fsprogs-extra f2fs-tools go lz4 multipath-tools parted postmarketos-fde-unlocker xz
[20:14:17] NOTE: The failed command's output is above the ^^^ line in the log file: /home/jm/.local/var/pmbootstrap/log.txt
[20:14:17] ERROR: Command failed: apk add -u --virtual .pmbootstrap boot-deploy busybox-extras bzip2 device-mapper e2fsprogs e2fsprogs-extra f2fs-tools go lz4 multipath-tools parted /mnt/pmbootstrap-packages/x86_64/osk-sdl-0.66-r1.apk xz lvm2-libs libcom_err e2fsprogs-libs f2fs-tools-libs libaio userspace-rcu directfb mesa-gl mesa-gles ttf-dejavu sdl2 sdl2_ttf device-mapper-event-libs libdrm freetype libpng tslib mesa libx11 libxext libxfixes libxxf86vm mesa-glapi libxshmfence fontconfig encodings mkfontscale libpciaccess libfontenc
[20:14:17] See also: <https://postmarketos.org/troubleshooting>
$ pmbootstrap log
>>> osk-sdl-doc*: Tracing dependencies...
>>> osk-sdl-doc*: Package size: 24.0 KB
>>> osk-sdl-doc*: Compressing data...
>>> osk-sdl-doc*: Create checksum...
>>> osk-sdl-doc*: Create osk-sdl-doc-0.66-r1.apk
>>> osk-sdl*: Tracing dependencies...
cryptsetup-libs
directfb
mesa-gl
mesa-gles
ttf-dejavu
so:libSDL2-2.0.so.0
so:libSDL2_ttf-2.0.so.0
so:libc.musl-x86_64.so.1
so:libcryptsetup.so.12
so:libgcc_s.so.1
so:libstdc++.so.6
>>> osk-sdl*: Package size: 136.0 KB
>>> osk-sdl*: Compressing data...
>>> osk-sdl*: Create checksum...
>>> osk-sdl*: Create osk-sdl-0.66-r1.apk
>>> osk-sdl: Build complete at Tue, 04 Jan 2022 19:14:17 +0000 elapsed time 0h 0m 4s
>>> osk-sdl: Updating the pmos/x86_64 repository index...
>>> osk-sdl: Signing the index...
(056734) [20:14:17] (native) install boot-deploy busybox-extras bzip2 device-mapper e2fsprogs e2fsprogs-extra f2fs-tools go lz4 multipath-tools parted postmarketos-fde-unlocker xz
(056734) [20:14:17] % sudo rm -f /home/jm/.local/var/pmbootstrap/chroot_native/tmp/apk_progress_fifo
(056734) [20:14:17] % sudo mkfifo /home/jm/.local/var/pmbootstrap/chroot_native/tmp/apk_progress_fifo
(056734) [20:14:17] (native) % cat /tmp/apk_progress_fifo
(056734) [20:14:17] (native) % sh -c exec 3>/tmp/apk_progress_fifo; apk --no-progress --progress-fd 3 add -u --virtual .pmbootstrap boot-deploy busybox-extras bzip2 device-mapper e2fsprogs e2fsprogs-extra f2fs-tools go lz4 multipath-tools parted /mnt/pmbootstrap-packages/x86_64/osk-sdl-0.66-r1.apk xz lvm2-libs libcom_err e2fsprogs-libs f2fs-tools-libs libaio userspace-rcu directfb mesa-gl mesa-gles ttf-dejavu sdl2 sdl2_ttf device-mapper-event-libs libdrm freetype libpng tslib mesa libx11 libxext libxfixes libxxf86vm mesa-glapi libxshmfence fontconfig encodings mkfontscale libpciaccess libfontenc
(056734) [20:14:17] New background process: pid=57370, output=background
ERROR: unable to select packages:
osk-sdl-0.66-r1:
breaks: world[!osk-sdl]
satisfies: .pmbootstrap-20220104.191417[osk-sdl><Q1wgdtQVHfBRoUwoWfrwlkk6itk8g=]
.pmbootstrap-20220104.191417:
masked in: cache
satisfies: world[.pmbootstrap=20220104.191417]
(056734) [20:14:17] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(056734) [20:14:17] NOTE: The failed command's output is above the ^^^ line in the log file: /home/jm/.local/var/pmbootstrap/log.txt
(056734) [20:14:17] ERROR: Command failed: apk add -u --virtual .pmbootstrap boot-deploy busybox-extras bzip2 device-mapper e2fsprogs e2fsprogs-extra f2fs-tools go lz4 multipath-tools parted /mnt/pmbootstrap-packages/x86_64/osk-sdl-0.66-r1.apk xz lvm2-libs libcom_err e2fsprogs-libs f2fs-tools-libs libaio userspace-rcu directfb mesa-gl mesa-gles ttf-dejavu sdl2 sdl2_ttf device-mapper-event-libs libdrm freetype libpng tslib mesa libx11 libxext libxfixes libxxf86vm mesa-glapi libxshmfence fontconfig encodings mkfontscale libpciaccess libfontenc
(056734) [20:14:17] See also: <https://postmarketos.org/troubleshooting>
(056734) [20:14:17] Traceback (most recent call last):
File "/home/jm/Code/forks/pmbootstrap/pmb/__init__.py", line 49, in main
getattr(frontend, args.action)(args)
File "/home/jm/Code/forks/pmbootstrap/pmb/helpers/frontend.py", line 113, in build
if not pmb.build.package(args, package, arch_package, force,
File "/home/jm/Code/forks/pmbootstrap/pmb/build/_package.py", line 515, in package
if not init_buildenv(args, apkbuild, arch, strict, force, cross, suffix,
File "/home/jm/Code/forks/pmbootstrap/pmb/build/_package.py", line 219, in init_buildenv
pmb.chroot.apk.install(args, depends, suffix)
File "/home/jm/Code/forks/pmbootstrap/pmb/chroot/apk.py", line 242, in install
pmb.helpers.apk.apk_with_progress(args, ["apk"] + command,
File "/home/jm/Code/forks/pmbootstrap/pmb/helpers/apk.py", line 109, in apk_with_progress
pmb.helpers.run_core.check_return_code(args, p_apk.returncode,
File "/home/jm/Code/forks/pmbootstrap/pmb/helpers/run_core.py", line 219, in check_return_code
raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: apk add -u --virtual .pmbootstrap boot-deploy busybox-extras bzip2 device-mapper e2fsprogs e2fsprogs-extra f2fs-tools go lz4 multipath-tools parted /mnt/pmbootstrap-packages/x86_64/osk-sdl-0.66-r1.apk xz lvm2-libs libcom_err e2fsprogs-libs f2fs-tools-libs libaio userspace-rcu directfb mesa-gl mesa-gles ttf-dejavu sdl2 sdl2_ttf device-mapper-event-libs libdrm freetype libpng tslib mesa libx11 libxext libxfixes libxxf86vm mesa-glapi libxshmfence fontconfig encodings mkfontscale libpciaccess libfontenc
(057379) [20:14:22] % tail -n 60 -F /home/jm/.local/var/pmbootstrap/log.txt
(057379) [20:14:22] *** output passed to pmbootstrap stdout, not to this log ***
What happens is that building unl0kr
(which contains depends="!osk-sdl"
) sets a !osk-sdl
constraint. postmarketos-mkinitfs in turn depends on postmarketos-fde-unlocker for which osk-sdl is the highest priority provider. So when you attempt to build postmarketos-mkinitfs, it'll try to install osk-sdl as a dependency. This then fails because we already set a !osk-sdl
constraint when building unl0kr before.
I am not entirely sure how to work around this issue. Maybe we need to clean up dependencies installed only for building a package after it has been built?
Relates: postmarketOS/pmaports!2687, postmarketOS/pmaports#1309