Pamac, aur and whether packages are built in a clean chroot

Hi, looking at the pamac manual, I am missing an item about the building of aur packages.

When one tries to build an install a package from the aur, how is the build managed? Does it work similarly to what would happen calling buildpkg that builds in a clean chroot, so that all the build dependencies remain nicely separated? Or does it build in the current root by first installing the necessary build dependencies on the system?

May I suggest that this is better clarified on the pamac man page?

I don’t know which environment pamac uses.

If you need a clean root build I suggest installing the package manjaro-chrootbuild.

Then outside the folder containing the PKGBUILD run - where pkg-name is the folder containing the actual PKGBUILD file

sudo chrootbuild -p pkg-name

to get an ideo of the options run

chrootbuild -h
2 Likes

pamac will check if a build directory for the package in question already exists. If it does, then it will use that one. If not, then it will create the build directory itself.

By default, all build directories reside under /var/tmp/pamac-build-yourusername.

1 Like

What I am mostly interested in is the following: the documentation of buildpkg explicitly states that “The buildpkg script creates a closed environment for building the package. This is done, so not to pollute your system with build artifacts”.

So my question could have been formulated as “when one installs aur packages with pamac can build artifacts remain around polluting the system or is the build directory used as a fully confined space?”

buildpkg and pamac are two different programs and are unrelated.

Indeed, but in this regard they can be used for a similar task: install a package from the aur.
With pamac you do it in an easy way with a single command.
With buildpkg you manually need to go through the 3 tasks:

  • download the package source from the aur (e.g. with a git clone and maybe --depth=1 in it)
  • build a binary package with buildpkg
  • install the package with pacman

What I am trying to find out is the following: buildpkg gives you a guarantee that the packages get built in a confined environment so you know that your system will not get polluted with build artifacts. To some extent, this confined way of building can also marginally protect you in case the PKGBUILD file is less than perfect.

If pamac can give you a similar guarantee, being it easier to use, there is no reason for taking the download+build+install route that is needed by buildpkg. The other way round, if pamac does not use a confined build environment and may leave artifacts around or have a higher probability of leaving issues in case the PKGBUILD script is sub-optimal, then I’d prefer to take to longer buildpkg route.

This is why I am asking.

Neither program comes with a warranty or guarantee.

As you already have discovered, buildpkg and pamac handle things differently. The former uses a chroot and does not leave build dependencies installed, the latter does not.

1 Like

Thanks, this is what I was looking for a confirmation.

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