You are not logged in.

#1 2011-01-08 06:04:48

tomd123
Developer
Registered: 2008-08-12
Posts: 565

aurtools: tools for the arch user repository users

main website

aurtools in the aur
aurtools-git in the aur

Intro:
"Building in a clean chroot prevents missing dependencies in packages, whether due to unwanted linking or packages missing in the depends array in the PKGBUILD. It also allows you to build a package for the stable repositories (core, extra, community) while having packages from [testing] installed on your system." quote from https://wiki.archlinux.org/index.php/De … Chroot#Why

Benefits:
Since all packages in main repos are built in a chroot, in theory, it guarantees that everyone will get the same experience from the packages. I think the aur needs a similar system for building packages instead of just running makepkg -si and ignoring package correctness. Too often I have stumbled upon packages which had missing (deps like ruby) or were completely wrong if not run on the original submitter's computer. Building packages in a clean chroot should eliminate these types of problems and really is the "correct" way of building a package. Building in a chroot also makes it safe to redistribute your packages to others.

Usage:
In a directory with a PKGBUILD, run aur-i686-build or aur-x86_64-build instead of makepkg. This will build a package in a clean chroot, and put the resulting package in a custom repo under /var/tmp/aurtoolsrepo/ for use with later builds when you need to build an aur package with a dependency for another aur package. If you haven't figured out already, aurtools doesn't automatically build deps for a package, but relies on the user to first build all aur dependencies of a package before building the aur package itself.

For example, lets say I want to install xxxterm then I would check for any aur dependencies of xxxterm. It depends on one aur package, libbsd. Since libbsd doesn't depend on any aur packages we can start with the build process. Run aur-x86_64-build on the libbsd PKGBUILD, after building the package without errors, cd into xxxterm and run aur-x86_64-build. Then we can install the resulting packages on our system.

Implementation notes:
aurtools is really just a modified version of archbuild from devtools, the only main difference is that it contains an external local repository to make aur chroot building less dependent on the user maintaining a set of packages built in a chroot.

Comments? Suggestions? I would love to hear what you think!

Edit:

New Features
I have added automatic dependency resolution to aurtools. This means, that you don't have to resolve the dependencies yourself.
This means that all you should really do is just run aurtools on a PKGBUILD and if there are aur dependencies it will auto build them in chroots.
All that is left for you to do, is to install the resulting packages.

Last edited by tomd123 (2011-01-23 19:58:46)

Offline

#2 2011-01-08 09:38:51

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: aurtools: tools for the arch user repository users

so do i have to create a chroot with mkarchroot first do be able to build within it?

Offline

#3 2011-01-08 15:56:12

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

No, it creates the chroot automatically on the first run and always keeps it updated with each new run.
So all you really have to do is just issue "aur-x86_64-build or aur-i686-build" in a directory with a PKGBUILD.

Offline

#4 2011-01-10 17:43:22

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: aurtools: tools for the arch user repository users

really nice! but there's one thing left. i always get this error

==> Checking Runtime Dependencies...
==> Installing missing dependencies...
sudo: must be setuid root
==> ERROR: 'pacman' failed to install missing dependencies.

what is the best way to correctly manage privileges?

Offline

#5 2011-01-11 00:11:25

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

broken pipe wrote:

really nice! but there's one thing left. i always get this error

==> Checking Runtime Dependencies...
==> Installing missing dependencies...
sudo: must be setuid root
==> ERROR: 'pacman' failed to install missing dependencies.

what is the best way to correctly manage privileges?

This really isn't a problem of aurtools, pacman just needs to be run as root whenever you install something locally. Try running sudo pacman.

Offline

#6 2011-01-12 10:41:01

sm4tik
Member
From: Finland, Jyväskylä
Registered: 2006-11-05
Posts: 248
Website

Re: aurtools: tools for the arch user repository users

Hey, I was just going to read about howto set up a clean chroot to make sure all deps are correct in my PKGBUILDs and what did I find big_smile I will definitely try this out and comment on it later!

edit: I've built my first package with this and I have to say it really saved me a lot of time not having to set everything up myself. Everything worked as expected and even my PKGBUILD was ok smile If something comes up, I'll let you know!

Last edited by sm4tik (2011-01-13 10:52:35)

Offline

#7 2011-01-14 11:09:03

sm4tik
Member
From: Finland, Jyväskylä
Registered: 2006-11-05
Posts: 248
Website

Re: aurtools: tools for the arch user repository users

Hi again. I've been having a bit of a trouble with a -hg package and trying to make a PKGBUILD that works with makechrootpkg I've noticed autools script always executes every line even if, say the package build fails or if I stop the process with CTRL-C. Just an idea, but there could be some checks if a command exits cleanly and accordingly decide what to do next. For instance, there's no point in trying to add the package to the repo if the build has failed.
I'll try to get my -hg package built and post my comments on it later. I think it's a makechrootpkg issue though, so I don't know if it's relevant here?

Offline

#8 2011-01-14 11:33:39

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: aurtools: tools for the arch user repository users

