How to fix this build error in AUR with gradle (probably related to permissions)

I am trying to install an AUR package
I get the following problem, I think it’s a permissions problem.

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/5.6.4/userguide/gradle_daemon.html
Process command line: /usr/lib/jvm/java-11-openjdk/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/user/.gradle/wrapper/dists/gradle-5.6.4-all/ankdp27end7byghfw1q2sw75f/gradle-5.6.4/lib/gradle-launcher-5.6.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.6.4
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ClassLoaderRegistry using GlobalScopeServices.createClassLoaderRegistry().

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
==> ERROR: A failure occurred in build().
    Aborting...

I tried:

sudo chmod -R 750 ~/.gradle

without success

Which one? Please don’t be purposely vague. Help us help you.

This is Manjaro. Manjaro is not Arch. Arch is not Manjaro.

Unless you meant you tried both installing the nameless AUR package in both Manjaro and Arch? :thinking:

Please post the full build log, not just what you think is relevant.

If it’s a bit long, please use a pastebin service and link it here.

NEVER use sudo in your $HOME directory.

1 Like

Which one? Please don’t be purposely vague.

I think there is nothing wrong with the package (bisq), but I tried hardening my system and I think this is one of the problems I ran into because the package needs to be built.
I think it has something to do with my permissions somewhere, also my /var is on a (moderate) restricted partition.

I also think the solution is this:

“Try setting your GRADLE_USER_HOME variable to a folder where you have valid access. Then this error will go away.”

source: Gradle Could not create service of type InitScriptHandler using BuildScopeServices.createInitScriptHandler() - Stack Overflow
But because it’s inside an AUR package (and I don’t directly have gradle installed) this makes it a lot more complicated. I don’t know where to define GRADLE_USER_HOME and I don’t know where to point it to.

This is Manjaro. Manjaro is not Arch. Arch is not Manjaro.

No you are initially correct, I only installed it on Manjaro, not arch. I also asked the question here linux - How to fix this build error in AUR with gradle (probably related to permissions) - Stack Overflow
For us there is a big difference between arch and Manjaro, but for the rest of the world arch and manjaro are different flavors of the same kind of linux. thats why I said arch. maybe I’m wrong.

NEVER use sudo in your $HOME directory.

Why is that? also why never use sudo with a gui program? (nano vs gedit for instance?)

here is a snippet from my /etc/fstab which may be relevant I think:

/dev/mapper/filesystem / ext4 defaults,noatime 0 1
/dev/mapper/dev /dev ext4 rw,nosuid,noexec,relatime,size=4003648k,nr_inodes=1000912,mode=755 0 2
/dev/mapper/home /home ext4 defaults,nosuid,nodev 1 2
/dev/mapper/var /var ext4 defaults,nosuid 1 2

pastebin of build:
https://paste.c-net.org/ManeuverMarlon

Why do you mount it as an ext4?
My Manjaro has this when looking with mount:

devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,size=16369472k,nr_inodes=4092368,mode=755,inode64)

PS: without any config in fstab for this…

Also the output in your pastebin does not show the lines in the OP, and neither the output using the suggested flags to show what it is complaining about exactly.

Without enough info, no one will be able to troubleshoot together with you, or even give helpful feedback…

An AUR package is basically just a recipe to build something, so you should be able to perform all of it’s steps manually via a terminal.
Check it’s PKGBUILD for what it is scripted to do.

Why do you mount it as an ext4 ?

I wrote that myself, but I think I made a mistake.

PKGBUILD:

# Maintainer: David Parrish <daveparrish@tutanota.com>
# Co-Maintainer: Felix Golatofski <contact@xdfr.de>

pkgname=bisq
pkgver=1.5.1
pkgrel=1
pkgdesc="Cross-platform desktop application that allows users to trade national currency (dollars, euros, etc) for bitcoin without relying on centralized exchanges"
arch=('any')
url="https://bisq.network"
license=('AGPL3')
depends=('jdk11-openjdk' 'bash')
makedepends=('git' 'git-lfs' 'jdk11-openjdk')
source=("bisq.desktop")
sha256sums=('687d643fbe84660c3ebfe6270de98214f2e3ea791cb1d07d96d7ed889d61d406')

_binname=Bisq
conflicts=("bisq-bin" "bisq-git")
provides=("bisq")

prepare() {
  git lfs install
  rm -rf "${srcdir}/${pkgname}-${pkgver}"
  git clone --depth=1 --branch=v${pkgver} https://github.com/bisq-network/bisq.git ${pkgname}-${pkgver}
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}" || exit
  msg2 "Building bisq..."
  ./gradlew clean :desktop:build -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk -x test
}

package() {
  # Install executable.
  install -d "${pkgdir}/opt/bisq"
  cp -r "${srcdir}/${pkgname}-${pkgver}/desktop/build/app/"* "${pkgdir}/opt/bisq"
  cp -r "${srcdir}/${pkgname}-${pkgver}/bisq-desktop" "${pkgdir}/opt/bisq/"
  install -d "${pkgdir}/usr/bin"
  ln -s "/opt/bisq/bisq-desktop" "${pkgdir}/usr/bin/bisq-desktop"

  # Install desktop launcher.
  install -Dm644 bisq.desktop "${pkgdir}/usr/share/applications/bisq.desktop"
  install -Dm644 "${srcdir}/${pkgname}-${pkgver}/desktop/package/linux/icon.png" "${pkgdir}/usr/share/pixmaps/bisq.png"
}

Also the output in your pastebin does not show the lines in the OP, and neither the output using the suggested flags to show what it is complaining about exactly.

I pasted the output from pamac after I tried to build it again. this is all the info I have.

I would suggest you to read Creating packages - ArchWiki, to understand how that process works.
After that perform the actions needed according to the PKGBUILD manually.

From there on you should be able to troubleshoot further using the suggested options for the Gradle build, which should give you enough info on why it is failing.

Because as you said the problem you’re facing is because:

Exactly. The project uses it’s own gradlew binary during build.

Why would you not have access to a directory in your own $HOME?

For one, it can cause problems like this. If anything in a user directory is owned by root, you no longer have access.

I just built bisq successfully. Try removing ~/.gradle and do a clean build.

1 Like

I don’t know where the GRADLE_USER_HOME variable should be defined, and I don’t know where to point it to.

It doesn’t need to be defined at all.

this worked for me lol

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