Patch failed while building archlinux-template

Hello everyone,
I don’t know if I should report this as a bug or if it’s a user error so I’m posting it here on the forums.

This is the guide I followed:

I am using a fedora-32-minimal template to build.


==> Retrieving sources...
  -> Found xen-4.8.5.tar.gz
  -> Found series-vm.conf
  -> Found apply-patches
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Extracting xen-4.8.5.tar.gz with bsdtar
bsdtar: Failed to set default locale
==> Starting build()...
+ patch -s -F0 -E -p1 --no-backup-if-mismatch -i ./patch-xen-no-downloads.patch
+ patch -s -F0 -E -p1 --no-backup-if-mismatch -i ./patch-xen-hotplug-external-store.patch
+ patch -s -F0 -E -p1 --no-backup-if-mismatch -i ./patch-xen-tools-qubes-vm.patch
+ patch -s -F0 -E -p1 --no-backup-if-mismatch -i ./patch-xen-gcc10-fixes.patch
1 out of 1 hunk FAILED -- saving rejects to file tools/xenstore/xenstored_core.h.rej
++ echo '*** patch ./patch-xen-gcc10-fixes.patch failed ***'
*** patch ./patch-xen-gcc10-fixes.patch failed ***
==> ERROR: A failure occurred in build().
make[2]: *** [/home/user/qubes-builder/qubes-src/builder-archlinux/Makefile.archlinux:134: dist-package] Error 4


--- tools/xenstore/xenstored_core.h
+++ tools/xenstore/xenstored_core.h
@@ -209,7 +209,7 @@ void finish_daemonize(void);
 /* Open a pipe for signal handling */
 void init_pipe(int reopen_log_pipe[2]);
-xengnttab_handle **xgt_handle;
+extern xengnttab_handle **xgt_handle;
 int remember_string(struct hashtable *hash, const char *str);

Why do you use a minimal template? Did you try with a fedora-32 as well?

Yes, I started out with the minimal template and tried it again with a full template. The patch failure still persists.

Do you use 4.0 or 4.1?
I don’t know anymore but there might be updated packages in current-testing. Did you try with testing enabled? In your fedora-32 template or if you want, clone it before enabling testing. Or did you try that already?
sudo dnf update --enablerepo=qubes-vm-r4.0-current-testing

I have to say that it took me quite a while and the help of a few other Qubes users until the template built successfully.

You can look for issues mentioned here and if this isn’t related to anything mentioned there you could open a new report.

I’m using 4.0 and it still failed. I’ll try my luck at github.
Thank you for your time :slight_smile:

@throwaway I had the same issue and replaced the content of the patch with this and successfully managed to build the template.

I can confirm this solved the issue for me as well, thanks!

1 Like