DragonFly On-Line Manual Pages
DSYNTH(1) DragonFly General Commands Manual DSYNTH(1)
dsynth - dsynth bulk dports builder utility
dsynth [-dhvyDS] [-p profile] [-s n] [-m gb] directive [origins]
The dsynth utility allows a user to build and maintain part or all of
dports locally. dsynth figures out the dependency topology of the
dport(s) for you and is capable of building any number of ports
concurrently based on the configuration parameters you supply.
dsynth is based on an application called synth(1) which was written by
John Marino in Ada and served as the conceptual base for this program.
dsynth is written in C and designed to be as portable as possible given a
Our recommended build topology is with a configuration as follows:
This places all major directories under /build/synth. If you want to use
the same dports and the same distfiles as your base system, you can null-
mount /usr/distfiles onto /build/synth/distfiles and /usr/dports onto
/build/synth/dports with /etc/fstab entries as follows:
# Device Mountpoint FStype Options DumpPass#
/usr/distfiles /build/synth/distfiles null rw 4 4
/usr/dports /build/synth/dports null rw 4 4
Please set the number of builders and the maximum number of jobs per
builder according to available system resources. Remember that the total
load on the system can be as high as (builders x jobs), and at least 4x
that value in processes. Systems are typically restricted by memory and
CPU horsepower. Start conservative and ramp up according to what your
system can handle. A good rule of thumb is to set workers to the number
of CPU threads your machine has or to 1/2 the number of gigabytes of
memory your system has, whichever is lower. Then set the jobs per worker
to no more than the number of CPU threads your machine has.
dsynth has numerous features to manage machine load and swap usage to
prevent a machine from being overloaded, allowing more workers to be
configured than you might otherwise think is reasonable (which helps a
lot when building the smaller ports). However, users running this
program should be aware that very high loads and modest swap use are
still likely to develop when building a large number of ports or when
building very large ports like chromium. If the system is not dedicated
to building packages you can reduce the impact to the rest of the system
by running dsynth at nice +20 and also by reducing the number of workers
and number of jobs per worker somewhat.
We recommend that a minimum of 64GB of SSD-based swap be configured, or
twice as much swap as main memory, whichever is the higher value.
We recommend a minimum of 500GB of storage be configured in /build or
wherever you have configured various directories. A full set of
distfiles requires at least 120GB, a full dports including the git repo
requires at least 1.5GB, and a full set of built packages requires at
least 75GB. If using a filesystem such as HAMMER or HAMMER2 which frees
space overnight, double all of those numbers.
The actual build infrastructure uses tmpfs... memory and swap, and does
not use regular filesystem space.
Run in debug mode. If specified two or more times this will turn
off ncurses and output the primary log (00_last_results.log) to
the standard output, along with additional spew.
-h Quickly output a synopsis of options and directives and exit.
-m gb Override the default package dependency memory target, in
gigabytes. The default is 1/2 physical memory. The number of
workers will be limited such that the aggregate size of package
dependencies installed in each worker slot does not exceed this
This handles a well-known effect where the sheer amount of data
that has to be installed in tmpfs filesystems for large ports,
when multiplied by the number of worker slots, can force
excessive paging to occur and leave preciously little memory
available to actually run compiles. Some paging is necessary to
maintain maximum CPU utilization, but excessive paging can cause
the whole machine to essentially become idle for extended periods
-v Quickly output the version and exit.
-y Automatically answer 'y'es to any questions.
Override the global profile default in /etc/dsynth/dsynth.ini,
allowing you to trivially run whatever profile you like without
having to edit the configuration file when switching. In
addition, you can now run any number of dsynth's concurrently on
the same machine without having to use a jail, each with a
different profile, as long as the packages, repository,
buildbase, and logs directories are different.
Note that the distfiles directory can be shared and will not
conflict or get confused with concurrent fetches.
-s n dsynth usually slow-starts the worker slots, beginning with one
slot and increasing by one every 5 seconds until the maximum
configured number of workers is reached. This gives dsynth a
slower ramp that it can load manage against. Specifying 0
disables the slow-start feature and the maximum number of worker
slots (limited by the dependency graph) will be loaded
-D Turn on DEVELOPER mode when building ports.
-S[S] Turn off curses for script friendliness. The output will be log
00 and should be redirected to /dev/null or something similar.
If you supply the options twice, color output escapes will also
be turned off. You may also wish to use the -y option for
Generally dsynth is run with a directive and some directives allow a list
of ports to be specified. This list should be space-delimited in
DIR/SUBDIR format, for example: www/chromium. For directives with an
optional ports list, your current installed set of ports will be used if
you do not specify a list.
status This will do a dry-run of upgrade-system but not actually build
This will clean up any left-over mounts from prior builds.
dsynth attempts to clean up all processes and mounts when you
interrupt a build but doesn't always succeed.
init Creates and initializes the /etc/dsynth directory if it does not
exst. This directive will complain and exit if either
/etc/dsynth or /usr/local/etc/dsynth exists. It will not create
/etc/dsynth in this situation.
NOT CURRENTLY IMPLEMENTED
NOT CURRENTLY IMPLEMENTED. Incrementally build and upgrade your
locally installed packages, then upgrade your local system with
Incrementally build and upgrade your locally installed packages,
but do not upgrade your system with them.
Build or rebuild the database files for the configured
Delete any obsolete source distribution files.
This will do a dry-run of a full bulk build of everything, but
not actually build anything.
This will build the entire dports tree and then rebuild the
repository when it finishes.
This is for synth compatibility. The version of dsynth will be
printed and the program will exit.
help Output a synopsis of options and directives and exit.
Do a dry-run with 'build' of the given list.
Incrementally build dports based on the given list. When done,
ask whether the repository should be rebuilt or not.
Incrementally build dports based on the given list, then exits.
No post-build steps will be taken.
NOT CURRENTLY IMPLEMENTED. 'build' based on the supplied list
(or using currently installed packages), then rebuild the
repository and upgrade the system without asking any further
This is the same as 'build' but will delete existing packages
first. Dependencies are not deleted unless they are out of date.
This is the same as 'build' but sets the environment variable
DEVELOPER to `yes' and pre-deletes specified packages.
Dependencies are not deleted unless they are out of date.
/etc/dsynth/dsynth.ini The primary configuration file. If not
found, dsynth will also look in
Typically contains the environment
variables that will be set in the workers.
dsynth firewalls the environment it is run
under from the environment it provides to
/build/synth/build Recommended setting for
Directory_buildbase, contains the build
infrastructure... typically a template,
mirrored system directories, and mount
points for all the worker slots. The
template will be [re]generated if 'pkg'
needs to be built or if the .template.good
file in this directory is deleted.
/build/synth/distfiles Recommended setting for
Directory_distfiles, ports to a directory
into which dsynth will download any source
distribution files required for building.
/build/synth/dports Recommended setting for
Directory_portsdir, points to a checked
out dports repo. Note that dsynth does
not automatically 'git pull' or otherwise
synchronize the dports repo, you must do
that yourself prior to starting a build.
/build/synth/live_packages Recommended setting for
Directory_packages, points to a directory
which will contain the completed
/build/synth/logs Recommended setting for Directory_logs,
all log files will be placed in this
directory. Special management logfiles
begin with the numeral '0' for easily
location. The logfiles for ports while
and after building are stored in the form
subdir____portname.log, with three
/build/synth/options Recommended setting for Directory_options,
where options overrides for specific ports
may be located.
/ Recommended setting for Directory_system,
which dsynth uses as a basis for creating
the jails or chroots in each worker slot
during building. No part of the system
root is ever NULL-mounted read-write... it
is always NULL-mounted read-only. Some
elements from the system base will be
mirrored in the build-base as an
Note that the packages directory and the
distfiles directory is mounted read-write
in jails or chroots. All other r/w
filesystems in the workers are tmpfs(5)
based filesystems and will be created and
torn-down for each port.
.tbz The recommended setting for Package_suffix
is either .txz or .tgz. Use .txz for
better compression at the cost of somewhat
slower bulk builds due to the time
overhead for compression and
decompression, or use .tgz for modest
compression and very fast compression and
decompression. Due to the way the builder
works, package dependencies are fresly
installed into the chroot slot for each
package being built, so decompression time
The dsynth utility exits 0 on success, and >0 if an error occurs.
The dsynth utility first appeared in DragonFly 5.7.
Matthew Dillon <firstname.lastname@example.org>
DragonFly 5.7-DEVELOPMENT October 24, 2019 DragonFly 5.7-DEVELOPMENT