Skip to content

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.

19 points24 comments
Open on Reddit
About this post
Posted
Archived
Score
19 · 100% up
Kind
Text
ID
2cd2kg

Author

3
posts
4
comments
0
media
View profile

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.

9 points

I'm thinking this would not be that hard to write. If OP is interested, here are my thoughts:

  • Server needs to either be running Arch or running Arch in a virtual machine. (I have a pretty powerful ESXi host to test with.)
  • Extend yaourt or aur.sh to optionally connect to a remote server for fetching sources and building a package. (/etc/yaourtrc? CLI switches?) The idea here is to be seamless, fetch official packages directly, use the build server for AUR packages.
  • Use SSH or HTTP to connect to the server? Does OP want to run a web server? Could this become the basis for a free web service that multiple people could connect to? Actually, the script could be written to handle both cases.
  • Cache built packages. Provide an option to force a rebuild of a package if needed.

If HTTP support is needed, there would be a need to make multiple requests:

  1. Start a build. If the package is already built and in the cache, and we are not forcing a rebuild, indicate as such, and go to #3.
  2. Build status. Fetch log output since the last Build Status request. This request would be made multiple times until the build is complete, if needed. When the build is complete, indicate as such. Go to #3.
  3. Package Download. Simply download and install the tar.xz package with Pacman.

I'm certainly over thinking this, but it could be a fun project.

2 points

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/

4 points

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.

3 points

I've tried distcc between the desktop and slower laptop and it's slower than compiling everything on the desktop.

1 points

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?

2 points

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

3 points

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.

4 points

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.

1 points

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).

1 points

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.

2 points

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

1 points

I solve this with an NFS-mounted pacman cache. Desktop and laptop are both running archlinux.

1 points

A solution that requires the following conditions:

  • An SSH access to the computer
  • The computer is also running archlinux

Install yaourt (facultative) and devtools (mandatory):

  1. SSH to the computer
  2. Get the package sources (yaourt is useful here: yaourt -G <pkgname>)
  3. cd into the package directory (where the PKGBUILD is)
  4. Compile the package in a clean way with extra-x86_64-build or extra-i686-build (depends on your slow laptop architecture)
  5. Get the compiled package (*.tar.xz) back to the slow computer using your favourite way (scp, ftp, http, mail, ...)
  6. Install the package with sudo pacman -U <pkgfile>.tar.xz

Drawbacks:

  • Very boring to do if there is a lot of packages (dependencies) to build in AUR
1 points

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.

1 points

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:

yaourt -Syyuua --devel --noconfirm

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.

0 points

It doesn't effect playback because it has a lower priority than does the video.

1 points

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

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.