I’ve noticed that some people like me have started to view the GCC Compile Farm as an attractive option for building rustc in the case that you a) don’t have a powerful computer to build on, b) need to build on other architectures, c) other valid reasons. However, it is not terribly straightforward to setup and use the GCC Farm, and the nature of a compile farm presents challenges to the ordinary edit-build-test workflow that most people are used to running locally.
So, I thought I’d share my set-up along with a couple of Bash scripts I wrote to assist with using GCC Farm for rustc.
Firstly, ensure you have registered on the GCC Compile Farm website, been approved, uploaded your public key for SSH, and waited for it to sync to the farm machines. You probably want to edit your SSH configuration to something like:
Host gcc*.fsffrance.org ControlMaster auto ControlPath ~/.ssh/control-%h:%p:%r HostName %h User <username> IdentityFile <keyfile> Include gcc-compile-farm
Next, when you actually want to use a server, I recommend keeping an active connection to one so that a master control connection is always open an available. This makes the workflow a bit smoother and faster.
Finally, the workflow scripts… The idea is to make the workflow for the developer as analogous as possible to the typical machine-local one. Put these scripts in your path (and make sure they’re executable, of course).
Here’s an example session (assuming in you’re in a rustc repo directory):
$ export GCC_FARM_SERVER=gcc10 # gcc10.fsffrance.org $ gcc-farm-rustc -s ./x.py build # syncs local dir to the server using rsync, then runs x.py to build $ gcc-farm-rustc -t ./x.py test # runs x.py to perform all tests on server, then syncs back "blessed" test results using rsync $ gcc-farm-rustc -s # just syncs local dir $ gcc-farm-rustc -t # just syncs back test outputs to local dir
The working tree (i.e., current state of the directory) of rustc is in fact synchronised to the server, albeit ignoring all the same files that
.gitignore does. Thus, there is no need to commit before syncing.
Note that the
gcc-farm script can be used generically, or built upon by another script like how
gcc-farm-rustc does. Inspect the scripts for environment variables that can be used to control behaviour.
In any case, your particular needs may deviate somewhat from my above set-up, but I thought I’d post this here as a guide to those getting started, in case it helps anyone. Feel free to post your own suggestions on this thread too.
(Thanks to @dlrobertson for discussing this with me and helping to test my scripts.)