17a57a34fSSascha Wildner.\" 2c6142119SAntonio Huete Jimenez.\" Copyright (c) 2021 The DragonFly Project. All rights reserved. 38ec23ca1SMatthew Dillon.\" 48ec23ca1SMatthew Dillon.\" This code is derived from software contributed to The DragonFly Project 58ec23ca1SMatthew Dillon.\" by Matthew Dillon <dillon@backplane.com> 68ec23ca1SMatthew Dillon.\" This code is based on a concept originally developed by John R. Marino. 78ec23ca1SMatthew Dillon.\" 88ec23ca1SMatthew Dillon.\" Redistribution and use in source and binary forms, with or without 98ec23ca1SMatthew Dillon.\" modification, are permitted provided that the following conditions 108ec23ca1SMatthew Dillon.\" are met: 118ec23ca1SMatthew Dillon.\" 128ec23ca1SMatthew Dillon.\" 1. Redistributions of source code must retain the above copyright 138ec23ca1SMatthew Dillon.\" notice, this list of conditions and the following disclaimer. 148ec23ca1SMatthew Dillon.\" 2. Redistributions in binary form must reproduce the above copyright 158ec23ca1SMatthew Dillon.\" notice, this list of conditions and the following disclaimer in 168ec23ca1SMatthew Dillon.\" the documentation and/or other materials provided with the 178ec23ca1SMatthew Dillon.\" distribution. 188ec23ca1SMatthew Dillon.\" 3. Neither the name of The DragonFly Project nor the names of its 198ec23ca1SMatthew Dillon.\" contributors may be used to endorse or promote products derived 208ec23ca1SMatthew Dillon.\" from this software without specific, prior written permission. 218ec23ca1SMatthew Dillon.\" 228ec23ca1SMatthew Dillon.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 238ec23ca1SMatthew Dillon.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 248ec23ca1SMatthew Dillon.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 258ec23ca1SMatthew Dillon.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 268ec23ca1SMatthew Dillon.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 278ec23ca1SMatthew Dillon.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 288ec23ca1SMatthew Dillon.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 298ec23ca1SMatthew Dillon.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 308ec23ca1SMatthew Dillon.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 318ec23ca1SMatthew Dillon.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 328ec23ca1SMatthew Dillon.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 338ec23ca1SMatthew Dillon.\" SUCH DAMAGE. 348ec23ca1SMatthew Dillon.\" 35c1bd0b08SAntonio Huete Jimenez.Dd August 21, 2021 367a57a34fSSascha Wildner.Dt DSYNTH 1 378ec23ca1SMatthew Dillon.Os 388ec23ca1SMatthew Dillon.Sh NAME 398ec23ca1SMatthew Dillon.Nm dsynth 408ec23ca1SMatthew Dillon.Nd dsynth bulk dports builder utility 418ec23ca1SMatthew Dillon.Sh SYNOPSIS 428ec23ca1SMatthew Dillon.Nm 439078b68bSSascha Wildner.Op Fl dhvxyDNPS 442c9f4f91SMatthew Dillon.Op Fl p Ar profile 458ec23ca1SMatthew Dillon.Op Fl s Ar n 467f0eca56SMatthew Dillon.Op Fl m Ar gb 474ad2f7b8SMatthew Dillon.Op Fl M Ar scale 488ec23ca1SMatthew Dillon.Ar directive 498ec23ca1SMatthew Dillon.Op origins 508ec23ca1SMatthew Dillon.Nm 518ec23ca1SMatthew Dillon.Ar help 528ec23ca1SMatthew Dillon.Sh DESCRIPTION 538ec23ca1SMatthew DillonThe 548ec23ca1SMatthew Dillon.Nm 558ec23ca1SMatthew Dillonutility allows a user to build and maintain part or all of dports 568ec23ca1SMatthew Dillonlocally. 578ec23ca1SMatthew Dillon.Nm 58f1a6aed6SSascha Wildnerfigures out the dependency topology of the dport(s) for you and 598ec23ca1SMatthew Dillonis capable of building any number of ports concurrently based 608ec23ca1SMatthew Dillonon the configuration parameters you supply. 618ec23ca1SMatthew Dillon.Pp 62b6bd007bSMatthew Dillonalso detects changes made to the ports tree and rebuilds packages 63b6bd007bSMatthew Dillonand anything that depends on those packages as needed. 64b6bd007bSMatthew Dillon.Pp 658ec23ca1SMatthew Dillon.Nm 668ec23ca1SMatthew Dillonis based on an application called 678ec23ca1SMatthew Dillon.Xr synth 1 68650b8785SSascha Wildnerwhich was written by John Marino in Ada and served as the conceptual base 698ec23ca1SMatthew Dillonfor this program. 708ec23ca1SMatthew Dillon.Nm 718ec23ca1SMatthew Dillonis written in C and designed to be as portable as possible given a 728ec23ca1SMatthew Dillonports-style infrastructure. 738ec23ca1SMatthew Dillon.Pp 748ec23ca1SMatthew DillonOur recommended build topology is with a configuration as follows: 758ec23ca1SMatthew Dillon.Bd -literal 768ec23ca1SMatthew Dillon[Global Configuration] 778ec23ca1SMatthew Dillonprofile_selected= LiveSystem 788ec23ca1SMatthew Dillon 798ec23ca1SMatthew Dillon[LiveSystem] 808ec23ca1SMatthew DillonOperating_system= DragonFly 818ec23ca1SMatthew DillonDirectory_packages= /build/synth/live_packages 828ec23ca1SMatthew DillonDirectory_repository= /build/synth/live_packages/All 838ec23ca1SMatthew DillonDirectory_portsdir= /build/synth/dports 848ec23ca1SMatthew DillonDirectory_options= /build/synth/options 858ec23ca1SMatthew DillonDirectory_distfiles= /build/synth/distfiles 868ec23ca1SMatthew DillonDirectory_buildbase= /build/synth/build 878ec23ca1SMatthew DillonDirectory_logs= /build/synth/logs 888ec23ca1SMatthew DillonDirectory_ccache= disabled 898ec23ca1SMatthew DillonDirectory_system= / 90483dbac9SMatthew DillonPackage_suffix= .txz 916a7ba689SMatthew Dillon; Meta_version= 2 (this is the default) 929cb4fab1SMatthew Dillon; Check_plist= false (this is the default) 938ec23ca1SMatthew DillonNumber_of_builders= 8 948ec23ca1SMatthew DillonMax_jobs_per_builder= 8 958ec23ca1SMatthew DillonDisplay_with_ncurses= true 968ec23ca1SMatthew Dillon.Ed 978ec23ca1SMatthew Dillon.Pp 988ec23ca1SMatthew DillonThis places all major directories under 998ec23ca1SMatthew Dillon.Pa /build/synth . 1008ec23ca1SMatthew DillonIf you want to use the same dports and the same distfiles as your base 1018ec23ca1SMatthew Dillonsystem, you can null-mount /usr/distfiles onto /build/synth/distfiles 1028ec23ca1SMatthew Dillonand /usr/dports onto /build/synth/dports with 1038ec23ca1SMatthew Dillon.Pa /etc/fstab 1048ec23ca1SMatthew Dillonentries as follows: 1058ec23ca1SMatthew Dillon.Bd -literal 1068ec23ca1SMatthew Dillon# Device Mountpoint FStype Options DumpPass# 1078ec23ca1SMatthew Dillon/usr/distfiles /build/synth/distfiles null rw 4 4 1088ec23ca1SMatthew Dillon/usr/dports /build/synth/dports null rw 4 4 1098ec23ca1SMatthew Dillon.Ed 1108ec23ca1SMatthew Dillon.Pp 1118ec23ca1SMatthew DillonPlease set the number of builders and the maximum number of jobs per 112650b8785SSascha Wildnerbuilder according to available system resources. 113650b8785SSascha WildnerRemember that the total 1148ec23ca1SMatthew Dillonload on the system can be as high as (builders x jobs), and at least 4x 115650b8785SSascha Wildnerthat value in processes. 116650b8785SSascha WildnerSystems are typically restricted by memory and CPU horsepower. 117650b8785SSascha WildnerStart conservative and ramp up according to what your system can handle. 118650b8785SSascha WildnerA good rule of thumb is to set workers to the number of CPU threads your 1198ec23ca1SMatthew Dillonmachine has or to 1/2 the number of gigabytes of memory your system has, 120650b8785SSascha Wildnerwhichever is lower. 121650b8785SSascha WildnerThen set the jobs per worker to no more than the 122650b8785SSascha Wildnernumber of CPU threads your machine has. 1238ec23ca1SMatthew Dillon.Pp 1248ec23ca1SMatthew Dillon.Nm 12517be4d43SSascha Wildnerhas numerous features to manage machine load and swap usage to 1268ec23ca1SMatthew Dillonprevent a machine from being overloaded, allowing more workers 1278ec23ca1SMatthew Dillonto be configured than you might otherwise think is reasonable 1288ec23ca1SMatthew Dillon(which helps a lot when building the smaller ports). 1298ec23ca1SMatthew DillonHowever, users running this program should be aware that very high loads 1308ec23ca1SMatthew Dillonand modest swap use are still likely to develop when building a large 1318ec23ca1SMatthew Dillonnumber of ports or when building very large ports like chromium. 1328ec23ca1SMatthew DillonIf the system is not dedicated to building packages you can reduce the 1338ec23ca1SMatthew Dillonimpact to the rest of the system by running 1348ec23ca1SMatthew Dillon.Nm 1358ec23ca1SMatthew Dillonat nice +20 and also by reducing the number of workers and number of 1368ec23ca1SMatthew Dillonjobs per worker somewhat. 1378ec23ca1SMatthew Dillon.Pp 1388ec23ca1SMatthew DillonWe recommend that a minimum of 64GB of SSD-based swap be configured, 1398ec23ca1SMatthew Dillonor twice as much swap as main memory, whichever is the higher value. 1408ec23ca1SMatthew Dillon.Pp 1418ec23ca1SMatthew DillonWe recommend a minimum of 500GB of storage be configured in 1428ec23ca1SMatthew Dillon.Pa /build 1438ec23ca1SMatthew Dillonor wherever you have configured various directories. 1448ec23ca1SMatthew DillonA full set of distfiles requires at least 120GB, a full dports including 1458ec23ca1SMatthew Dillonthe git repo requires at least 1.5GB, and a full set of built packages 146650b8785SSascha Wildnerrequires at least 75GB. 147650b8785SSascha WildnerIf using a filesystem such as HAMMER or HAMMER2 1488ec23ca1SMatthew Dillonwhich frees space overnight, double all of those numbers. 1498ec23ca1SMatthew Dillon.Pp 1508ec23ca1SMatthew DillonThe actual build infrastructure uses tmpfs... memory and swap, and does 1518ec23ca1SMatthew Dillonnot use regular filesystem space. 1528ec23ca1SMatthew Dillon.Sh OPTIONS 1538ec23ca1SMatthew Dillon.Bl -tag -width indent 154a67bf8dbSMatthew Dillon.It Fl d[d...] 155650b8785SSascha WildnerRun in debug mode. 156650b8785SSascha WildnerIf specified two or more times this will turn off 15754f2fefcSMatthew Dillonncurses and output the primary log (00_last_results.log) to the standard 15854f2fefcSMatthew Dillonoutput, along with additional spew. 1598ec23ca1SMatthew Dillon.It Fl h 1608ec23ca1SMatthew DillonQuickly output a synopsis of options and directives and exit. 1617f0eca56SMatthew Dillon.It Fl m Ar gb 1627f0eca56SMatthew DillonOverride the default package dependency memory target, in gigabytes. 163650b8785SSascha WildnerThe default is 1/2 physical memory. 164650b8785SSascha WildnerThe number of workers will be limited 1657f0eca56SMatthew Dillonsuch that the aggregate size of package dependencies installed in each 1667f0eca56SMatthew Dillonworker slot does not exceed this value. 1677f0eca56SMatthew Dillon.Pp 1687f0eca56SMatthew DillonThis handles a well-known effect where the sheer amount of data that has 1697f0eca56SMatthew Dillonto be installed in tmpfs filesystems for large ports, when multiplied by 1707f0eca56SMatthew Dillonthe number of worker slots, can force excessive paging to occur and leave 171650b8785SSascha Wildnerpreciously little memory available to actually run compiles. 172650b8785SSascha WildnerSome paging 173650b8785SSascha Wildneris necessary to maintain maximum CPU utilization, but excessive paging 1747f0eca56SMatthew Dilloncan cause the whole machine to essentially become idle for extended 1757f0eca56SMatthew Dillonperiods of time. 1764ad2f7b8SMatthew Dillon.It Fl M Ar scale 1774ad2f7b8SMatthew DillonOverride dynamic workers calculation by a specific scale factor. 1784ad2f7b8SMatthew DillonSpecifying 1.0 leaves it unchanged, 0.8 will reduce the number of jobs by 1794ad2f7b8SMatthew Dillon20%, and 1.2 will increase the number of jobs by 20%. And so forth. 1804ad2f7b8SMatthew Dillon.Pp 1814ad2f7b8SMatthew DillonThis option may be specified in the range 0.01 to 99.0. Out of range values 1824ad2f7b8SMatthew Dillonwill simply be clipped. 1832c9f4f91SMatthew Dillon.It Fl p Ar profile 1842c9f4f91SMatthew DillonOverride the global profile default in 1852c9f4f91SMatthew Dillon.Pa /etc/dsynth/dsynth.ini , 1862c9f4f91SMatthew Dillonallowing you to trivially run whatever profile you like without having to 1872c9f4f91SMatthew Dillonedit the configuration file when switching. 1882c9f4f91SMatthew DillonIn addition, you can now run any number of dsynth's concurrently on the same 1892c9f4f91SMatthew Dillonmachine without having to use a jail, each with a different profile, 1902c9f4f91SMatthew Dillonas long as the packages, repository, buildbase, and logs directories 1912c9f4f91SMatthew Dillonare different. 1922c9f4f91SMatthew Dillon.Pp 1932c9f4f91SMatthew DillonNote that the distfiles directory can be shared and will not conflict 1942c9f4f91SMatthew Dillonor get confused with concurrent fetches. 1958ec23ca1SMatthew Dillon.It Fl s Ar n 1968ec23ca1SMatthew Dillon.Nm 1978ec23ca1SMatthew Dillonusually slow-starts the worker slots, beginning with one slot and increasing 1988ec23ca1SMatthew Dillonby one every 5 seconds until the maximum configured number of workers is 1998ec23ca1SMatthew Dillonreached. 2008ec23ca1SMatthew DillonThis gives 2018ec23ca1SMatthew Dillon.Nm 2028ec23ca1SMatthew Dillona slower ramp that it can load manage against. 2038ec23ca1SMatthew DillonSpecifying 0 disables the slow-start feature and the maximum number of 2048ec23ca1SMatthew Dillonworker slots (limited by the dependency graph) will be loaded immediately. 205c6142119SAntonio Huete Jimenez.It Fl v 206c6142119SAntonio Huete JimenezQuickly output the version and exit. 207c6142119SAntonio Huete Jimenez.It Fl x 208c6142119SAntonio Huete Jimenez.It Fl xx 209c6142119SAntonio Huete JimenezNormally dsynth builds a package for any of three reasons: (1) If the contents 210c6142119SAntonio Huete Jimenezof the ports directory changes, (2) If anything the port depends on requires 211c6142119SAntonio Huete Jimenezrebuilding so to will the port be rebuilt, (3) If there is no binary package 212c6142119SAntonio Huete Jimenezalready built for the port. 213c6142119SAntonio Huete Jimenez.Pp 214c6142119SAntonio Huete JimenezIf this option is specified, the first test is ignored. 215c6142119SAntonio Huete JimenezIf this option is specified twice, the first and second tests are ignored. 216c6142119SAntonio Huete Jimenez.It Fl y 217c6142119SAntonio Huete JimenezAutomatically answer 'y'es to any questions. 218a67bf8dbSMatthew Dillon.It Fl D 219a67bf8dbSMatthew DillonTurn on DEVELOPER mode when building ports. 220c6142119SAntonio Huete Jimenez.It Fl P 221c6142119SAntonio Huete JimenezInclude the check-plist stage. 222c6142119SAntonio Huete JimenezThis is the default for the 223c6142119SAntonio Huete Jimenez.Cm everything 2249cb4fab1SMatthew Dillonand 2259cb4fab1SMatthew Dillon.Cm test 2269cb4fab1SMatthew Dillondirectives. 2279cb4fab1SMatthew DillonThis feature may also be turned on via the 2289cb4fab1SMatthew Dillon.Va Check_plist 2299cb4fab1SMatthew Dillonoption in the configuration file. 230a67bf8dbSMatthew Dillon.It Fl S[S] 231650b8785SSascha WildnerTurn off curses for script friendliness. 232650b8785SSascha WildnerThe output will be log 00 and 23354f2fefcSMatthew Dillonshould be redirected to /dev/null or something similar. 234a67bf8dbSMatthew DillonIf you supply the options twice, color output escapes will also be 235a67bf8dbSMatthew Dillonturned off. 23654f2fefcSMatthew DillonYou may also wish to use the 23754f2fefcSMatthew Dillon.Fl y 23854f2fefcSMatthew Dillonoption for scripting dsynth. 2396d1478d9SMatthew Dillon.It Fl N 2406d1478d9SMatthew DillonNormally 2416d1478d9SMatthew Dillon.Nm 2426d1478d9SMatthew Dillonnices its sub-processes to +10. 2436d1478d9SMatthew DillonThis option disables the feature. 2448ec23ca1SMatthew Dillon.El 2458ec23ca1SMatthew Dillon.Sh DIRECTIVES 2468ec23ca1SMatthew DillonGenerally 2478ec23ca1SMatthew Dillon.Nm 2488ec23ca1SMatthew Dillonis run with a directive and some directives allow a list of ports to be 249650b8785SSascha Wildnerspecified. 250650b8785SSascha WildnerThis list should be space-delimited in DIR/SUBDIR format, for example: 2518ec23ca1SMatthew Dillon.Ar www/chromium . 2528ec23ca1SMatthew DillonFor directives with an optional ports list, your current installed set 2531644605eSMatthew Dillonof ports will be used if you do not specify a list. You may also 2541644605eSMatthew Dillonspecify a filename instead of a port to have dsynth read the ports list 2551644605eSMatthew Dillonfrom a text file. Ports are specified by dports directory and subdirectory. 2561644605eSMatthew DillonFor example "www/chromium". 2578ec23ca1SMatthew Dillon.Bl -tag -width indent 2588ec23ca1SMatthew Dillon.It Cm init 2598ec23ca1SMatthew DillonCreates and initializes the 2608ec23ca1SMatthew Dillon.Pa /etc/dsynth 261ec888f6dSSascha Wildnerdirectory if it does not exist. 2628ec23ca1SMatthew DillonThis directive will complain and exit if either 2638ec23ca1SMatthew Dillon.Pa /etc/dsynth 2648ec23ca1SMatthew Dillonor 2658ec23ca1SMatthew Dillon.Pa /usr/local/etc/dsynth 266650b8785SSascha Wildnerexists. 267650b8785SSascha WildnerIt will not create 2688ec23ca1SMatthew Dillon.Pa /etc/dsynth 2698ec23ca1SMatthew Dillonin this situation. 270c6142119SAntonio Huete Jimenez.It Cm status 271c6142119SAntonio Huete JimenezThis will do a dry-run of 272c6142119SAntonio Huete Jimenez.Cm upgrade-system 273c6142119SAntonio Huete Jimenezbut not actually build anything. 274c6142119SAntonio Huete Jimenez.It Cm cleanup 275c6142119SAntonio Huete JimenezThis will clean up any left-over mounts from prior builds. 276c6142119SAntonio Huete Jimenez.Nm 277c6142119SAntonio Huete Jimenezattempts to clean up all processes and mounts when you interrupt 278c6142119SAntonio Huete Jimeneza build but doesn't always succeed. 2798ec23ca1SMatthew Dillon.It Cm configure 2808ec23ca1SMatthew DillonNOT CURRENTLY IMPLEMENTED 281325ef124SMatthew Dillon.It Cm fetch-only Op Ar ports/everything 282325ef124SMatthew DillonFetch all source distributions required to build 283325ef124SMatthew Dillonthe specified target. Specifying 'everything' fetches 284325ef124SMatthew Dillonall source distributions required to build the whole 285325ef124SMatthew Dillonof dports. 286325ef124SMatthew Dillon.Pp 287325ef124SMatthew DillonAny existing distfiles which do not match the expected 288325ef124SMatthew Dillonsignature will be re-fetched. 2898ec23ca1SMatthew Dillon.It Cm upgrade-system 290650b8785SSascha WildnerNOT CURRENTLY IMPLEMENTED. 291650b8785SSascha WildnerIncrementally build and upgrade your locally 2928ec23ca1SMatthew Dilloninstalled packages, then upgrade your local system with them. 2931644605eSMatthew Dillon.It Cm list-system 2941644605eSMatthew DillonWrite a build list to the file "build.txt". Do not build anything. 2951644605eSMatthew DillonThis is typically used on your target system to generate a list for 2961644605eSMatthew Dillondsynth to use as a build list on another system. 2978ec23ca1SMatthew Dillon.It Cm prepare-system 2988ec23ca1SMatthew DillonIncrementally build and upgrade your locally installed packages, but 2998ec23ca1SMatthew Dillondo not upgrade your system with them. 3008ec23ca1SMatthew Dillon.It Cm rebuild-repository 3018ec23ca1SMatthew DillonBuild or rebuild the database files for the configured repository. 3028ec23ca1SMatthew Dillon.It Cm purge-distfiles 3038ec23ca1SMatthew DillonDelete any obsolete source distribution files. 304b6bd007bSMatthew Dillon.It Cm reset-db 305c6142119SAntonio Huete JimenezDelete ports_crc.db from the build directory. 306c6142119SAntonio Huete JimenezThis database is used to detect changes made to the dports tree. 307c6142119SAntonio Huete JimenezIt will be regenerated on your next build without forcing any packages to be rebuilt. 3088ec23ca1SMatthew Dillon.It Cm status-everything 3098ec23ca1SMatthew DillonThis will do a dry-run of a full bulk build of everything, 3108ec23ca1SMatthew Dillonbut not actually build anything. 3118ec23ca1SMatthew Dillon.It Cm everything 3128ec23ca1SMatthew DillonThis will build the entire dports tree and then rebuild the repository 3138ec23ca1SMatthew Dillonwhen it finishes. 3148ec23ca1SMatthew Dillon.It Cm version 315650b8785SSascha WildnerThis is for synth compatibility. 316650b8785SSascha WildnerThe version of 3178ec23ca1SMatthew Dillon.Nm 3188ec23ca1SMatthew Dillonwill be printed and the program will exit. 3198ec23ca1SMatthew Dillon.It Cm help 3208ec23ca1SMatthew DillonOutput a synopsis of options and directives and exit. 3218ec23ca1SMatthew Dillon.It Cm status Op Ar ports 3228ec23ca1SMatthew DillonDo a dry-run with 'build' of the given list. 323c819d181SMatthew Dillon.It Cm add Op Ar ports 324c819d181SMatthew DillonThis directive may be used when the user wishes to add additional 325c819d181SMatthew Dillonports to an existing dsynth run without interrupting and restarting 326c819d181SMatthew Dillonthe dsynth. 327c819d181SMatthew DillonIt can be useful when the user intends to leave dsynth unattended for 328c819d181SMatthew Dillona long period of time and does not wish to interrupt potentially very 329c819d181SMatthew Dillonlong builds that are already in progress. 330c819d181SMatthew Dillon.Pp 331c819d181SMatthew DillonWhen dsynth completes the current run it will re-exec itself with 332c819d181SMatthew Dillonthe same primary directive along with all ports specified by any 333c819d181SMatthew Dillon.Cm add 334c819d181SMatthew Dillondirectives made in the interim. 335c819d181SMatthew Dillon.Nm 336c819d181SMatthew Dillonwill still rebuild the repository after the initial run if it would 337c819d181SMatthew Dillonnormally have done so, but if so it will do it without asking first. 338c819d181SMatthew DillonOnly the last rebuild request will potentially be interactive. 339c819d181SMatthew Dillon.Pp 340c819d181SMatthew DillonNote that interrupting or killing the running dsynth cleans out any 341c819d181SMatthew Dillonports that might have been added while it was running. This directive 342c819d181SMatthew Dillonalso has numerous exit/exec lock-file races and is intended to only be used 343c819d181SMatthew Dillonmanually by the user. 3448ec23ca1SMatthew Dillon.It Cm build Op Ar ports 345650b8785SSascha WildnerIncrementally build dports based on the given list. 346650b8785SSascha WildnerWhen done, ask whether the repository should be rebuilt or not. 3478ec23ca1SMatthew Dillon.It Cm just-build Op Ar ports 3488ec23ca1SMatthew DillonIncrementally build dports based on the given list, then 349650b8785SSascha Wildnerexits. 350650b8785SSascha WildnerNo post-build steps will be taken. 3518ec23ca1SMatthew Dillon.It Cm install Op Ar ports 3528ec23ca1SMatthew DillonNOT CURRENTLY IMPLEMENTED. 'build' based on the supplied 3538ec23ca1SMatthew Dillonlist (or using currently installed packages), then rebuild 35417be4d43SSascha Wildnerthe repository and upgrade the system without asking any further 3558ec23ca1SMatthew Dillonquestions. 3568ec23ca1SMatthew Dillon.It Cm force Op Ar ports 357650b8785SSascha WildnerThis is the same as 'build' but will delete existing packages first. 358650b8785SSascha WildnerDependencies are not deleted unless they are out of date. 3598ec23ca1SMatthew Dillon.It Cm test Op Ar ports 3608ec23ca1SMatthew DillonThis is the same as 'build' but sets the environment variable 361650b8785SSascha Wildner.Ev DEVELOPER 362650b8785SSascha Wildnerto 363650b8785SSascha Wildner.Sq yes 364650b8785SSascha Wildnerand pre-deletes specified packages. 365650b8785SSascha WildnerDependencies are not deleted unless they are out of date. 366bc7e28d2SMatthew Dillon.It Cm debug Op Ar ports 367bc7e28d2SMatthew DillonThis is the same as 'build' but leaves the chroot mounts intact 368bc7e28d2SMatthew Dillonupon completion. 369c6142119SAntonio Huete Jimenez.It Cm monitor Op Ar datfile 370c6142119SAntonio Huete JimenezMonitors a running dsynth instance. 3718ec23ca1SMatthew Dillon.El 372*4a7eab7cSMatthew Dillon.Sh PER-PORT OPTIONS 373*4a7eab7cSMatthew DillonThe 374*4a7eab7cSMatthew Dillon.Va Directory_options 375*4a7eab7cSMatthew Dillonconfiguration variable in 376*4a7eab7cSMatthew Dillon.Pa /etc/dsynth/dsynth.ini 377*4a7eab7cSMatthew Dillonpoints to the configured options directory tree. 378*4a7eab7cSMatthew DillonIn the base system dports this would be 379*4a7eab7cSMatthew Dillon.Pa /var/db/ports , 380*4a7eab7cSMatthew Dillonbut you can supply an independent set of ports options for your dsynth 381*4a7eab7cSMatthew Dillonbuild if you like. 382*4a7eab7cSMatthew DillonThe format of the structure in this directory is best described simply by 383*4a7eab7cSMatthew DillonCD'ing into a dport, say www/chromium, typing 'make config', and it will 384*4a7eab7cSMatthew Dilloncreate a sub-directory and write out a file called 385*4a7eab7cSMatthew Dillon.Pa /var/db/ports/www_chromium/options . 386*4a7eab7cSMatthew Dillon.Pp 387*4a7eab7cSMatthew DillonFor 388*4a7eab7cSMatthew Dillon.Nm 389*4a7eab7cSMatthew Dillonyou can either point your configuration variable to the system default, 390*4a7eab7cSMatthew Dillonor you can point it at a dsynth-specific directory and copy the options 391*4a7eab7cSMatthew Dillonto or construct the options in your dsynth-specific directory tree. 392c1bd0b08SAntonio Huete Jimenez.Sh HOOKS 393c1bd0b08SAntonio Huete Jimenez.Nm 394c1bd0b08SAntonio Huete Jimenezprovides several hooks that trigger at specific stages during the 395c1bd0b08SAntonio Huete Jimenezpackage building process. 396c1bd0b08SAntonio Huete Jimenez.Pp 397c1bd0b08SAntonio Huete JimenezAt the moment hooks are not configurable so the exact executable file is 398c1bd0b08SAntonio Huete Jimenezexpected in the configuration directory with one of the names in the 3992f0280fdSSascha Wildnerlist below. 400c1bd0b08SAntonio Huete JimenezHooks are run via 401c1bd0b08SAntonio Huete Jimenez.Xr execve 2 . 402c1bd0b08SAntonio Huete Jimenez.Bl -tag -width indent 40367f1c6e8SSascha Wildner.It Pa hook_run_start 404c1bd0b08SAntonio Huete JimenezThis hook triggers when the overall build process starts. 40567f1c6e8SSascha Wildner.It Pa hook_run_end 406c1bd0b08SAntonio Huete JimenezThis hook is called when the overall build process ends. 40767f1c6e8SSascha Wildner.It Pa hook_pkg_success 408c1bd0b08SAntonio Huete JimenezFor each successful port built this hook will trigger. 40967f1c6e8SSascha Wildner.It Pa hook_pkg_failure 410c1bd0b08SAntonio Huete JimenezThis hook will trigger for each port that fails to build. 41167f1c6e8SSascha Wildner.It Pa hook_pkg_ignored 412c1bd0b08SAntonio Huete JimenezEach port that is marked as ignored will make this hook to trigger. 41367f1c6e8SSascha Wildner.It Pa hook_pkg_skipped 414c1bd0b08SAntonio Huete JimenezEach skipped port will trigger this hook. 415c1bd0b08SAntonio Huete Jimenez.El 416c1bd0b08SAntonio Huete Jimenez.Pp 417c1bd0b08SAntonio Huete JimenezA number of environment variables are available for hooks, always in the context 418c1bd0b08SAntonio Huete Jimenezof an ongoing build and within a specific configuration profile, unless 419c1bd0b08SAntonio Huete Jimenezoverridden from the command-line. 420c1bd0b08SAntonio Huete JimenezSome are only available for a specific hook. 421c1bd0b08SAntonio Huete Jimenez.Bl -tag -width DIR_REPOSITORY 422c1bd0b08SAntonio Huete Jimenez.It Ev PROFILE 423c1bd0b08SAntonio Huete JimenezThe configuration profile. 424c1bd0b08SAntonio Huete Jimenez.It Ev DIR_PACKAGES 425c1bd0b08SAntonio Huete JimenezThe packages base directory, i.e where index files are generated. 426c1bd0b08SAntonio Huete Jimenez.It Ev DIR_REPOSITORY 427c1bd0b08SAntonio Huete JimenezThe packages repository, where the actual package files are stored. 428c1bd0b08SAntonio Huete Jimenez.It Ev DIR_PORTS 429c1bd0b08SAntonio Huete JimenezThe ports directory. 430c1bd0b08SAntonio Huete Jimenez.It Ev DIR_OPTIONS 431c1bd0b08SAntonio Huete JimenezThe options directory. 432c1bd0b08SAntonio Huete Jimenez.It Ev DIR_DISTFILES 433c1bd0b08SAntonio Huete JimenezThe distfiles directory, where the distribution files are stored. 434c1bd0b08SAntonio Huete Jimenez.It Ev DIR_LOGS 435c1bd0b08SAntonio Huete JimenezThe logs directory, which is also where the html Report is generated. 436c1bd0b08SAntonio Huete Jimenez.It Ev DIR_BUILDBASE 437c1bd0b08SAntonio Huete JimenezThe build base directory. 438c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_QUEUED 43967f1c6e8SSascha WildnerThe number of ports queued to be built (only for 44067f1c6e8SSascha Wildner.Pa hook_run_start ) . 441c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_BUILT 44267f1c6e8SSascha WildnerThe number of successfully built ports (only for 44367f1c6e8SSascha Wildner.Pa hook_run_end ) . 444c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_FAILED 44567f1c6e8SSascha WildnerThe number of ports for which the build failed (only for 44667f1c6e8SSascha Wildner.Pa hook_run_end ) . 447c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_IGNORED 448c1bd0b08SAntonio Huete JimenezThe number of ports that where ignored and, hence, not built 44967f1c6e8SSascha Wildner(only for 45067f1c6e8SSascha Wildner.Pa hook_run_end ) . 451c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_SKIPPED 45267f1c6e8SSascha WildnerThe number of ports that were skipped in the build (only for 45367f1c6e8SSascha Wildner.Pa hook_run_end ) . 454c1bd0b08SAntonio Huete Jimenez.It Ev RESULT 455c1bd0b08SAntonio Huete JimenezThe result (success, failure, ignored, skipped) for the build of an individual 45667f1c6e8SSascha Wildnerport (only for 45767f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 458c1bd0b08SAntonio Huete Jimenez.It Ev ORIGIN 45967f1c6e8SSascha WildnerThe origin of a port (only for 46067f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 461c1bd0b08SAntonio Huete Jimenez.It Ev FLAVOR 46267f1c6e8SSascha WildnerThe flavor of a port (only for 46367f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 464c1bd0b08SAntonio Huete Jimenez.It Ev PKGNAME 46567f1c6e8SSascha WildnerThe port name (only for 46667f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 467c1bd0b08SAntonio Huete Jimenez.El 4689cb4fab1SMatthew Dillon.Sh MISC 4699cb4fab1SMatthew Dillon.Pp 4709cb4fab1SMatthew DillonThe default setting for 4719cb4fab1SMatthew Dillon.Va Meta_version 4729cb4fab1SMatthew Dillonis now 2. You can override it with this configuration variable. 4739cb4fab1SMatthew Dillon.Pp 4749cb4fab1SMatthew DillonThe default setting for 4759cb4fab1SMatthew Dillon.Va Check_plist 4769cb4fab1SMatthew Dillonis false. You can override it with the 4779cb4fab1SMatthew Dillon.Fl P 4789cb4fab1SMatthew Dillonoption or by setting this configuration variable to true. 4798ec23ca1SMatthew Dillon.Sh FILES 4808ec23ca1SMatthew Dillon.Bl -tag -width ".It Pa <fs>/abc/defghi/<name>" -compact 4812c9f4f91SMatthew Dillon.It Pa /etc/dsynth/dsynth.ini 482650b8785SSascha WildnerThe primary configuration file. 483650b8785SSascha WildnerIf not found, 4848ec23ca1SMatthew Dillon.Nm 4858ec23ca1SMatthew Dillonwill also look in 4862c9f4f91SMatthew Dillon.Pa /usr/local/etc/dsynth/dsynth.ini . 4878ec23ca1SMatthew Dillon.Pp 4888ec23ca1SMatthew Dillon.It Pa /etc/dsynth/LiveSystem-make.conf 4898ec23ca1SMatthew DillonTypically contains the environment variables that will be set in 4908ec23ca1SMatthew Dillonthe workers. 4918ec23ca1SMatthew Dillon.Nm 4928ec23ca1SMatthew Dillonfirewalls the environment it is run under from the environment it 4938ec23ca1SMatthew Dillonprovides to the workers. 4948ec23ca1SMatthew Dillon.Pp 4958ec23ca1SMatthew Dillon.It Pa /build/synth/build 4968ec23ca1SMatthew DillonRecommended setting for 497650b8785SSascha Wildner.Va Directory_buildbase , 4988ec23ca1SMatthew Dilloncontains the build infrastructure... typically a template, mirrored 4998ec23ca1SMatthew Dillonsystem directories, and mount points for all the worker slots. 5008ec23ca1SMatthew DillonThe template will be [re]generated if 'pkg' needs to be built or 5018ec23ca1SMatthew Dillonif the 5028ec23ca1SMatthew Dillon.Pa .template.good 5038ec23ca1SMatthew Dillonfile in this directory is deleted. 5048ec23ca1SMatthew Dillon.Pp 5058ec23ca1SMatthew Dillon.It Pa /build/synth/distfiles 5068ec23ca1SMatthew DillonRecommended setting for 507650b8785SSascha Wildner.Va Directory_distfiles , 5088ec23ca1SMatthew Dillonports to a directory into which 5098ec23ca1SMatthew Dillon.Nm 5108ec23ca1SMatthew Dillonwill download any source distribution files required for building. 5118ec23ca1SMatthew Dillon.Pp 5128ec23ca1SMatthew Dillon.It Pa /build/synth/dports 5138ec23ca1SMatthew DillonRecommended setting for 514650b8785SSascha Wildner.Va Directory_portsdir , 5158ec23ca1SMatthew Dillonpoints to a checked out dports repo. 5168ec23ca1SMatthew DillonNote that 5178ec23ca1SMatthew Dillon.Nm 5188ec23ca1SMatthew Dillondoes not automatically 'git pull' or otherwise synchronize the dports repo, 5198ec23ca1SMatthew Dillonyou must do that yourself prior to starting a build. 5208ec23ca1SMatthew Dillon.Pp 5218ec23ca1SMatthew Dillon.It Pa /build/synth/live_packages 5228ec23ca1SMatthew DillonRecommended setting for 523650b8785SSascha Wildner.Va Directory_packages , 5248ec23ca1SMatthew Dillonpoints to a directory which will contain the completed application 5258ec23ca1SMatthew Dillonpackages. 5268ec23ca1SMatthew Dillon.Pp 5278ec23ca1SMatthew Dillon.It Pa /build/synth/logs 5288ec23ca1SMatthew DillonRecommended setting for 529650b8785SSascha Wildner.Va Directory_logs , 5308ec23ca1SMatthew Dillonall log files will be placed in this directory. 5318ec23ca1SMatthew DillonSpecial management logfiles begin with the numeral '0' for easily 5328ec23ca1SMatthew Dillonlocation. 5338ec23ca1SMatthew DillonThe logfiles for ports while and after building are stored in the 5348ec23ca1SMatthew Dillonform subdir____portname.log, with three underscores. 5358ec23ca1SMatthew Dillon.Pp 5368ec23ca1SMatthew Dillon.It Pa /build/synth/options 5378ec23ca1SMatthew DillonRecommended setting for 538650b8785SSascha Wildner.Va Directory_options , 5398ec23ca1SMatthew Dillonwhere options overrides for specific ports may be located. 540*4a7eab7cSMatthew DillonThen either null-mount the system /var/db/ports to this location, or 541*4a7eab7cSMatthew Dillonconstruct your own dsynth-specific options. 542*4a7eab7cSMatthew DillonSee the PER-PORT OPTIONS section above for more information. 5438ec23ca1SMatthew Dillon.Pp 5448ec23ca1SMatthew Dillon.It Pa / 5458ec23ca1SMatthew DillonRecommended setting for 546650b8785SSascha Wildner.Va Directory_system , 5478ec23ca1SMatthew Dillonwhich 5488ec23ca1SMatthew Dillon.Nm 5498ec23ca1SMatthew Dillonuses as a basis for creating the jails or chroots in each worker slot 5508ec23ca1SMatthew Dillonduring building. 5518ec23ca1SMatthew DillonNo part of the system root is ever NULL-mounted read-write... it is always 5528ec23ca1SMatthew DillonNULL-mounted read-only. 5538ec23ca1SMatthew DillonSome elements from the system base will be mirrored in the build-base 5548ec23ca1SMatthew Dillonas an optimization. 5558ec23ca1SMatthew Dillon.Pp 5568ec23ca1SMatthew DillonNote that the packages directory and the distfiles directory is mounted 557650b8785SSascha Wildnerread-write in jails or chroots. 558650b8785SSascha WildnerAll other r/w filesystems in the workers are 5598ec23ca1SMatthew Dillon.Xr tmpfs 5 5608ec23ca1SMatthew Dillonbased filesystems and will be created and torn-down for each port. 561483dbac9SMatthew Dillon.Pp 562483dbac9SMatthew Dillon.It Pa .txz 563483dbac9SMatthew Dillon.It Pa .tgz 564483dbac9SMatthew Dillon.It Pa .tar 565483dbac9SMatthew Dillon.It Pa .tbz 566ef0c0bf5SKrzysztof Piecuch.It Pa .tzst 567483dbac9SMatthew DillonThe recommended setting for 568483dbac9SMatthew Dillon.Va Package_suffix 569483dbac9SMatthew Dillonis either 570483dbac9SMatthew Dillon.Pa .txz 571483dbac9SMatthew Dillonor 572483dbac9SMatthew Dillon.Pa .tgz . 573483dbac9SMatthew DillonUse 574483dbac9SMatthew Dillon.Pa .txz 575483dbac9SMatthew Dillonfor better compression at the cost of somewhat slower bulk builds due 576483dbac9SMatthew Dillonto the time overhead for compression and decompression, or 577483dbac9SMatthew Dillonuse 578483dbac9SMatthew Dillon.Pa .tgz 579483dbac9SMatthew Dillonfor modest compression and very fast compression and decompression. 580483dbac9SMatthew DillonDue to the way the builder works, package dependencies are fresly 581483dbac9SMatthew Dilloninstalled into the chroot slot for each package being built, so 582483dbac9SMatthew Dillondecompression time matters. 5836a7ba689SMatthew Dillon.Pp 5848ec23ca1SMatthew Dillon.El 5858ec23ca1SMatthew Dillon.Sh EXIT STATUS 5868ec23ca1SMatthew Dillon.Ex -std 5878ec23ca1SMatthew Dillon.Sh SEE ALSO 58817be4d43SSascha Wildner.Xr synth 1 , 5898ec23ca1SMatthew Dillon.Xr dports 7 5908ec23ca1SMatthew Dillon.Sh HISTORY 5918ec23ca1SMatthew DillonThe 5928ec23ca1SMatthew Dillon.Nm 5938ec23ca1SMatthew Dillonutility first appeared in 5948ec23ca1SMatthew Dillon.Dx 5.7 . 5958ec23ca1SMatthew Dillon.Sh AUTHORS 5968ec23ca1SMatthew Dillon.An Matthew Dillon Aq Mt dillon@backplane.com 597