If you think it's a makechrootpkg issue, your first step should be running makechrootpkg separately, instead of the wrapper aurtools provides. That's how you narrow it down. If it indeed is a makechrootpkg issue, then please file a bug report.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#9 2011-01-14 15:45:39

sm4tik
Member
From: Finland, Jyväskylä
Registered: 2006-11-05
Posts: 248
Website

Re: aurtools: tools for the arch user repository users

.:B:. wrote:

If you think it's a makechrootpkg issue, your first step should be running makechrootpkg separately, instead of the wrapper aurtools provides. That's how you narrow it down. If it indeed is a makechrootpkg issue, then please file a bug report.

Yiep, I will investigate it seperately and make a report if necessary.

Offline

#10 2011-01-14 18:03:15

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: aurtools: tools for the arch user repository users

" resulting package in a custom repo under /var/tmp/aurtoolsrepo/  "

Is that possible to change the result from aurtools to other directory?


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#11 2011-01-14 21:48:36

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

hellnest wrote:

" resulting package in a custom repo under /var/tmp/aurtoolsrepo/  "

Is that possible to change the result from aurtools to other directory?

yes, just change the line:

AURREPODIR=/var/tmp/aurtoolsrepo

in the aurtoolsbuild file but don't forget to keep the /${arch} after it
I probably should add a seperate user config file so that you don't have to modify the main file.

Offline

#12 2011-01-15 05:00:34

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: aurtools: tools for the arch user repository users

Yeah that's what i mean hehe, Thanks for the info.


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#13 2011-01-15 09:38:21

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: aurtools: tools for the arch user repository users

a configuration file would be great, because i dislike editing package files and my /var partition is bit limited by size and by permissions (noexec).

Offline

#14 2011-01-15 16:34:43

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

I just pushed a commit to git to seperate the variables into /etc/aurtools.conf for easier configuration.
Any feedback or requests would be appreciated.

Try aurtools-git with this feature for now, I still haven't released a version of aurtools with this change.

Offline

#15 2011-01-15 16:56:59

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: aurtools: tools for the arch user repository users

@tomd123
Thanks for the quick commit smile i will try it after upgrading my Libre office package smile


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#16 2011-01-15 17:10:46

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: aurtools: tools for the arch user repository users

it doesn't do anything! i edited the config file, changed into a pkgbuild and ran aur-x86_64-build but nothing happens. it doesn't build anything but returns without any errors.

Offline

#17 2011-01-15 18:26:14

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

broken pipe wrote:

it doesn't do anything! i edited the config file, changed into a pkgbuild and ran aur-x86_64-build but nothing happens. it doesn't build anything but returns without any errors.

Ok, fixed it. Needed to add parenthesis: https://github.com/gostrc/aurtools/comm … 2756660550

Rebuild aurtools-git and all should work now smile

Last edited by tomd123 (2011-01-15 18:26:38)

Offline

#18 2011-01-15 18:35:19

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: aurtools: tools for the arch user repository users

thx works now! :>

there's still one thing: always when i try to build a package with missing dependencies, pacman fails at installing them sad

Building in chroot for [aur] (x86_64)...
creating clean working copy...done
==> Making package: i3-git 20100616-1 (Sat Jan 15 18:53:10 UTC 2011)
==> Checking Runtime Dependencies...
==> Installing missing dependencies...
sudo: must be setuid root
==> ERROR: 'pacman' failed to install missing dependencies.

Last edited by broken pipe (2011-01-15 18:53:53)

Offline

#19 2011-01-15 20:49:43

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

This is odd. I can not reproduce this, and that part that is failing is under makechrootpkg. Can you please see if you can build something using a regular makechrootpkg?

Offline

#20 2011-01-15 21:15:18

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: aurtools: tools for the arch user repository users

Check the permissions on the sudo binary in the chroot.

Offline

#21 2011-01-16 09:29:50

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: aurtools: tools for the arch user repository users

makechrootpkg returns with the same error sad

i checked the permissions in the chroot:

-rwxr-xr-x 1 root   root    216208 18. Dez 03:05 strip
---s--x--x 2 root   root    194328 13. Jan 06:13 sudo
---s--x--x 2 root   root    194328 13. Jan 06:13 sudoedit
---x--x--x 1 root   root     44206 13. Jan 06:13 sudoreplay

Offline

#22 2011-01-16 15:32:56

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

@broken pipe
Well, I don't know how you got those permissions, but it would be easier if you could just create new clean chroots.
Use sudo rm -rf /var/tmp/aurtoolscache and try again.

Offline

#23 2011-01-23 19:53:06

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

I have now pushed automatic dependency resolution to aurtools-git.
You must have cower installed to use it now.
This feature lets you just run the tool on a PKGBUILD and it will automatically download all dependencies and recursively build those in clean chroots.
I have already found tons of bugs in the aur packages doing this.
Enjoy!

Offline

#24 2011-02-05 22:58:27

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: aurtools: tools for the arch user repository users

Just pushed aurtools 0.3 which adds automatic package resolution.

Last edited by tomd123 (2011-02-05 22:58:37)

Offline

Board footer

Powered by FluxBB