"ERROR: a failure occured in build" and other errors

Hi all,

Sorry if there is already a topic similar to this one, although I could not find it. I am a beginner Manjaro user, and today I went to update my software after having not for awhile. I was able to install most of the updates, but there are a few that are failing and I keep getting this error message. Any help is appreciated, thanks.

Preparing...
Synchronizing package databases...
Refreshing AUR...
Cloning gnome-shell-extension-material-shell build files...
Generating gnome-shell-extension-material-shell information...
Checking gnome-shell-extension-material-shell dependencies...
Cloning nordvpn-bin build files...
Generating nordvpn-bin information...
Checking nordvpn-bin dependencies...
Cloning gnome-shell-extension-unite build files...
Generating gnome-shell-extension-unite information...
Checking gnome-shell-extension-unite dependencies...
Cloning metis build files...
Generating metis information...
Checking metis dependencies...
Cloning visual-studio-code-bin build files...
Generating visual-studio-code-bin information...
Checking visual-studio-code-bin dependencies...
Cloning zoom build files...
Generating zoom information...
Checking zoom dependencies...
Cloning gklib build files...
Generating gklib information...
Checking gklib dependencies...
Resolving dependencies...
Checking inter-conflicts...
Building gnome-shell-extension-material-shell...
==> Making package: gnome-shell-extension-material-shell 44-1 (Wed 27 Sep 2023 05:54:31 PM PDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found gnome-shell-extension-material-shell-44.tar.gz
==> Validating source files with b2sums...
gnome-shell-extension-material-shell-44.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting gnome-shell-extension-material-shell-44.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
added 222 packages, and audited 223 packages in 3s
30 packages are looking for funding
run `npm fund` for details
2 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
rm -rf dist
cp -r schemas dist
mkdir dist
glib-compile-schemas dist/schemas/
mkdir: cannot create directory ‘dist’: File exists
make: *** [Makefile:23: dist] Error 1
make: *** Waiting for unfinished jobs....
Error opening directory “dist/schemas/”: No such file or directory
make: *** [Makefile:8: schemas] Error 1
==> ERROR: A failure occurred in build().
Aborting...

Welcome to the forum! :wave:

Please make sure you have the prerequisites for using the AUR. See Arch User Repository - Manjaro

The error is during building gnome-shell-extension-material-shell. Either way, make sure you’re fully up to date before you update your AUR packages, then try again.

1 Like

It looks like an upstream issue in gnome-shell-extension-material-shell, that Makefile is going to randomly fail with make -j$(nproc) because the schemas target should depend on the dist target. Without that they both run together and have a fight over the dist directory…

rm -rf dist
cp -r schemas dist
mkdir dist
glib-compile-schemas dist/schemas/

should be

rm -rf dist
mkdir dist
cp -r schemas dist
glib-compile-schemas dist/schemas/

I don’t use an AUR helper, maybe someone will know an easier solution than commenting out MAKEFLAGS="-j$(nproc)" in /etc/makepkg.conf. Or if you try the update enough times it might eventually work by luck…

1 Like

Indeed. I came up with this and it builds fine with MAKEFLAGS="-j$(($(nproc)+1))":

diff --git a/PKGBUILD b/PKGBUILD
index f2bcabf..f36f104 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,6 +19,12 @@ b2sums=("9fa945a71f20c7b7e1012fb738e10bfaccd908cb9de2248cb3a00158ff312723ea01f5b
 _dir="material-shell-${pkgver}"
 _uuid="material-shell@papyelgringo"
 
+prepare() {
+    cd "${srcdir}/${_dir}"
+    sed -i 's/mkdir dist/mkdir -p dist/g' Makefile
+    sed -i '/rm -rf dist/d' Makefile
+}
+
 build() {
     cd "${srcdir}/${_dir}"
     npm install --cache "${srcdir}/npm-cache"
1 Like

Apologies for needing the explanation, how should I go about implementing this solution when building gnome-shell-extension-material-shell?

See the Installing from the AUR by hand section of the wiki article I linked above. Before running makepkg, save my diff above to a file called PKGBUILD.diff and apply it to the PKGBUILD.

1 Like

Got it, thank you so much!

That looks weird to me.

nproc is the number or cores registerd and adding 1 to that makes no sense

e.g.

 $ nproc
24

 $ echo $(($(nproc)+1))
25

It looks like this commit:

All cores are in use with one job always queued. That way when a core becomes available, there’s already a job waiting for it instead of looking for something to do.

Yes, but it was changed to MAKEFLAGS="-j2" almost a year ago as some people were having issues building some packages.

3 Likes

make -j$(nproc) vs make -j$(($(nproc)+1)) vs make -j$(($(nproc)-1)) is probably up there on the list of programmer holy wars just behind vim vs emacs and tabs vs spaces. :laughing: Never seen much difference myself.

I forgot that I’d made changes to /etc/makepkg.conf;

$ diff /etc/makepkg.conf <(bsdtar -xOf /var/cache/pacman/pkg/pacman-6.0.2-13-x86_64.pkg.tar.zst etc/makepkg.conf)
41,42c41
< #CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
< CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
---
> CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
50c49
< MAKEFLAGS="-j$(nproc)"
---
> MAKEFLAGS="-j2"

https://unix.stackexchange.com/a/519095

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.