NAME
dsynth
—
dsynth bulk dports builder
utility
SYNOPSIS
dsynth |
[-dhvxyDSN ] [-p
profile] [-s
n] [-m
gb] directive [origins] |
dsynth |
help |
DESCRIPTION
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.
also detects changes made to the ports tree and rebuilds packages and anything that depends on those packages as needed.
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 ports-style
infrastructure.
Our recommended build topology is with a configuration as follows:
[Global Configuration] profile_selected= LiveSystem [LiveSystem] Operating_system= DragonFly Directory_packages= /build/synth/live_packages Directory_repository= /build/synth/live_packages/All Directory_portsdir= /build/synth/dports Directory_options= /build/synth/options Directory_distfiles= /build/synth/distfiles Directory_buildbase= /build/synth/build Directory_logs= /build/synth/logs Directory_ccache= disabled Directory_system= / Package_suffix= .txz Number_of_builders= 8 Max_jobs_per_builder= 8 Display_with_ncurses= true
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.
OPTIONS
-d[d...]
- 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 value.
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 of time.
-p
profile- 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
ndsynth
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 givesdsynth
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 immediately.-v
- Quickly output the version and exit.
-x
-xx
- Normally dsynth builds a package for any of three reasons: (1) If the
contents of the ports directory changes, (2) If anything the port depends
on requires rebuilding so to will the port be rebuilt, (3) If there is no
binary package already built for the port.
If this option is specified, the first test is ignored. If this option is specified twice, the first and second tests are ignored.
-y
- Automatically answer 'y'es to any questions.
-D
- Turn on DEVELOPER mode when building ports.
-P
- Include the check-plist stage. This is the default for the
everything
directive. -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 scripting dsynth. -N
- Normally
dsynth
nices its sub-processes to +10. This option disables the feature.
DIRECTIVES
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.
init
- Creates and initializes the /etc/dsynth directory if it does not exist. 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.
status
- This will do a dry-run of
upgrade-system
but not actually build anything. cleanup
- 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. configure
- NOT CURRENTLY IMPLEMENTED
upgrade-system
- NOT CURRENTLY IMPLEMENTED. Incrementally build and upgrade your locally installed packages, then upgrade your local system with them.
prepare-system
- Incrementally build and upgrade your locally installed packages, but do not upgrade your system with them.
rebuild-repository
- Build or rebuild the database files for the configured repository.
purge-distfiles
- Delete any obsolete source distribution files.
reset-db
- Delete ports_crc.db from the build directory. This database is used to detect changes made to the dports tree. It will be regenerated on your next build without forcing any packages to be rebuilt.
status-everything
- This will do a dry-run of a full bulk build of everything, but not actually build anything.
everything
- This will build the entire dports tree and then rebuild the repository when it finishes.
version
- 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.
status
[ports]- Do a dry-run with 'build' of the given list.
build
[ports]- Incrementally build dports based on the given list. When done, ask whether the repository should be rebuilt or not.
just-build
[ports]- Incrementally build dports based on the given list, then exits. No post-build steps will be taken.
install
[ports]- 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 questions.
force
[ports]- This is the same as 'build' but will delete existing packages first. Dependencies are not deleted unless they are out of date.
test
[ports]- 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. debug
[ports]- This is the same as 'build' but leaves the chroot mounts intact upon completion.
monitor
[datfile]- Monitors a running dsynth instance.
FILES
- /etc/dsynth/dsynth.ini
- The primary configuration file. If not found,
dsynth
will also look in /usr/local/etc/dsynth/dsynth.ini. - /etc/dsynth/LiveSystem-make.conf
- 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 the workers. - /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 application packages.
- /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 underscores.
- /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 optimization.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.
- .txz
- .tgz
- .tar
- .tbz
- .tzst
- 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 matters.
EXIT STATUS
The dsynth
utility exits 0 on
success, and >0 if an error occurs.
SEE ALSO
HISTORY
The dsynth
utility first appeared in
DragonFly 5.7.
AUTHORS
Matthew Dillon <dillon@backplane.com>