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 43*2c5f241eSMatthew Dillon.Op Fl dfhvxyDNPS 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) 933bd7e0a7SMatthew Dillon; Numa_setsize= 0 (this is the default. 0, 2, or 4) 948ec23ca1SMatthew DillonNumber_of_builders= 8 958ec23ca1SMatthew DillonMax_jobs_per_builder= 8 968ec23ca1SMatthew DillonDisplay_with_ncurses= true 978ec23ca1SMatthew Dillon.Ed 988ec23ca1SMatthew Dillon.Pp 998ec23ca1SMatthew DillonThis places all major directories under 1008ec23ca1SMatthew Dillon.Pa /build/synth . 1018ec23ca1SMatthew DillonIf you want to use the same dports and the same distfiles as your base 1028ec23ca1SMatthew Dillonsystem, you can null-mount /usr/distfiles onto /build/synth/distfiles 1038ec23ca1SMatthew Dillonand /usr/dports onto /build/synth/dports with 1048ec23ca1SMatthew Dillon.Pa /etc/fstab 1058ec23ca1SMatthew Dillonentries as follows: 1068ec23ca1SMatthew Dillon.Bd -literal 1078ec23ca1SMatthew Dillon# Device Mountpoint FStype Options DumpPass# 1088ec23ca1SMatthew Dillon/usr/distfiles /build/synth/distfiles null rw 4 4 1098ec23ca1SMatthew Dillon/usr/dports /build/synth/dports null rw 4 4 1108ec23ca1SMatthew Dillon.Ed 1118ec23ca1SMatthew Dillon.Pp 1128ec23ca1SMatthew DillonPlease set the number of builders and the maximum number of jobs per 113650b8785SSascha Wildnerbuilder according to available system resources. 114650b8785SSascha WildnerRemember that the total 1158ec23ca1SMatthew Dillonload on the system can be as high as (builders x jobs), and at least 4x 116650b8785SSascha Wildnerthat value in processes. 117650b8785SSascha WildnerSystems are typically restricted by memory and CPU horsepower. 118650b8785SSascha WildnerStart conservative and ramp up according to what your system can handle. 119650b8785SSascha WildnerA good rule of thumb is to set workers to the number of CPU threads your 1208ec23ca1SMatthew Dillonmachine has or to 1/2 the number of gigabytes of memory your system has, 121650b8785SSascha Wildnerwhichever is lower. 122650b8785SSascha WildnerThen set the jobs per worker to no more than the 123650b8785SSascha Wildnernumber of CPU threads your machine has. 1248ec23ca1SMatthew Dillon.Pp 1258ec23ca1SMatthew Dillon.Nm 12617be4d43SSascha Wildnerhas numerous features to manage machine load and swap usage to 1278ec23ca1SMatthew Dillonprevent a machine from being overloaded, allowing more workers 1288ec23ca1SMatthew Dillonto be configured than you might otherwise think is reasonable 1298ec23ca1SMatthew Dillon(which helps a lot when building the smaller ports). 1308ec23ca1SMatthew DillonHowever, users running this program should be aware that very high loads 1318ec23ca1SMatthew Dillonand modest swap use are still likely to develop when building a large 1328ec23ca1SMatthew Dillonnumber of ports or when building very large ports like chromium. 1338ec23ca1SMatthew DillonIf the system is not dedicated to building packages you can reduce the 1348ec23ca1SMatthew Dillonimpact to the rest of the system by running 1358ec23ca1SMatthew Dillon.Nm 1368ec23ca1SMatthew Dillonat nice +20 and also by reducing the number of workers and number of 1378ec23ca1SMatthew Dillonjobs per worker somewhat. 1388ec23ca1SMatthew Dillon.Pp 1398ec23ca1SMatthew DillonWe recommend that a minimum of 64GB of SSD-based swap be configured, 1408ec23ca1SMatthew Dillonor twice as much swap as main memory, whichever is the higher value. 1418ec23ca1SMatthew Dillon.Pp 1428ec23ca1SMatthew DillonWe recommend a minimum of 500GB of storage be configured in 1438ec23ca1SMatthew Dillon.Pa /build 1448ec23ca1SMatthew Dillonor wherever you have configured various directories. 1458ec23ca1SMatthew DillonA full set of distfiles requires at least 120GB, a full dports including 1468ec23ca1SMatthew Dillonthe git repo requires at least 1.5GB, and a full set of built packages 147650b8785SSascha Wildnerrequires at least 75GB. 148650b8785SSascha WildnerIf using a filesystem such as HAMMER or HAMMER2 1498ec23ca1SMatthew Dillonwhich frees space overnight, double all of those numbers. 1508ec23ca1SMatthew Dillon.Pp 1518ec23ca1SMatthew DillonThe actual build infrastructure uses tmpfs... memory and swap, and does 1528ec23ca1SMatthew Dillonnot use regular filesystem space. 1538ec23ca1SMatthew Dillon.Sh OPTIONS 1548ec23ca1SMatthew Dillon.Bl -tag -width indent 155a67bf8dbSMatthew Dillon.It Fl d[d...] 156650b8785SSascha WildnerRun in debug mode. 157650b8785SSascha WildnerIf specified two or more times this will turn off 15854f2fefcSMatthew Dillonncurses and output the primary log (00_last_results.log) to the standard 15954f2fefcSMatthew Dillonoutput, along with additional spew. 160*2c5f241eSMatthew Dillon.It Fl f 161*2c5f241eSMatthew DillonForce dangerous directives to run despite pkglist scan errors. Applies only 162*2c5f241eSMatthew Dillonto purge-distfiles at the moment. 1638ec23ca1SMatthew Dillon.It Fl h 1648ec23ca1SMatthew DillonQuickly output a synopsis of options and directives and exit. 1657f0eca56SMatthew Dillon.It Fl m Ar gb 1667f0eca56SMatthew DillonOverride the default package dependency memory target, in gigabytes. 167650b8785SSascha WildnerThe default is 1/2 physical memory. 168650b8785SSascha WildnerThe number of workers will be limited 1697f0eca56SMatthew Dillonsuch that the aggregate size of package dependencies installed in each 1707f0eca56SMatthew Dillonworker slot does not exceed this value. 1717f0eca56SMatthew Dillon.Pp 1727f0eca56SMatthew DillonThis handles a well-known effect where the sheer amount of data that has 1737f0eca56SMatthew Dillonto be installed in tmpfs filesystems for large ports, when multiplied by 1747f0eca56SMatthew Dillonthe number of worker slots, can force excessive paging to occur and leave 175650b8785SSascha Wildnerpreciously little memory available to actually run compiles. 176650b8785SSascha WildnerSome paging 177650b8785SSascha Wildneris necessary to maintain maximum CPU utilization, but excessive paging 1787f0eca56SMatthew Dilloncan cause the whole machine to essentially become idle for extended 1797f0eca56SMatthew Dillonperiods of time. 1804ad2f7b8SMatthew Dillon.It Fl M Ar scale 1814ad2f7b8SMatthew DillonOverride dynamic workers calculation by a specific scale factor. 1824ad2f7b8SMatthew DillonSpecifying 1.0 leaves it unchanged, 0.8 will reduce the number of jobs by 1834ad2f7b8SMatthew Dillon20%, and 1.2 will increase the number of jobs by 20%. And so forth. 1844ad2f7b8SMatthew Dillon.Pp 1854ad2f7b8SMatthew DillonThis option may be specified in the range 0.01 to 99.0. Out of range values 1864ad2f7b8SMatthew Dillonwill simply be clipped. 1872c9f4f91SMatthew Dillon.It Fl p Ar profile 1882c9f4f91SMatthew DillonOverride the global profile default in 1892c9f4f91SMatthew Dillon.Pa /etc/dsynth/dsynth.ini , 1902c9f4f91SMatthew Dillonallowing you to trivially run whatever profile you like without having to 1912c9f4f91SMatthew Dillonedit the configuration file when switching. 1922c9f4f91SMatthew DillonIn addition, you can now run any number of dsynth's concurrently on the same 1932c9f4f91SMatthew Dillonmachine without having to use a jail, each with a different profile, 1942c9f4f91SMatthew Dillonas long as the packages, repository, buildbase, and logs directories 1952c9f4f91SMatthew Dillonare different. 1962c9f4f91SMatthew Dillon.Pp 1972c9f4f91SMatthew DillonNote that the distfiles directory can be shared and will not conflict 1982c9f4f91SMatthew Dillonor get confused with concurrent fetches. 1998ec23ca1SMatthew Dillon.It Fl s Ar n 2008ec23ca1SMatthew Dillon.Nm 2018ec23ca1SMatthew Dillonusually slow-starts the worker slots, beginning with one slot and increasing 2028ec23ca1SMatthew Dillonby one every 5 seconds until the maximum configured number of workers is 2038ec23ca1SMatthew Dillonreached. 2048ec23ca1SMatthew DillonThis gives 2058ec23ca1SMatthew Dillon.Nm 2068ec23ca1SMatthew Dillona slower ramp that it can load manage against. 2078ec23ca1SMatthew DillonSpecifying 0 disables the slow-start feature and the maximum number of 2088ec23ca1SMatthew Dillonworker slots (limited by the dependency graph) will be loaded immediately. 209c6142119SAntonio Huete Jimenez.It Fl v 210c6142119SAntonio Huete JimenezQuickly output the version and exit. 211c6142119SAntonio Huete Jimenez.It Fl x 212c6142119SAntonio Huete Jimenez.It Fl xx 213c6142119SAntonio Huete JimenezNormally dsynth builds a package for any of three reasons: (1) If the contents 214c6142119SAntonio Huete Jimenezof the ports directory changes, (2) If anything the port depends on requires 215c6142119SAntonio Huete Jimenezrebuilding so to will the port be rebuilt, (3) If there is no binary package 216c6142119SAntonio Huete Jimenezalready built for the port. 217c6142119SAntonio Huete Jimenez.Pp 218c6142119SAntonio Huete JimenezIf this option is specified, the first test is ignored. 219c6142119SAntonio Huete JimenezIf this option is specified twice, the first and second tests are ignored. 220c6142119SAntonio Huete Jimenez.It Fl y 221c6142119SAntonio Huete JimenezAutomatically answer 'y'es to any questions. 222a67bf8dbSMatthew Dillon.It Fl D 223a67bf8dbSMatthew DillonTurn on DEVELOPER mode when building ports. 224c6142119SAntonio Huete Jimenez.It Fl P 225c6142119SAntonio Huete JimenezInclude the check-plist stage. 226c6142119SAntonio Huete JimenezThis is the default for the 227c6142119SAntonio Huete Jimenez.Cm everything 2289cb4fab1SMatthew Dillonand 2299cb4fab1SMatthew Dillon.Cm test 2309cb4fab1SMatthew Dillondirectives. 2319cb4fab1SMatthew DillonThis feature may also be turned on via the 2329cb4fab1SMatthew Dillon.Va Check_plist 2339cb4fab1SMatthew Dillonoption in the configuration file. 234a67bf8dbSMatthew Dillon.It Fl S[S] 235650b8785SSascha WildnerTurn off curses for script friendliness. 236650b8785SSascha WildnerThe output will be log 00 and 23754f2fefcSMatthew Dillonshould be redirected to /dev/null or something similar. 238a67bf8dbSMatthew DillonIf you supply the options twice, color output escapes will also be 239a67bf8dbSMatthew Dillonturned off. 24054f2fefcSMatthew DillonYou may also wish to use the 24154f2fefcSMatthew Dillon.Fl y 24254f2fefcSMatthew Dillonoption for scripting dsynth. 2436d1478d9SMatthew Dillon.It Fl N 2446d1478d9SMatthew DillonNormally 2456d1478d9SMatthew Dillon.Nm 2466d1478d9SMatthew Dillonnices its sub-processes to +10. 2476d1478d9SMatthew DillonThis option disables the feature. 2488ec23ca1SMatthew Dillon.El 2498ec23ca1SMatthew Dillon.Sh DIRECTIVES 2508ec23ca1SMatthew DillonGenerally 2518ec23ca1SMatthew Dillon.Nm 2528ec23ca1SMatthew Dillonis run with a directive and some directives allow a list of ports to be 253650b8785SSascha Wildnerspecified. 254650b8785SSascha WildnerThis list should be space-delimited in DIR/SUBDIR format, for example: 2558ec23ca1SMatthew Dillon.Ar www/chromium . 2568ec23ca1SMatthew DillonFor directives with an optional ports list, your current installed set 2571644605eSMatthew Dillonof ports will be used if you do not specify a list. You may also 2581644605eSMatthew Dillonspecify a filename instead of a port to have dsynth read the ports list 2591644605eSMatthew Dillonfrom a text file. Ports are specified by dports directory and subdirectory. 2601644605eSMatthew DillonFor example "www/chromium". 2618ec23ca1SMatthew Dillon.Bl -tag -width indent 2628ec23ca1SMatthew Dillon.It Cm init 2638ec23ca1SMatthew DillonCreates and initializes the 2648ec23ca1SMatthew Dillon.Pa /etc/dsynth 265ec888f6dSSascha Wildnerdirectory if it does not exist. 2668ec23ca1SMatthew DillonThis directive will complain and exit if either 2678ec23ca1SMatthew Dillon.Pa /etc/dsynth 2688ec23ca1SMatthew Dillonor 2698ec23ca1SMatthew Dillon.Pa /usr/local/etc/dsynth 270650b8785SSascha Wildnerexists. 271650b8785SSascha WildnerIt will not create 2728ec23ca1SMatthew Dillon.Pa /etc/dsynth 2738ec23ca1SMatthew Dillonin this situation. 274c6142119SAntonio Huete Jimenez.It Cm status 275c6142119SAntonio Huete JimenezThis will do a dry-run of 276c6142119SAntonio Huete Jimenez.Cm upgrade-system 277c6142119SAntonio Huete Jimenezbut not actually build anything. 278c6142119SAntonio Huete Jimenez.It Cm cleanup 279c6142119SAntonio Huete JimenezThis will clean up any left-over mounts from prior builds. 280c6142119SAntonio Huete Jimenez.Nm 281c6142119SAntonio Huete Jimenezattempts to clean up all processes and mounts when you interrupt 282c6142119SAntonio Huete Jimeneza build but doesn't always succeed. 2838ec23ca1SMatthew Dillon.It Cm configure 2848ec23ca1SMatthew DillonNOT CURRENTLY IMPLEMENTED 285325ef124SMatthew Dillon.It Cm fetch-only Op Ar ports/everything 286325ef124SMatthew DillonFetch all source distributions required to build 287325ef124SMatthew Dillonthe specified target. Specifying 'everything' fetches 288325ef124SMatthew Dillonall source distributions required to build the whole 289325ef124SMatthew Dillonof dports. 290325ef124SMatthew Dillon.Pp 291325ef124SMatthew DillonAny existing distfiles which do not match the expected 292325ef124SMatthew Dillonsignature will be re-fetched. 2938ec23ca1SMatthew Dillon.It Cm upgrade-system 294650b8785SSascha WildnerNOT CURRENTLY IMPLEMENTED. 295650b8785SSascha WildnerIncrementally build and upgrade your locally 2968ec23ca1SMatthew Dilloninstalled packages, then upgrade your local system with them. 2971644605eSMatthew Dillon.It Cm list-system 2981644605eSMatthew DillonWrite a build list to the file "build.txt". Do not build anything. 2991644605eSMatthew DillonThis is typically used on your target system to generate a list for 3001644605eSMatthew Dillondsynth to use as a build list on another system. 3018ec23ca1SMatthew Dillon.It Cm prepare-system 3028ec23ca1SMatthew DillonIncrementally build and upgrade your locally installed packages, but 3038ec23ca1SMatthew Dillondo not upgrade your system with them. 3048ec23ca1SMatthew Dillon.It Cm rebuild-repository 3058ec23ca1SMatthew DillonBuild or rebuild the database files for the configured repository. 3068ec23ca1SMatthew Dillon.It Cm purge-distfiles 307*2c5f241eSMatthew DillonDelete any obsolete source distribution files. This command fails if 308*2c5f241eSMatthew Dillonthe pkglist scan has errors due to corrupt Makefile's or missing 309*2c5f241eSMatthew Dillondependencies in the dports/ tree. 310*2c5f241eSMatthew DillonThe 311*2c5f241eSMatthew Dillon.Fl f 312*2c5f241eSMatthew Dillonoption may be used to force the purge to occur anyway, with the provisio 313*2c5f241eSMatthew Dillonthat it may end up removing distfiles that you actually need and force 314*2c5f241eSMatthew Dillonthem to be refetched later. 315b6bd007bSMatthew Dillon.It Cm reset-db 316c6142119SAntonio Huete JimenezDelete ports_crc.db from the build directory. 317c6142119SAntonio Huete JimenezThis database is used to detect changes made to the dports tree. 318c6142119SAntonio Huete JimenezIt will be regenerated on your next build without forcing any packages to be rebuilt. 3198ec23ca1SMatthew Dillon.It Cm status-everything 3208ec23ca1SMatthew DillonThis will do a dry-run of a full bulk build of everything, 3218ec23ca1SMatthew Dillonbut not actually build anything. 3228ec23ca1SMatthew Dillon.It Cm everything 3238ec23ca1SMatthew DillonThis will build the entire dports tree and then rebuild the repository 3248ec23ca1SMatthew Dillonwhen it finishes. 3258ec23ca1SMatthew Dillon.It Cm version 326650b8785SSascha WildnerThis is for synth compatibility. 327650b8785SSascha WildnerThe version of 3288ec23ca1SMatthew Dillon.Nm 3298ec23ca1SMatthew Dillonwill be printed and the program will exit. 3308ec23ca1SMatthew Dillon.It Cm help 3318ec23ca1SMatthew DillonOutput a synopsis of options and directives and exit. 3328ec23ca1SMatthew Dillon.It Cm status Op Ar ports 3338ec23ca1SMatthew DillonDo a dry-run with 'build' of the given list. 334c819d181SMatthew Dillon.It Cm add Op Ar ports 335c819d181SMatthew DillonThis directive may be used when the user wishes to add additional 336c819d181SMatthew Dillonports to an existing dsynth run without interrupting and restarting 337c819d181SMatthew Dillonthe dsynth. 338c819d181SMatthew DillonIt can be useful when the user intends to leave dsynth unattended for 339c819d181SMatthew Dillona long period of time and does not wish to interrupt potentially very 340c819d181SMatthew Dillonlong builds that are already in progress. 341c819d181SMatthew Dillon.Pp 342c819d181SMatthew DillonWhen dsynth completes the current run it will re-exec itself with 343c819d181SMatthew Dillonthe same primary directive along with all ports specified by any 344c819d181SMatthew Dillon.Cm add 345c819d181SMatthew Dillondirectives made in the interim. 346c819d181SMatthew Dillon.Nm 347c819d181SMatthew Dillonwill still rebuild the repository after the initial run if it would 348c819d181SMatthew Dillonnormally have done so, but if so it will do it without asking first. 349c819d181SMatthew DillonOnly the last rebuild request will potentially be interactive. 350c819d181SMatthew Dillon.Pp 351c819d181SMatthew DillonNote that interrupting or killing the running dsynth cleans out any 352c819d181SMatthew Dillonports that might have been added while it was running. This directive 353c819d181SMatthew Dillonalso has numerous exit/exec lock-file races and is intended to only be used 354c819d181SMatthew Dillonmanually by the user. 3558ec23ca1SMatthew Dillon.It Cm build Op Ar ports 356650b8785SSascha WildnerIncrementally build dports based on the given list. 357650b8785SSascha WildnerWhen done, ask whether the repository should be rebuilt or not. 3588ec23ca1SMatthew Dillon.It Cm just-build Op Ar ports 3598ec23ca1SMatthew DillonIncrementally build dports based on the given list, then 360650b8785SSascha Wildnerexits. 361650b8785SSascha WildnerNo post-build steps will be taken. 3628ec23ca1SMatthew Dillon.It Cm install Op Ar ports 3638ec23ca1SMatthew DillonNOT CURRENTLY IMPLEMENTED. 'build' based on the supplied 3648ec23ca1SMatthew Dillonlist (or using currently installed packages), then rebuild 36517be4d43SSascha Wildnerthe repository and upgrade the system without asking any further 3668ec23ca1SMatthew Dillonquestions. 3678ec23ca1SMatthew Dillon.It Cm force Op Ar ports 368650b8785SSascha WildnerThis is the same as 'build' but will delete existing packages first. 369650b8785SSascha WildnerDependencies are not deleted unless they are out of date. 3708ec23ca1SMatthew Dillon.It Cm test Op Ar ports 3718ec23ca1SMatthew DillonThis is the same as 'build' but sets the environment variable 372650b8785SSascha Wildner.Ev DEVELOPER 373650b8785SSascha Wildnerto 374650b8785SSascha Wildner.Sq yes 375650b8785SSascha Wildnerand pre-deletes specified packages. 376650b8785SSascha WildnerDependencies are not deleted unless they are out of date. 377bc7e28d2SMatthew Dillon.It Cm debug Op Ar ports 378bc7e28d2SMatthew DillonThis is the same as 'build' but leaves the chroot mounts intact 379bc7e28d2SMatthew Dillonupon completion. 380c6142119SAntonio Huete Jimenez.It Cm monitor Op Ar datfile 381c6142119SAntonio Huete JimenezMonitors a running dsynth instance. 3828ec23ca1SMatthew Dillon.El 3834a7eab7cSMatthew Dillon.Sh PER-PORT OPTIONS 3844a7eab7cSMatthew DillonThe 3854a7eab7cSMatthew Dillon.Va Directory_options 3864a7eab7cSMatthew Dillonconfiguration variable in 3874a7eab7cSMatthew Dillon.Pa /etc/dsynth/dsynth.ini 3884a7eab7cSMatthew Dillonpoints to the configured options directory tree. 3894a7eab7cSMatthew DillonIn the base system dports this would be 3904a7eab7cSMatthew Dillon.Pa /var/db/ports , 3914a7eab7cSMatthew Dillonbut you can supply an independent set of ports options for your dsynth 3924a7eab7cSMatthew Dillonbuild if you like. 3934a7eab7cSMatthew DillonThe format of the structure in this directory is best described simply by 3944a7eab7cSMatthew DillonCD'ing into a dport, say www/chromium, typing 'make config', and it will 3954a7eab7cSMatthew Dilloncreate a sub-directory and write out a file called 3964a7eab7cSMatthew Dillon.Pa /var/db/ports/www_chromium/options . 3974a7eab7cSMatthew Dillon.Pp 3984a7eab7cSMatthew DillonFor 3994a7eab7cSMatthew Dillon.Nm 4004a7eab7cSMatthew Dillonyou can either point your configuration variable to the system default, 4014a7eab7cSMatthew Dillonor you can point it at a dsynth-specific directory and copy the options 4024a7eab7cSMatthew Dillonto or construct the options in your dsynth-specific directory tree. 403c1bd0b08SAntonio Huete Jimenez.Sh HOOKS 404c1bd0b08SAntonio Huete Jimenez.Nm 405c1bd0b08SAntonio Huete Jimenezprovides several hooks that trigger at specific stages during the 406c1bd0b08SAntonio Huete Jimenezpackage building process. 407c1bd0b08SAntonio Huete Jimenez.Pp 408c1bd0b08SAntonio Huete JimenezAt the moment hooks are not configurable so the exact executable file is 409c1bd0b08SAntonio Huete Jimenezexpected in the configuration directory with one of the names in the 4102f0280fdSSascha Wildnerlist below. 411c1bd0b08SAntonio Huete JimenezHooks are run via 412c1bd0b08SAntonio Huete Jimenez.Xr execve 2 . 413c1bd0b08SAntonio Huete Jimenez.Bl -tag -width indent 41467f1c6e8SSascha Wildner.It Pa hook_run_start 415c1bd0b08SAntonio Huete JimenezThis hook triggers when the overall build process starts. 41667f1c6e8SSascha Wildner.It Pa hook_run_end 417c1bd0b08SAntonio Huete JimenezThis hook is called when the overall build process ends. 41867f1c6e8SSascha Wildner.It Pa hook_pkg_success 419c1bd0b08SAntonio Huete JimenezFor each successful port built this hook will trigger. 42067f1c6e8SSascha Wildner.It Pa hook_pkg_failure 421c1bd0b08SAntonio Huete JimenezThis hook will trigger for each port that fails to build. 42267f1c6e8SSascha Wildner.It Pa hook_pkg_ignored 423c1bd0b08SAntonio Huete JimenezEach port that is marked as ignored will make this hook to trigger. 42467f1c6e8SSascha Wildner.It Pa hook_pkg_skipped 425c1bd0b08SAntonio Huete JimenezEach skipped port will trigger this hook. 426c1bd0b08SAntonio Huete Jimenez.El 427c1bd0b08SAntonio Huete Jimenez.Pp 428c1bd0b08SAntonio Huete JimenezA number of environment variables are available for hooks, always in the context 429c1bd0b08SAntonio Huete Jimenezof an ongoing build and within a specific configuration profile, unless 430c1bd0b08SAntonio Huete Jimenezoverridden from the command-line. 431c1bd0b08SAntonio Huete JimenezSome are only available for a specific hook. 432c1bd0b08SAntonio Huete Jimenez.Bl -tag -width DIR_REPOSITORY 433c1bd0b08SAntonio Huete Jimenez.It Ev PROFILE 434c1bd0b08SAntonio Huete JimenezThe configuration profile. 435c1bd0b08SAntonio Huete Jimenez.It Ev DIR_PACKAGES 436c1bd0b08SAntonio Huete JimenezThe packages base directory, i.e where index files are generated. 437c1bd0b08SAntonio Huete Jimenez.It Ev DIR_REPOSITORY 438c1bd0b08SAntonio Huete JimenezThe packages repository, where the actual package files are stored. 439c1bd0b08SAntonio Huete Jimenez.It Ev DIR_PORTS 440c1bd0b08SAntonio Huete JimenezThe ports directory. 441c1bd0b08SAntonio Huete Jimenez.It Ev DIR_OPTIONS 442c1bd0b08SAntonio Huete JimenezThe options directory. 443c1bd0b08SAntonio Huete Jimenez.It Ev DIR_DISTFILES 444c1bd0b08SAntonio Huete JimenezThe distfiles directory, where the distribution files are stored. 445c1bd0b08SAntonio Huete Jimenez.It Ev DIR_LOGS 446c1bd0b08SAntonio Huete JimenezThe logs directory, which is also where the html Report is generated. 447c1bd0b08SAntonio Huete Jimenez.It Ev DIR_BUILDBASE 448c1bd0b08SAntonio Huete JimenezThe build base directory. 449c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_QUEUED 45067f1c6e8SSascha WildnerThe number of ports queued to be built (only for 45167f1c6e8SSascha Wildner.Pa hook_run_start ) . 452c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_BUILT 45367f1c6e8SSascha WildnerThe number of successfully built ports (only for 45467f1c6e8SSascha Wildner.Pa hook_run_end ) . 455c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_FAILED 45667f1c6e8SSascha WildnerThe number of ports for which the build failed (only for 45767f1c6e8SSascha Wildner.Pa hook_run_end ) . 458c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_IGNORED 459c1bd0b08SAntonio Huete JimenezThe number of ports that where ignored and, hence, not built 46067f1c6e8SSascha Wildner(only for 46167f1c6e8SSascha Wildner.Pa hook_run_end ) . 462c1bd0b08SAntonio Huete Jimenez.It Ev PORTS_SKIPPED 46367f1c6e8SSascha WildnerThe number of ports that were skipped in the build (only for 46467f1c6e8SSascha Wildner.Pa hook_run_end ) . 465c1bd0b08SAntonio Huete Jimenez.It Ev RESULT 466c1bd0b08SAntonio Huete JimenezThe result (success, failure, ignored, skipped) for the build of an individual 46767f1c6e8SSascha Wildnerport (only for 46867f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 469c1bd0b08SAntonio Huete Jimenez.It Ev ORIGIN 47067f1c6e8SSascha WildnerThe origin of a port (only for 47167f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 472c1bd0b08SAntonio Huete Jimenez.It Ev FLAVOR 47367f1c6e8SSascha WildnerThe flavor of a port (only for 47467f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 475c1bd0b08SAntonio Huete Jimenez.It Ev PKGNAME 47667f1c6e8SSascha WildnerThe port name (only for 47767f1c6e8SSascha Wildner.Pa hook_pkg_* ) . 478c1bd0b08SAntonio Huete Jimenez.El 4799cb4fab1SMatthew Dillon.Sh MISC 4809cb4fab1SMatthew Dillon.Pp 4819cb4fab1SMatthew DillonThe default setting for 4829cb4fab1SMatthew Dillon.Va Meta_version 4839cb4fab1SMatthew Dillonis now 2. You can override it with this configuration variable. 4849cb4fab1SMatthew Dillon.Pp 4859cb4fab1SMatthew DillonThe default setting for 4869cb4fab1SMatthew Dillon.Va Check_plist 4879cb4fab1SMatthew Dillonis false. You can override it with the 4889cb4fab1SMatthew Dillon.Fl P 4899cb4fab1SMatthew Dillonoption or by setting this configuration variable to true. 4903bd7e0a7SMatthew Dillon.Pp 4913bd7e0a7SMatthew DillonThe default setting for 4923bd7e0a7SMatthew Dillon.Va Numa_setsize 4933bd7e0a7SMatthew Dillonis 0, disabling any NUMA related CPU partitioning. This is the recommended 4943bd7e0a7SMatthew Dillonsetting as it allows the scheduler the freedom to maximize CPU utilization, 4953bd7e0a7SMatthew Dillonparticularly when doing incremental bulks. The only other values that have 4963bd7e0a7SMatthew Dillona decent chance of improving full bulk performance are 2 or 4. Any higher 4973bd7e0a7SMatthew Dillonand CPU utilization will suffer from periods of high idle. 4988ec23ca1SMatthew Dillon.Sh FILES 4998ec23ca1SMatthew Dillon.Bl -tag -width ".It Pa <fs>/abc/defghi/<name>" -compact 5002c9f4f91SMatthew Dillon.It Pa /etc/dsynth/dsynth.ini 501650b8785SSascha WildnerThe primary configuration file. 502650b8785SSascha WildnerIf not found, 5038ec23ca1SMatthew Dillon.Nm 5048ec23ca1SMatthew Dillonwill also look in 5052c9f4f91SMatthew Dillon.Pa /usr/local/etc/dsynth/dsynth.ini . 5068ec23ca1SMatthew Dillon.Pp 5078ec23ca1SMatthew Dillon.It Pa /etc/dsynth/LiveSystem-make.conf 5088ec23ca1SMatthew DillonTypically contains the environment variables that will be set in 5098ec23ca1SMatthew Dillonthe workers. 5108ec23ca1SMatthew Dillon.Nm 5118ec23ca1SMatthew Dillonfirewalls the environment it is run under from the environment it 5128ec23ca1SMatthew Dillonprovides to the workers. 5138ec23ca1SMatthew Dillon.Pp 5148ec23ca1SMatthew Dillon.It Pa /build/synth/build 5158ec23ca1SMatthew DillonRecommended setting for 516650b8785SSascha Wildner.Va Directory_buildbase , 5178ec23ca1SMatthew Dilloncontains the build infrastructure... typically a template, mirrored 5188ec23ca1SMatthew Dillonsystem directories, and mount points for all the worker slots. 5198ec23ca1SMatthew DillonThe template will be [re]generated if 'pkg' needs to be built or 5208ec23ca1SMatthew Dillonif the 5218ec23ca1SMatthew Dillon.Pa .template.good 5228ec23ca1SMatthew Dillonfile in this directory is deleted. 5238ec23ca1SMatthew Dillon.Pp 5248ec23ca1SMatthew Dillon.It Pa /build/synth/distfiles 5258ec23ca1SMatthew DillonRecommended setting for 526650b8785SSascha Wildner.Va Directory_distfiles , 5278ec23ca1SMatthew Dillonports to a directory into which 5288ec23ca1SMatthew Dillon.Nm 5298ec23ca1SMatthew Dillonwill download any source distribution files required for building. 5308ec23ca1SMatthew Dillon.Pp 5318ec23ca1SMatthew Dillon.It Pa /build/synth/dports 5328ec23ca1SMatthew DillonRecommended setting for 533650b8785SSascha Wildner.Va Directory_portsdir , 5348ec23ca1SMatthew Dillonpoints to a checked out dports repo. 5358ec23ca1SMatthew DillonNote that 5368ec23ca1SMatthew Dillon.Nm 5378ec23ca1SMatthew Dillondoes not automatically 'git pull' or otherwise synchronize the dports repo, 5388ec23ca1SMatthew Dillonyou must do that yourself prior to starting a build. 5398ec23ca1SMatthew Dillon.Pp 5408ec23ca1SMatthew Dillon.It Pa /build/synth/live_packages 5418ec23ca1SMatthew DillonRecommended setting for 542650b8785SSascha Wildner.Va Directory_packages , 5438ec23ca1SMatthew Dillonpoints to a directory which will contain the completed application 5448ec23ca1SMatthew Dillonpackages. 5458ec23ca1SMatthew Dillon.Pp 5468ec23ca1SMatthew Dillon.It Pa /build/synth/logs 5478ec23ca1SMatthew DillonRecommended setting for 548650b8785SSascha Wildner.Va Directory_logs , 5498ec23ca1SMatthew Dillonall log files will be placed in this directory. 5508ec23ca1SMatthew DillonSpecial management logfiles begin with the numeral '0' for easily 5518ec23ca1SMatthew Dillonlocation. 5528ec23ca1SMatthew DillonThe logfiles for ports while and after building are stored in the 5538ec23ca1SMatthew Dillonform subdir____portname.log, with three underscores. 5548ec23ca1SMatthew Dillon.Pp 5558ec23ca1SMatthew Dillon.It Pa /build/synth/options 5568ec23ca1SMatthew DillonRecommended setting for 557650b8785SSascha Wildner.Va Directory_options , 5588ec23ca1SMatthew Dillonwhere options overrides for specific ports may be located. 5594a7eab7cSMatthew DillonThen either null-mount the system /var/db/ports to this location, or 5604a7eab7cSMatthew Dillonconstruct your own dsynth-specific options. 5614a7eab7cSMatthew DillonSee the PER-PORT OPTIONS section above for more information. 5628ec23ca1SMatthew Dillon.Pp 5638ec23ca1SMatthew Dillon.It Pa / 5648ec23ca1SMatthew DillonRecommended setting for 565650b8785SSascha Wildner.Va Directory_system , 5668ec23ca1SMatthew Dillonwhich 5678ec23ca1SMatthew Dillon.Nm 5688ec23ca1SMatthew Dillonuses as a basis for creating the jails or chroots in each worker slot 5698ec23ca1SMatthew Dillonduring building. 5708ec23ca1SMatthew DillonNo part of the system root is ever NULL-mounted read-write... it is always 5718ec23ca1SMatthew DillonNULL-mounted read-only. 5728ec23ca1SMatthew DillonSome elements from the system base will be mirrored in the build-base 5738ec23ca1SMatthew Dillonas an optimization. 5748ec23ca1SMatthew Dillon.Pp 5758ec23ca1SMatthew DillonNote that the packages directory and the distfiles directory is mounted 576650b8785SSascha Wildnerread-write in jails or chroots. 577650b8785SSascha WildnerAll other r/w filesystems in the workers are 5788ec23ca1SMatthew Dillon.Xr tmpfs 5 5798ec23ca1SMatthew Dillonbased filesystems and will be created and torn-down for each port. 580483dbac9SMatthew Dillon.Pp 581483dbac9SMatthew Dillon.It Pa .txz 582483dbac9SMatthew Dillon.It Pa .tgz 583483dbac9SMatthew Dillon.It Pa .tar 584483dbac9SMatthew Dillon.It Pa .tbz 585ef0c0bf5SKrzysztof Piecuch.It Pa .tzst 586483dbac9SMatthew DillonThe recommended setting for 587483dbac9SMatthew Dillon.Va Package_suffix 588483dbac9SMatthew Dillonis either 589483dbac9SMatthew Dillon.Pa .txz 590483dbac9SMatthew Dillonor 591483dbac9SMatthew Dillon.Pa .tgz . 592483dbac9SMatthew DillonUse 593483dbac9SMatthew Dillon.Pa .txz 594483dbac9SMatthew Dillonfor better compression at the cost of somewhat slower bulk builds due 595483dbac9SMatthew Dillonto the time overhead for compression and decompression, or 596483dbac9SMatthew Dillonuse 597483dbac9SMatthew Dillon.Pa .tgz 598483dbac9SMatthew Dillonfor modest compression and very fast compression and decompression. 599483dbac9SMatthew DillonDue to the way the builder works, package dependencies are fresly 600483dbac9SMatthew Dilloninstalled into the chroot slot for each package being built, so 601483dbac9SMatthew Dillondecompression time matters. 6026a7ba689SMatthew Dillon.Pp 6038ec23ca1SMatthew Dillon.El 6048ec23ca1SMatthew Dillon.Sh EXIT STATUS 6058ec23ca1SMatthew Dillon.Ex -std 6068ec23ca1SMatthew Dillon.Sh SEE ALSO 60717be4d43SSascha Wildner.Xr synth 1 , 6088ec23ca1SMatthew Dillon.Xr dports 7 6098ec23ca1SMatthew Dillon.Sh HISTORY 6108ec23ca1SMatthew DillonThe 6118ec23ca1SMatthew Dillon.Nm 6128ec23ca1SMatthew Dillonutility first appeared in 6138ec23ca1SMatthew Dillon.Dx 5.7 . 6148ec23ca1SMatthew Dillon.Sh AUTHORS 6158ec23ca1SMatthew Dillon.An Matthew Dillon Aq Mt dillon@backplane.com 616