AUR helper - use a different computer to compile package?
I'm sort of new to arch linux, I've read about the ABS, makepkg etc and I think I sort of understand it. I love the AUR - it's pretty awesome(especially with a good aur helper)
However, my main computing is done on a laptop with a very slow processor(2955u celeron) - I have a home server at my house with an 8-core CPU that runs circles around my mobile celeron. I was wondering if there was a way to have an aur helper send a request to my server to compile the package, then get the package from my server back to my laptop and install it.
I'm sorry if there's an obvious answer for this, I spent a good amount of time googling and checking the wiki/forums but I saw nothing.
About this post
- Posted
- Archived
- Score
- 19 · 100% up
- Kind
- Text
- ID
- 2cd2kg
24 comments
Have a look at aur.sh (https://wiki.archlinux.org/index.php/Aur.sh) or i guess any other aur helper. I think every one of them gives you the option just to create the package without installing it. After that you can transfer it to your notebook and install it there.
Of course you could do that via a script.
I haven't done that myself, so i can't give you any advice how exactly you should implement it, but i guess that gives you the general idea how i would approach it.
I'm thinking this would not be that hard to write. If OP is interested, here are my thoughts:
If HTTP support is needed, there would be a need to make multiple requests:
I'm certainly over thinking this, but it could be a fun project.
My first thought was to install arch as a virtualbox guest on your home server box (Give the virtualbox guest 4 cores or more) and do your AUR stuff on there. Just ssh into it, do your AUR stuff, then grab the outputted pacman pkg and install it on your laptop.
Make sure to compile the package with the same architecture as your laptop (x86 or x86_64).
You can also look into Distcc but I've never used it, and it would still require another computer on your network with gcc and distcc installed to distribute the workload to.
https://code.google.com/p/distcc/
Distcc is a really good choice. I use distcc so my desktop can help compile packages for my raspberry pi. It works really well, but takes some configuring and log-monitoring to make sure it's actually performing as expected. But once you set it up, it's completely seamless.
I've tried distcc between the desktop and slower laptop and it's slower than compiling everything on the desktop.
Well that doesn't make sense. Perhaps the configuration can be refined. Have you read the wiki page? have you tried it over a wired connection?
I too am interested in this topic, as I use a both a netbook and a much faster desktop PC. Last time I compiled something from aur, netbook took three times longer. Anyway, my way of doing it was just using makepkg with custom CFLAGS exported to environment (to optimize for atom), then copying over the package. Lots of room for improvement there.
EDIT: seems like both of us should look into https://wiki.archlinux.org/index.php/Distcc
If this is going to be turned into "a thing" then distcc is really the first place people should be looking.
Mostly because it's unlikely your slow pc (old 32bit celeron, raspberry pi, whatever) is running the same architecture as your new fancy CPU (x86_64 most likely). Distcc is the "real" way to get around that.
Write a bash script that you can call through ssh that will build a specific package, copy it to a repository hosted on your home server over HTTP/FTP/whatever. Then write another bash script to call the server over ssh, and then download the package from your repo with pacman.
That sounds a lot more complicated than simply sharing the pacman cache directory over the network. This way all machines can easily share packages, with the fastest machine building them (assuming the same architecture).
Sharing the cache directory means you need to manually build the package on the server first. Also, mixups can happen if there are different versions of the same package in the cache.
I would very much like to see said script if OP writes it, I am very new to scripting, but this seems rather awesome. wonder if it can be used with yaourt support as well
I solve this with an NFS-mounted pacman cache. Desktop and laptop are both running archlinux.
A solution that requires the following conditions:
Install
yaourt(facultative) anddevtools(mandatory):yaourt -G <pkgname>)cdinto the package directory (where the PKGBUILD is)extra-x86_64-buildorextra-i686-build(depends on your slow laptop architecture)sudo pacman -U <pkgfile>.tar.xzDrawbacks:
I don't think there is a good out of the box solution for this. aZeex2ai's recommendation of a NFS mounted pacman cache is a great idea. It may also be possible to also set up a shared directory to save PKGBUILDS to, and then have your server automatically compile anything you put into that directory from your laptop. So basically, you get the PKGBUILD, save it to the shared pkgbuild directory, server detects it and compiles and puts the new package in the shared pacman cache or a shared aur package directory. You'd need to script this of course, and if your server is running Arch then you could wrap an existing aur helper to have it automatically take care of dependencies as well.
Distcc is fine, but maybe icecream is better suited for you.
AUR Link
I have looked into this as well, since my main comp is a netbook with a gaming PC left at home, but gave up as I couldn't find a good way to do it. It doesn't matter to much honestly, at least for me. I use LXQT as a desktop, which means a bit of stuff needs compiled, though they are all pretty small. Thus every few nights I run in Terminator, a scrollback of infinite:
This takes less then an hour to update everything for me (N570 atom with 2gb ram). I start it right before I play a show on XBMC (Kodi now I guess). I finish it, and my update is done, doesn't effect the playback at all.
It doesn't effect playback because it has a lower priority than does the video.
I know, though on atom's I have found that alot of things still F it (like firefox), even though I change XBMC's niceness to be -10