Using Synth

Here you can discuss anything related to GhostBSD documentation and the FAQ's section.

Moderator: Developer

Using Synth

Postby kraileth » Wed Apr 19, 2017 3:39 pm

This is a first draft for a wiki article on Synth.

----------

Synth is one of two tools that can be used to create local package repositories for FreeBSD (the other being Poudriere). It is quite fast due to building packages in RAM.

Requirements

To use Synth you need a ports tree in place (in /usr/ports). If you don't have it, fetch it using the tool portsnap or check it out from SVN:

Code: Select all
# portsnap fetch extract


OR

Code: Select all
# svnlite co svn://svn.freebsd.org/ports/head /usr/ports


If you want the stable ports branch, checkout that one instead of head.

Synth also needs a distfiles directory. Either create it in the default location or, as Synth suggests, feel free to put it somewhere else as in that case you can always delete your ports directory and keep the distfiles (remember to adjust configuration in that case!):

Code: Select all
# mkdir -p /usr/ports/distfiles


Installing Synth

To install Synth either use pkg or build from ports:

Code: Select all
pkg install synth


OR

Code: Select all
make -C /usr/ports/ports-mgmt/synth


Configure Synth

Now you need to configure Synth:

Code: Select all
# synth configure


Take a look at the directories (A - G) and change them if desired.

Synth will suggest a certain number of builders (I) and jobs (J) based on your hardware (CPU and RAM available). Feel free to tune these numbers! Depending on several factors (and depending on what you want to build) other configurations may fit your needs better. Builders are the number of packages that are build concurrently. Jobs are the number of threads used for compilation of every builder. Example: If you have a four core CPU with hyperthreading that means you have eight threads available. To theoretically saturate your CPU you could use 1 builder and 8 jobs. This would be the equivalent to building software with "make -j 8". You could also decide to use 2 builders with 4 jobs each or 4 builders with 2 jobs. Since package building consists of more steps than just compiling, your CPU usually won't be under maximum load all the time. For that reason it can make sense for example to configure Synth to use 4 builders with 3 jobs even if you don't actually have 12 threads! Play with this number and find out what works best for your machine and your workload.

You should leave K and L enabled unless you have very little RAM. If you experience that Synth is using high amounts of swap all the time, first consider building less packages concurrently or with less jobs. As a last resort disable K and/or L.

Disable M if you can't stand the curses interface.

N gives you the option to fetch prebuilt packages (from the FreeBSD repo) to satisfy dependencies instead of building those locally, too.

And then there's H which will be discussed separately.

Using Synth

To be written...
kraileth
Developer
 
Posts: 202
Joined: Sun Sep 04, 2016 3:30 pm
Has thanked: 28 times
Been thanked: 22 times

Using Synth


Re: Using Synth

Postby ASX » Wed Apr 19, 2017 6:33 pm

please allow me a couple of notes:

instead of:
Code: Select all
# svnlite co svn://svn.freebsd.org/ports/head


I think is preferable something like, (which will correspond to portsnap results):
Code: Select all
# svnlite co svn://svn.freebsd.org/ports/head  /usr/ports


Also, distfiles are better placed outside /usr/ports tree, reason is: if something go wrong while fetching ports updates you can always delete /usr/ports and re-fetch, saving the distfiles, and avoid to re-download them again.
ASX
Developer
 
Posts: 542
Joined: Wed May 06, 2015 3:46 pm
Location: ITALY
Has thanked: 25 times
Been thanked: 36 times

Re: Using Synth

Postby kraileth » Wed Apr 19, 2017 9:04 pm

ASX wrote:please allow me a couple of notes:

instead of:
Code: Select all
# svnlite co svn://svn.freebsd.org/ports/head


I think is preferable something like, (which will correspond to portsnap results):
Code: Select all
# svnlite co svn://svn.freebsd.org/ports/head  /usr/ports


Totally! That path was was meant to be there and I simply lost it somehow.

Also, distfiles are better placed outside /usr/ports tree, reason is: if something go wrong while fetching ports updates you can always delete /usr/ports and re-fetch, saving the distfiles, and avoid to re-download them again.


I'll add the reason to the text. A little explanation never hurts.
kraileth
Developer
 
Posts: 202
Joined: Sun Sep 04, 2016 3:30 pm
Has thanked: 28 times
Been thanked: 22 times


Return to Documentation

Who is online

Users browsing this forum: No registered users and 1 guest