Skip to content

PMB_APK_FORCE_MISSING_REPOSITORIES: new env var

Administrator requested to merge apk-force-missing-repos into master

This is needed to bring up the v24.06 repositories at build.postmarketos.org. With the latest apk version, apk refuses to operate if an URL from /etc/apk/repositories cannot be fetched.

Before the repositories are created for the first time, they do not exist, so we will just set PMB_APK_FORCE_MISSING_REPOSITORIES=1 in bpo to be not blocked here.

I've also spent significant time on alternative implementations, but they have problems:

  • Let bpo create an empty APKINDEX before building the first package, but this was a larger code change, leading to lots of adjustments in the tests, and ultimately it seems it didn't work properly (it seems apk/abuild doesn't create a valid signed APKINDEX for one that has no packages).
  • Do not set the --mirror-pmOS argument for the "final" repository, only the "wip" repository, until the "final" repository is available for the first time. This works fine for x86_64, but not for foreign arch repositories because then the cross compilers from the x86_64 repository are not available. I've also tried to make a different env var that ensures we don't write the non-existing repository to /etc/apk/repositories from within pmbootstrap if initializing a foreign arch chroot, but then we would find a sane way to do this only for the "final" repository and not for the "wip" repository which leads to a lot more complexity than this patch.

So this is not the nicest solution (apk still tries to fetch the indexes and gets a 404), but it is the simplest one and unblocks us from working on v24.06. Also it doesn't add more complexity which is important in the middle of the feature freeze we are currently in.

Merge request reports

Loading