xref: /openbsd-src/share/man/man1/dpb.1 (revision 6396a31b28c13abcc71f05292f11b42abbafd7d3)
1.\"	$OpenBSD: dpb.1,v 1.15 2019/05/31 23:12:08 jmc Exp $
2.\"
3.\" Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: May 31 2019 $
18.Dt DPB 1
19.Os
20.Sh NAME
21.Nm dpb
22.Nd distributed ports builder
23.Sh SYNOPSIS
24.Nm dpb
25.Op Fl acemqRrsUuvx
26.Op Fl A Ar arch
27.Op Fl B Ar chroot
28.Op Fl b Ar logfile
29.Op Fl C Ar pathlist
30.Op Fl D Ar PARAM Ns = Ns Ar value
31.Op Fl F Ar m
32.Op Fl f Ar m
33.Op Fl h Ar hosts
34.Op Fl I Ar pathlist
35.Op Fl J Ar p
36.Op Fl j Ar n
37.Op Fl L Ar logdir
38.Op Fl l Ar lockdir
39.Op Fl M Ar threshold
40.Op Fl P Ar pathlist
41.Op Fl p Ar parallel
42.Op Fl S Ar logfile
43.Op Fl X Ar pathlist
44.Op Ar pathlist ...
45.Sh DESCRIPTION
46.Nm
47is used to build ports on a cluster of machines, or on a single machine
48with several cores.
49.Nm
50walks the ports tree to figure out dependencies, and starts building ports
51as soon as it can.
52.Pp
53.Nm
54will run with sensible defaults if used without options.
55Note, however, that it will produce logs, lock files, packages, and package
56installations.
57.Pp
58If run as non-root,
59.Nm
60will warn.
61The preferred way is to run it as root (and preferably under a chroot).
62.Nm
63will then change its identity to different users as needed.
64See
65.Sq THE SECURITY MODEL OF DPB
66for details.
67.Pp
68.Nm
69can be restricted to a subset of the tree by giving it
70.Ar pathlist ...
71to build as parameters.
72.Pp
73A
74.Ar pathlist
75is either a
76.Xr pkgpath 7
77to build, or a filename that contains pkgpaths (one per line).
78.Ar pathlist
79parameters can also take the form
80.Li filename*scale
81in order to multiply the weights of all
82.Xr pkgpath 7
83in a file by a given
84.Ar scale ,
85or
86.Li pkgpath=value ,
87in order to set the weight of a given
88.Xr pkgpath 7
89to a specific value.
90.Pp
91.Nm
92supports
93.Sq hot-fixes :
94if a particular port errors out, it is possible to fix the problem, remove
95the corresponding lockfile, and
96.Nm
97will pick it up without needing to be stopped and restarted.
98.Pp
99In order to build on a cluster, the ports tree itself should be identical
100on each machine (shared through NFS or copied at start).
101.Pp
102Some directories must be shared:
103.Ev PACKAGE_REPOSITORY ,
104.Ev DISTDIR ,
105and
106.Ev PLIST_REPOSITORY .
107The
108.Ev WRKOBJDIR
109and
110.Ev LOCKDIR
111should be local to each machine, and on a high-speed partition.
112.Pp
113Also note that
114.Nm Ns 's
115logs and locks are managed by the main
116.Nm
117process, which runs locally, and hence those directories do not need to
118be shared on the cluster.
119.Pp
120Some log files ("rolling logs") are kept from one run to the run and
121stored under
122.Pa ${DISTDIR}/build-stats .
123.Pp
124Option
125.Fl h Ar file
126is used to specify hosts to use, where
127.Ar file
128may contain lots of information,
129but can be as simple as a list of hosts to use, one host per line
130(however, it is recommended to also include a
131.Ar STARTUP
132script).
133.Pp
134Most filenames will go through some control sequence expansions.
135For instance, the default logdir location can be specified as
136.Pa %p/logs/%a .
137The following sequences are recognized:
138.Bl -tag -offset aaaa -width %aa
139.It Cm %a
140architecture being used.
141.It Cm %d
142date at start of
143.Nm ,
144GMtime, formatted as yyyy-mm-dd@hh:mm:ss.
145.It Cm %f
146fetch distfiles location (DISTDIR).
147.It Cm %h
148hostname running
149.Nm .
150.It Cm %L
151logdir location.
152.It Cm %p
153portsdir location.
154.It Cm %t
155timestamp (number of seconds since January 1 1970) at start of
156.Nm .
157.El
158.Pp
159Options are as follows:
160.Bl -tag -width pkgpathlong
161.It Fl A Ar arch
162Build packages for given architecture, selecting relevant hosts from the
163cluster.
164By default, the current host's architecture will be used.
165.It Fl a
166Walk the whole tree and builds all packages (default if no
167.Ar pathlist
168is given).
169.It Fl B Ar chroot
170chroot to
171.Ar chroot
172before building.
173See
174.Xr proot 1
175for preparing such an environment.
176.It Fl b Ar logfile
177Explicitly prime the heuristics module with a previous build log,
178so that packages that take a long time to build will happen earlier.
179The rolling log under
180.Pa %f/build-stats/%a
181is automatically used.
182.It Fl C Ar pathlist
183Don't clean port working directories after build.
184Only use simple
185.Xr pkgpath 7
186in the list,
187as this does not take subpackages and flavors into account.
188.It Fl c
189Clean port working directory and log before each build.
190.It Fl D Ar PARAM Ns = Ns Ar value
191Set defined parameter to value.
192Known parameters are as follows:
193.Bl -tag -width DISP
194.It Ar ALWAYS_CLEAN
195Set to 1 if
196.Nm
197should clean work directories even if the port errored out.
198.It Ar BUILD_USER
199Default value for
200.Ar build_user
201if you want to specify it on the command line, and want to ensure even
202the small "discover PORTSDIR" activity at the beginning of
203.Nm
204is not run as root.
205.It Ar CDROM_ONLY
206Don't fetch distfiles that are not allowed for cdrom.
207.It Ar COLOR
208Set to 1 to have the normal display in color.
209.It Ar CONNECTION_TIMEOUT
210Connection timeout for ssh.
211Defaults to 10 seconds (but ssh will retry 3 times).
212.It Ar CONTROL
213Let
214.Nm
215create a unix socket of the given name for external control.
216.It Ar DISPLAY_TIMEOUT
217Display timeout (in seconds) while waiting for jobs to finish, so that the
218display is updated even if jobs didn't finish.
219Defaults to 10 seconds.
220.It Ar DONT_BUILD_ONCE
221By default,
222.Nm
223will use the
224.Ev BUILD_ONCE
225optimization
226.Po
227see
228.Xr bsd.port.mk 5
229.Pc
230if run with
231.Fl a :
232pseudo-flavors that disable subpackages and are not necessary for bootstrap
233will be disabled, so that the same port is built once, as far as possible.
234This flag disables that optimization, which might be desirable if you want
235to build a small subset of packages which would pull in the kitchen sink
236otherwise.
237.It Ar DONT_CLEAN_LOCKS
238By default,
239.Nm
240will clean old locks from dpb running on the same host that no longer exist,
241provided they didn't end in error.
242This is usually the right thing to do after a crash, or after killing dpb
243abruptly.
244Sometimes, one may want manual control over which locks to remove.
245.It Ar FETCH_JOBS
246Alternate way to specify the number of fetch jobs.
247.It Ar FETCH_TIMEOUT
248Timeout (in seconds) after which fetches that don't show
249any progress will be killed.
250This can be instead set in
251.Ar DEFAULT
252or
253.Ar localhost
254as the
255.Sq fetch_timeout
256property.
257.It Ar FETCH_USER
258User for all fetch activities if possible
259.Po defaults to
260.Ar _pfetch
261.Pc .
262.It Ar FTP_ONLY
263Don't fetch distfiles that are not allowed for ftp.
264.It Ar HISTORY_ONLY
265Don't fetch or build anything.
266Only run
267.Nm
268to figure out old distfiles and update
269.Pa %f/history .
270.It Ar LISTING_EXTRA
271Alternate way to specify
272.Fl e .
273.It Ar LOCKDIR
274Alternate way to specify the locking directory.
275.It Ar LOGDIR
276Alternate way to specify the logging directory.
277.It Ar LOG_USER
278User
279for all log files if possible
280.Po defaults to
281.Ar build_user
282.Pc .
283.It Ar MIRROR
284Applicable to fetch modes.
285If 0, will only fetch normal
286.Ev DISTFILES
287.Po
288default for
289.Nm Fl f
290.Pc .
291If 1, will also fetch extra
292.Ev SUPDISTFILES
293.Po
294default for
295.Nm Fl F
296.Pc .
297.It Ar NO_BUILD_STATS
298Disable reading/saving of default build stats under
299.Pa ${DISTDIR}/build-stats/${ARCH} .
300.It Ar NO_CHECKSUM
301Do not run
302.Ar checksum
303again for files already fetched.
304.It Ar NO_CURSOR
305Make the terminal cursor invisible if possible.
306Avoids flickering on slow graphics cards.
307.It Ar NO_HISTORY
308Do not update the distfiles history.
309For instance, if
310.Nm
311is run a second time after a problem during the first run.
312.It Ar NO_QUICK_SCAN
313Disable the quick scan default heuristic,
314where full bulks will start by scanning the most prominent ports
315in former builds.
316.It Ar PORT_USER
317User that can write to the ports tree.
318Not really used for anything yet.
319.It Ar RECORD
320Define a file which will save all terminal output.
321Mostly useful for presentations, as a way to save
322.Nm dpb
323output and replay it later at a faster rate.
324Defaults to
325.Pa %L/term-report.log ,
326can be set to nothing to disable.
327.It Ar STARTUP
328Define a start-up script on the command-line, override any host file contents.
329.It Ar STUCK_TIMEOUT
330Timeout (in seconds * speed factor) after which tasks that don't show
331any progress will be killed.
332This can be instead set on a per-core basis as the
333.Sq stuck
334property.
335Note that this will always be divided by the core's speed factor.
336.It Ar SYSLOG
337Make
338.Nm
339call
340.Xr syslog 3
341on every task start/end while creating packages.
342This does produce lots of messages, it is intended to route the logging
343on another machine, while tracking down panics and other hangs.
344.It Ar WANTSIZE
345Alternate way to specify
346.Fl s .
347.El
348.It Fl e
349The listing job is extra and won't be given back to the pool when it's
350finished.
351.It Fl F Ar m
352Fetch-only mode, for mirroring hosts.
353Do not build any package but fetch everything, disregarding
354.Ev BROKEN
355and
356.Ev ONLY_FOR_ARCHS
357information.
358Create
359.Ar m
360localhost jobs for fetching files.
361.It Fl f Ar m
362Create
363.Ar m
364jobs for fetching files.
365Those are separate from the build jobs, since they don't consume cpu, and they
366run on the localhost.
367Defaults to 2.
368Can be set to 0 to bypass fetching jobs entirely,
369and reduce
370.Nm
371memory footprint by a lot.
372.It Fl h Ar hosts
373File with hosts to use for building.
374One host per line, plus properties, such as:
375.Bd -literal -offset indent
376espie@aeryn jobs=4 arch=i386
377.Ed
378.Pp
379Lines starting with a known variable name such as
380.Bd -literal -offset indent
381STARTUP=path
382.Ed
383or
384.Bd -literal -offset indent
385FETCH_JOBS=5
386.Ed
387can also be set inside a configuration file, to reduce the number of
388options you must pass on the command line.
389.Pp
390The special hostname
391.Ar DEFAULT
392can be used to preset defaults.
393It should be used at the start of the file.
394.Pp
395Use
396.Ar localhost
397to specify the local machine.
398.Nm
399will special-case it and not use
400.Xr ssh 1
401to connect.
402.Pp
403Properties are as follows:
404.Bl -tag -width memory=150
405.It always_clean=n
406Set to 0 or 1 on per-host basis.
407See
408.Ar ALWAYS_CLEAN
409parameter.
410.It arch=value
411Architecture of the concerned host.
412(there should be a startup task to check consistency, but
413currently this has to be set manually on heterogeneous networks.)
414.It build_user=user
415Use
416.Ar user
417for non root jobs if possible (defaults to
418.Xr whoami 1
419value).
420.It chroot=dir
421Chroot to
422.Ar dir
423before building.
424.It fetch_timeout=s
425Timeout (in seconds) after which fetches that don't show
426any progress will be killed.
427Only makes sense for
428.Ar DEFAULT
429or
430.Ar localhost .
431.It jobs=n
432Number of jobs to run on that host, defaults to hw.ncpu.
433.It junk=n
434Junk unused packages each n steps.
435See
436.Fl J
437option.
438.It memory=thr
439Build everything below that wrkdir threshold with
440.Ev USE_MFS Ns = Ns Sq Yes ,
441assuming the ports tree has been configured so that
442.Ev WRKOBJDIR_MFS
443points to a memory filesystem.
444.Ar thr
445is the sum, in KBytes, of ports that will be allowed to build in memory.
446.Nm
447understands suffixes, such as
448.Fl M Ar 2G
449or
450.Fl M Ar 500M .
451.Pp
452Note that you should always allow for some margin, as
453.Nm
454makes its decision based on the size information collected during previous
455builds, so in cases of significant updates, the work directory size will
456usually grow.
457.It nochecksum=0/1
458Defaults to 1.
459During the junk stage, run
460.Xr pkg_delete 1
461with the
462.Fl q
463(no checksum) option.
464.It parallel=p
465Run big ports on several cores.
466See
467.Fl p
468option.
469.It parallel2=p
470Run largest ports on many cores.
471Defaults to the same value as the parallel option, but can be increased for,
472say, chromium.
473.It repair=0/1
474Defaults to 1.
475Run
476.Xr pkg_add 1
477with the repair option.
478This is useful on some bulk machines which tend to crash a lot, leaving
479.Pa /var/db/pkg
480in a weird state.
481.It sf=n
482Speed factor.
483An estimate of that machine's speed with that number of jobs
484compared to other machines in the same network.
485Works better with small values, in the range of 1..50.
486The machine (or machines) with the highest speed factor will
487get access to all jobs, whereas other machines will be clamped
488to stuff which does not take too long.
489Requires previous build information to be effective.
490Defaults to 1.
491.It small=s
492Small threshold (in seconds * sf):
493ports known to build under that duration are deemed to be small, so
494.Nm
495won't bother calling fine-grained steps for patch/configure/fake.
496It will go straight to build and package instead.
497Defaults to 120 seconds.
498.It squiggles=n
499Number of squiggles on this host (see
500.Sq the squiggle heuristics
501below).
502Defaults to 1 squiggle for hosts with 4 jobs or more, 0.7 for hosts with more than 1 job,
5030 for single job hosts.
504.It stuck=s
505Stuck timeout (in seconds * sf) after which tasks which show no progress
506will get killed.
507.It timeout=s
508Defines a specific connection timeout for ssh to that host.
509.El
510.Pp
511There are no fine-grained options to control
512.Xr ssh 1
513options, as those can be specified through virtual host declarations in
514.Xr ssh_config 5 .
515.It Fl I Ar pathlist
516List of
517.Xr pkgpath 7
518to install, on the local box.
519This will also add them to the list of things to build.
520.It Fl J Ar p
521Override value for the
522.Dq junk
523property.
524Delete unneeded installed packages during the build.
525Each
526.Ar prepare
527stage is followed by a
528.Ar show-prepare-results
529stage.
530After every
531.Ar p
532new dependencies, it will be followed by a
533.Ar junk
534stage which uses
535.Xr pkg_delete 1
536with the
537.Fl aXI
538options to delete automatically installed packages that are currently
539not needed.
540.Pp
541.Nm
542keeps track of list of dependencies on a given host, by storing each
543dependency list in the lockfile corresponding to the package being built.
544.Pp
545To avoid a race condition between the
546.Ar depends
547and
548.Ar junk
549stages,
550.Nm
551allows only one job on a given host to be in the
552.Ar depends
553\&...
554.Ar junk
555stages at one time, by using a per-host lock.
556.Pp
557Defaults to
558.Ar 150 .
559Can be disabled by setting to
560.Ar 0 .
561.Pp
562Some ports, most notably cmake-based, have an annoying dependency handling
563bug: they compute their makefile dependencies based on all include files
564present, not just the ones that are actually enabled.
565Those ports' build may be broken by a
566.Ar junk
567phase that removes some unused includes that were added as makefile
568prerequisites.
569Those ports should be annotated with
570DPB_PROPERTIES = nojunk
571until that bug is fixed:
572while a port with the
573.Sq nojunk
574property is building,
575.Ar junk
576will be postponed.
577.Pp
578Those ports will be marked with a
579.Sq \&!
580in the display, to make it more obvious why junk seems to be ineffective.
581.Pp
582Note that the
583.Sq nojunk
584property is still active for ports in error, in the belief that trivial fixes
585can be made that will allow the port build to finish.
586.It Fl j Ar n
587Number of jobs to run on a single host (defaults to hw.ncpu).
588.It Fl L Ar logdir
589Choose a log directory.
590.Po
591Defaults to
592.Pa %p/logs/%a
593.Pc .
594.It Fl l Ar lockdir
595Choose a lock directory.
596.Po
597Defaults to
598.Pa %L/locks
599.Pc .
600Override to keep local, as locks don't really like NFS.
601.It Fl M Ar threshold
602Build ports below the memory threshold under a memory
603filesystem, as configured through
604.Ev WRKOBJDIR_MFS
605.Po
606see
607.Xr bsd.port.mk 5
608.Pc .
609.Ar threshold
610is the sum, in KBytes, of ports allowed to build there.
611.It Fl m
612Force tty-style reporting.
613.It Fl P Ar pathlist
614Read list of
615.Xr pkgpath 7
616from file.
617.It Fl p Ar parallel
618Override value for the
619.Dq parallel
620property.
621.Pp
622Run big jobs on several cores on the same host, by using
623MAKE_JOBS=k.
624.Pp
625Once such a job has started,
626.Nm
627will not start new jobs on the same host until the big job has
628stolen enough cores from other finishing jobs.
629.Pp
630Only big ports which are safe for parallel building (annotated with
631DPB_PROPERTIES = parallel in their Makefile) will be affected.
632.Pp
633It is advisable to set k to an integral fraction of the
634number of cores available on a given host.
635.Ar parameter
636can be an integer, or of the form
637.Sq /n ,
638in which case,
639.Nm
640will set k to a fraction of the total number of jobs
641on the machine, but never below 2.
642.Pp
643Defaults to
644.Sq /2 .
645.It Fl q
646Don't quit while errors/locks are around.
647.It Fl R
648Rebuild existing packages based on discrepancies between the package
649signature and what the port says it should be.
650Concretely, use to run a partial bulk build after some library change.
651.Pp
652Note that
653.Fl R
654won't always work, as rebuilding a package when another version is already
655installed is not supported.
656Building in a chroot is strongly recommended.
657.It Fl r
658Random build order.
659Disregard any kind of smart heuristics.
660Useful to try to find missing build dependencies.
661.It Fl S Ar logfile
662Read
663.Ar logfile
664as an initial workdir size log.
665.It Fl s
666Compute workdir sizes before cleaning up, and stash them in log file
667.Pa %L/size.log .
668Also maintain a rolling log of build sizes under
669.Pa %f/build-stats/%a-size .
670In order to save time,
671.Nm
672will actually not always compute new sizes for known directories, but mostly
673for new ones, or when the package name changes.
674.It Fl U
675Insist on updating existing packages during dependency solving,
676even if the new package apparently didn't change.
677.It Fl u
678Update existing packages during dependency solving.
679Can be used to run a bulk-build on a machine with installed packages,
680but might break a bit, since some packages only build on a clean machine
681right now.
682.It Fl X Ar pathlist
683Read a list of
684.Xr pkgpath 7
685from file, and pass them along in the junk phase:
686those are packages that should stay on the machine if they've been
687installed by a dependency.
688Can be used to avoid endlessly removing/reinstalling the most common
689packages, e.g.,
690.Pa devel/gmake .
691.It Fl x
692No tty report, only report really important things, like hosts going down
693and coming back up, build errors, or builds not progressing.
694.El
695.Pp
696.Nm
697figures out in which order to build things on the fly, and constantly
698displays information relative to what's currently building.
699There's a list of what is currently running, one line per job.
700Those jobs are ordered in strict chronological order, which means that
701long running builds will tend to percolate to the top of the list.
702Normal jobs look like this:
703.Bd -literal -offset indent
704www/mozilla-firefox(build) [9452] 41% unchanged for 92 seconds
705.Ed
706.Pp
707This contains:
708.Bl -dash
709.It
710an optional
711.Sq ~
712squiggle marker (see below),
713.It
714the pkgpath being built,
715.It
716the step currently being run,
717.It
718an optional
719.Sq \&!
720for ports with the
721.Sq nojunk
722property.
723.It
724an optional
725.Sq +
726for ports built in memory.
727.It
728the pid running that task (note that this is always a pid on the host
729running dpb: for distributed builds, it will be an
730.Xr ssh 1
731to another machine),
732.It
733the current size of the log file (displayed as a percentage if previous
734build statistics are available).
735.It
736and a possible notice that things might be stuck when
737the log file doesn't change for long periods.
738.El
739.Pp
740And fetch jobs look like this:
741.Bd -literal -offset indent
742<dist-3.0.tgz(#1) [4321] 25%
743.Ed
744.Pp
745This contains:
746.Bl -dash
747.It
748the file being fetched
749.It
750the number of the
751.Ev MASTER_SITE
752being tried
753.It
754the pid of the
755.Xr ftp 1
756process (note that fetch jobs are always local).
757.It
758a progress percentage.
759.El
760.Pp
761This is followed by a host line, containing the name
762of each host used by dpb.
763Host names may be tagged with kde3 or kde4.
764They are followed by a
765.Sq `-'
766for unresponsive hosts, and the pid of the ssh master
767for distant hosts.
768.Pp
769This ends with a summary display:
770.Bl -tag -width BB=
771.It I=
772number of built packages that can be installed.
773.It B=
774number of built packages, not yet known to be installable,
775because of run depends that still need to be built.
776.It Q=
777number of packages in the queue, e.g., stuff that can be built now, assuming
778we have a free slot.
779.It T=
780number of packages to build, where dependencies are not yet resolved.
781.It F=
782number of distfiles to fetch, when
783.Fl f
784is used.
785.It !=
786number of ignored packages.
787Details in
788.Pa engine.log .
789.It L=
790list of packages that cannot currently be built because of locks.
791.It E=
792list of packages in error, that cannot currently be built.
793.It H=
794list of packages that haven't shown up yet, usually due to nfs, but
795watch out for revision bumps.
796.El
797.Pp
798If those three lists are empty, they won't even show up.
799Packages in errors may be followed by a
800.Sq \&!
801if they prevent junk from happening.
802.Pp
803Note that those numbers refer to pkgpaths known to
804.Nm .
805In general, those numbers will be slightly higher than the actual number
806of packages being built, since several paths may lead to the same package.
807.Pp
808.Nm
809uses some heuristics to try to maximise the queue as soon as possible.
810There are also provisions for a feedback-directed build, where information from
811previous builds can be used to try to build long-running jobs first.
812.Pp
813Similarly, fetches will use the continue option of
814.Xr ftp 1 ,
815since distfiles are checksummed after the fetch anyways.
816.Ss THE SQUIGGLE HEURISTICS
817However, on machines with lots of cores, the basic scheduling heuristics
818yields a tail of very small jobs, where
819.Nm
820will mostly wait on
821.Xr pkg_add 1
822to solve dependencies.
823Starting with
824.Ox 5.5 ,
825a new mechanism (squiggles) was introduced to counter-balance this effect:
826big machines devote some of their cores to
827.Sq squiggles ,
828jobs that walk the queue in reverse, thus building smallest ports first.
829As a result, small ports are built as a trickle alongside the largest ports,
830thus offsetting the negative effect of the exponential queue for a large part.
831.Pp
832Note that
833.Sq squiggles
834can be a non-integral value, usually lower than 1, in which case they
835represent the fraction of cores that should be affected to squiggles,
836as decided randomly at the start of each build.
8370.7 or 0.8 might be a good choice for dual core machines.
838.Ss DPB PROPERTIES
839The
840.Xr bsd.port.mk 5
841variable
842.Ev DPB_PROPERTIES
843may hold several annotations that only
844.Nm
845will look at.
846These properties are as follows:
847.Bl -tag -width pkgpathlong
848.It Ar lonesome
849Large port that stresses the memory limits of the machine, should be built
850alone.
851Prevents
852.Nm
853from scheduling anything else on the same host after it starts building.
854.\".It Ar memoryhog
855.It Ar nojunk
856Port that hardcodes includes in its Makefile mechanisms.
857Prevents
858.Ar junk
859from running while port is building.
860.It Ar parallel
861Port that can be built in parallel, uses
862.Ev MAKE_JOBS
863and several build slots.
864.It Ar parallel2
865Very large port that should be built in parallel, uses
866.Ev MAKE_JOBS
867and lots of build slots.
868.It Ar tag:kde3
869kde3 port that conflicts with kde4 ports.
870Prevent scheduling ports with
871.Ar tag:kde4
872on the same host.
873.It Ar tag:kde4
874kde4 port that conflicts with kde3 ports.
875Prevent scheduling ports with
876.Ar tag:kde3
877on the same host.
878.El
879.Sh THE SECURITY MODEL OF DPB
880When
881.Nm
882is run as root, it uses a privilege drop model instead of the
883dangerous privilege elevation model of
884.Xr doas 1 .
885When run as root, by default,
886.Ar _pbuild
887is used as the build and log user, and
888.Ar _pfetch
889is used as the fetch user.
890.Bl -bullet
891.It
892Start
893.Nm
894as root.
895.It
896.Nm
897will drop privileges for every operation except
898.Xr pkg_add 1 ,
899.Xr pkg_delete 1
900and the
901.Ar STARTUP
902script.
903.It
904For cluster builds,
905provide an
906.Xr ssh 1
907connection to distant hosts from root as root.
908.It
909.Ar build_user
910is used to build stuff locally or distantly (can be per-host), using:
911.Li chroot -u build_user /build_root
912(with
913.Pa /build_root
914=
915.Pa /
916if there is no actual chroot needed).
917It must have read access to ${DISTDIR} and ${PORTSDIR}, and write
918access to ${WRKOBJDIR}, ${PACKAGE_REPOSITORY}, and ${PLIST_REPOSITORY}.
919It does not require network access.
920.It
921.Ar LOG_USER
922is used to open all log files.
923.Ar LOG_USER
924only needs to exist locally.
925It needs write access to the log directories, including
926${DISTDIR}/build-stats.
927It does not need network access.
928.It
929.Ar FETCH_USER
930is used to fetch distfiles and handle corresponding log info.
931It needs write access to ${DISTDIR}, and network access.
932Thus,
933.Xr ftp 1
934does not happen as root.
935.It
936.Ar _dpb
937is used as a fail-safe for any other activities that do not require any rights.
938.It
939.Nm
940creates local directories as root, then gives them to the appropriate user.
941.El
942.Sh LOCKS AND ERRORS
943.Nm
944still uses the normal ports tree mechanism while building, which includes
945.Ev LOCKDIR .
946When starting up
947.Nm
948will normally detect stale locks from old dpb runs, and remove them.
949If this does not happen, builds will stay stuck in their initial stage,
950that is:
951.Ar show-prepare-results , patch , build
952depending on the port.
953A telltale message
954.Sq Awaiting lock ...
955can be found in the corresponding logfile
956.Pa paths/pkgpath.log
957.Pp
958In addition, when building a package,
959.Nm
960produces a lockfile in the locks directory, whose name is deduced from
961the basic pkgpath with slashes replaced by dots.
962This lockfile is filled with such info as the build start time or the host,
963or the needed dependencies for this pkgpath.
964.Pp
965The lockfile will also contain the name of a parent pkgpath, for paths that
966were discovered as dependencies.
967This is particularly useful for bogus paths, where it would be hard to
968know where the path came from otherwise.
969.Pp
970At the end of a successful build, these lockfiles are removed.
971The lock will stay around in case of errors.
972.Po
973raw
974value from
975.Xr wait 2
976.Pc ,
977and the name of the next task in the build pipeline (with todo=<nothing>
978in case of failure during clean-up).
979Normal list of tasks is:
980.Ar depends prepare fetch patch configure build fake package clean .
981.Pp
982At the end of each job,
983.Nm
984rechecks the locks directory for existing lockfiles.
985If some locks have vanished,
986it will put the corresponding paths back in the queue and attempt
987another build.
988.Pp
989This eases manual repairs: if a package does not build, the user can look
990at the log, go to the port directory, fix the problem, and then remove the lock.
991.Nm
992will pick up the ball and keep building without interruption.
993.Pp
994It is perfectly safe to run several
995.Nm
996in parallel on the same machine.
997This is not optimal, since each
998.Nm
999ignores the others, and only uses the lock info to avoid the other's
1000current work, but it can be handy: in an emergency, one can start a second
1001.Nm
1002to obtain a specific package right now, in parallel with the original
1003.Nm .
1004.Pp
1005Note that
1006.Nm
1007is very careful not to run two builds from the same pkgpath at the
1008same time, even on different machines:
1009in some cases, MULTI_PACKAGES and FLAVOR combinations may lead to the
1010same package being built simultaneously, and since the package repository
1011is shared, this can easily lead to trouble.
1012.Pp
1013Handling of shared log files and history is also done very carefully by
1014systematically appending to files or using atomic mv operations.
1015.Pp
1016For obvious reasons, this won't work as well with masters running on distinct
1017machines sharing their logs through NFS.
1018.Ss BUILD CYCLES
1019There are some various interdependencies in package builds that can be hard
1020to trace in case something goes wrong.
1021Refer to
1022.Pa summary.log
1023to fix those specific issues.
1024.Sh AFFINITY
1025.Nm
1026now maintains a list of pkgpath-per-host that are currently building in the
1027.Pa affinity
1028directory of its log directory, along with building-in-memory status.
1029.Pp
1030That information is only wiped out when a given build finishes successfully.
1031.Pp
1032Otherwise
1033.Nm
1034will try to restart that build on the same host, which can be handy if you
1035interrupt
1036.Nm
1037while it is building a large port, or if you remove a lock after fixing a
1038problem.
1039.Sh TAGS FOR BUILDING KDE
1040Currently, kde3 and kde4 can't be built simultaneously.
1041Conflicting ports have been annotated with
1042DPB_PROPERTIES=tag:kde3 ,
1043DPB_PROPERTIES=tag:kde4
1044respectively.
1045.Pp
1046.Nm
1047now keeps track of those tags, and will postpone ports with the wrong
1048tag while a given host is used by the other tag.
1049.Pp
1050This heavily relies on the
1051.Ar junk
1052stage to clean-up hosts periodically,
1053and it can even forcibly provoke a
1054.Ar junk
1055stage even if junk=0.
1056.Pp
1057This
1058.Sq force-junk
1059stage is actually implemented as a pseudo path called
1060.Ar junk-proxy ,
1061which only does junk.
1062.Pp
1063In order for builds to proceed gracefully, machines should start
1064in a clean slate, without kde3 or kde4 installed.
1065.Pp
1066As a special-case, failing ports with a kde3 or kde4 tag will not
1067interfere with clean-up, so that hosts do not get locked down to
1068a specific tag.
1069This also means that their dependencies
1070may vanish before human intervention addresses the problem.
1071.Pp
1072This is supposed to be a temporary hack, as kde4 is large and
1073having official packages helps a great deal in debugging it.
1074.Sh EXTERNAL CONTROL
1075If
1076.Fl D Ar CONTROL Ns = Ns Ar path
1077if used,
1078.Nm
1079will create a Unix socket at the given
1080.Pa path ,
1081only accessible by
1082.Ar LOG_USER ,
1083that can accept a few commands, e.g.,
1084usable as
1085.Li nc -U path
1086.Pp
1087Currents commands are as follows:
1088.Bl -tag -offset aaaa -width addhost
1089.It Cm addhost Ar hostline
1090Add a new host
1091.It Cm addpath Ar fullpkgpath ...
1092Add new fullpkgpath to scan
1093.It Cm bye
1094close the socket connection.
1095.It Cm dontclean Ar pkgpath ...
1096Add new pkgpath to list of paths that should not be cleaned after build
1097.It Cm help
1098Self explanatory
1099.It Cm stats
1100Show the current stats line
1101.It Cm status Ar fullpkgpath ...
1102Show the current status of fullpkgpath, whether it's built, installable,
1103ready to build, to build later, along with current dependencies if
1104applicable.
1105.It Cm wipe Ar fullpkgpath ...
1106Wipe out an existing lock: clean up the corresponding
1107.Ar fullpkgpath
1108on the appropriate host, then remove all lock and affinity info pertaining
1109to the port.
1110.El
1111.Sh SHUTTING DOWN GRACEFULLY
1112.Nm
1113periodically checks for a file named
1114.Pa stop
1115in its log directory.
1116If this file exists, then it won't start new jobs, and shutdown when
1117the current jobs are finished unless
1118.Fl q .
1119.Pp
1120.Nm
1121also checks for files named
1122.Pa stop-<hostname>
1123in its log directory.
1124If such a file exists, then it won't start new jobs on
1125the corresponding machine.
1126.Sh FILES
1127Apart from producing packages,
1128.Nm
1129may create temporary files as
1130.Pa ${FULLDISTDIR}/${DISTFILE}.part .
1131.Pp
1132In fetch mode
1133.Po
1134.Fl f
1135and
1136.Fl F
1137.Pc ,
1138.Nm
1139populates
1140.Pa ${DISTDIR}/by_cipher/sha256
1141with links.
1142It also uses
1143.Pa ${DISTDIR}/distinfo
1144and
1145.Pa ${DISTDIR}/history
1146as a
1147.Sq permanent log :
1148.Bl -tag -width distinfo
1149.It distinfo
1150cache of distfiles checksum.
1151Contains all
1152.Xr sha256 1
1153checksums of known files under
1154.Pa ${DISTDIR} .
1155Fetching uses this to avoid re-checksumming known files.
1156.It history
1157Log of old files under distinfo.
1158After successfully scanning a full ports tree
1159.Po
1160.Nm Fl a
1161.Pc ,
1162the fetch engine knows precisely which files are needed by the build
1163(and their checksums).
1164Anything that is
1165.Bl -bullet
1166.It
1167recorded in distinfo but unneeded
1168.It
1169recorded in distinfo but with the wrong checksum
1170.It
1171not recorded in distinfo, but not needed
1172.El
1173will be entered at the end of history as a line:
1174.Pp
1175.Li ts SHA256 (file) = value
1176.Pp
1177with
1178.Ar ts
1179a timestamp from Unix epoch.
1180.Pp
1181When cleaning up old files, with a tool such as
1182.Xr clean-old-distfiles 1 ,
1183it is vital to check both the checksum and
1184the file name: since mirroring stores permanent links under
1185.Pa by_cipher ,
1186files which are still needed will appear in history under their old
1187checksums, as an indication the link should be removed, but possibly not
1188the file itself.
1189.El
1190.Pp
1191If
1192.Pa ${DISTDIR}
1193ever becomes corrupted,
1194removing
1195.Pa ${DISTDIR}/distinfo
1196will force
1197.Nm
1198into checking all files again.
1199.Pp
1200All those files belong to the
1201.Ar FETCH_USER
1202if it is defined.
1203They should be readable for the
1204.Ar build_user .
1205.Pp
1206.Nm
1207also records rolling build statistics under
1208.Pa ${DISTDIR}/build-stats/${ARCH} ,
1209and uses them automatically in the absence of
1210.Fl b Ar logfile .
1211That file belongs to the
1212.Ar LOG_USER
1213if it is defined.
1214.Pp
1215If
1216.Fl s
1217is used, size information for successful builds will be recorded under
1218.Pa ${DISTDIR}/build-stats/${ARCH}-size
1219.Po
1220by default, location adjustable with
1221.Fl S Ar sizelog
1222.Pc .
1223This is then reused for the mfs threshold option.
1224That file also belongs to the
1225.Ar LOG_USER
1226if it is defined.
1227.Pp
1228.Nm
1229also maintains a list of pkgpath frequencies
1230.Pa ${DISTDIR}/build-stats/${ARCH}-dependencies ,
1231filled at end of LISTING if
1232.Fl a .
1233This list will be automatically reused when restarting a build:
1234a quick LISTING of the most important dependencies will happen
1235before the general LISTING,
1236in order to prime further LISTING steps with most common ports first.
1237.Pp
1238.Nm
1239will also create a large number of log files under
1240.Pa ${PORTSDIR}/logs/${ARCH} ,
1241which will belong
1242to
1243.Ar LOG_USER
1244if it is defined:
1245.Bl -tag -width engine.log
1246.It Pa affinity/
1247Affinity information.
1248One file per full pkgpath, with slash replaced by dots
1249like so:
1250.Pa affinity/lang.ghc,-main .
1251.It Pa affinity.log
1252On startup
1253.Nm
1254reads existing affinity information, and records it in that log,
1255together with its pid.
1256This log just exists to verify, along with
1257.Pa engine.log ,
1258whether correct affinity was heeded.
1259.It Pa awaiting-locks.log
1260This is purely for gathering performance statistics, about how much
1261lock contention happened around
1262.Xr pkg_add 1
1263and
1264.Xr pkg_delete 1
1265usage.
1266Plotting cumulated time may help in fine-tuning squiggles parameters.
1267.It Pa build.log
1268Actual build log.
1269Each line summarizes build of a single pkgpath, as:
1270.Sq pkgpath host time logsize (detailed timing)[!]
1271where time is the actual build time in seconds, host is the machine name
1272where this occurred, logsize is the corresponding log file size,
1273and a ! is appended in case the build didn't succeed.
1274.Pp
1275The detailed timing info gives a run-down of the build, with clean, fetch,
1276prepare, patch (actually extract+patch), configure, build, fake, package, clean
1277detailed timing info.
1278Note that the actual build time starts at
1279.Sq extract
1280and finishes at
1281.Sq package .
1282.It Pa concurrent.log
1283Shows the actual concurrency achieved as a result of job starvation /
1284parallel handling.
1285Only gets a new line when the value changes: pid timestamp jobs
1286.It Pa debug.log
1287contains various information related to the main engine spinning (RTFS, haven't
1288figured that one yet) along with the more useful warning and die traces that
1289happen when something wrong occurs.
1290Especially useful for the warning messages that tend to be overwritten by
1291subsequent displays.
1292Will also contain error messages pertaining to failure at parsing existing
1293lock files.
1294.It Pa dist/<distfile>.log
1295Log of the
1296.Xr ftp 1
1297process(es) that attempted to fetch the distfile.
1298.It Pa dump.log
1299A long log file generated at the end of build that yields any information
1300pertinent to ports still in the
1301.Sq to build
1302and the
1303.Sq built
1304queues.
1305See also
1306.Pa summary.log
1307for an expurged version of same.
1308.It Pa engine.log
1309Build engine log.
1310Each line corresponds to a state change for a pkgpath and starts with the pid
1311of
1312.Nm ,
1313plus a timestamp of the log entry.
1314.Bl -tag -width BB:
1315.It ^
1316pkgpath temporarily put aside, because a job is running in the same directory.
1317.It !
1318pkgpath ignored, either directly, or indirectly because a dependency was
1319ignored.
1320End of the line states reason why ignored.
1321.It A
1322affinity mismatch: path considered for build, but not the right host,
1323followed by the affinity information.
1324.It B
1325pkgpath built / distfile found.
1326.It C
1327forcible clean-up before building a port with a kde tag.
1328.It E
1329error in build or fetch.
1330.It F
1331distfile queued for download.
1332.It H
1333package still not found due to nfs on this run.
1334.It I
1335pkgpath can be installed.
1336.It J
1337job to build pkgpath started.
1338Also records the host used for the build.
1339.It K
1340kde mismatch, no build until host has been cleaned up.
1341.It L
1342job did not start, existing lock detected.
1343.It N
1344job did not finish.
1345The host may have gone down.
1346.It P
1347built package is no longer required for anything.
1348.It Q
1349pkgpath queued as buildable whenever a slot is free.
1350.It T
1351pkgpath to build / distfile to download.
1352.It V
1353pkgpath put back in the buildable queue, after job that was running in
1354the same directory returned.
1355.It X
1356only happens when rescanning after an error.
1357The engine temporarily locks paths that are incomplete (detained).
1358These will be kept in a separate list for later examination until the
1359end of the new scan.
1360.It x
1361only happens when rescanning after an error.
1362Releases a path for building after the new scan is finished.
1363.It Y
1364affinity mismatch, but job will start on the wrong host anyways, as the queue
1365contains no other buildable path.
1366.El
1367.Pp
1368Please note that the engine is no longer run after each package build event
1369because of performance considerations, so the
1370.Sq Q
1371and
1372.Sq I
1373changes may be delayed by a few
1374.Sq B .
1375.It Pa equiv.log
1376Lists of equivalent pkgpaths for the build, when default flavors and default subpackages have been resolved.
1377.It Pa fetch/bad.log
1378List of URLs that did not lead to a correct distfile, either because
1379they were not responding, or because of incorrect checksums.
1380.It Pa fetch/good.log
1381List of URLs that fetched correctly, along with timing statistics.
1382.It Pa fetch/manually.log
1383List of pkgpaths that require manual intervention, in human-readable form.
1384.It Pa <hostname>.sig.log
1385Complete library signature of the host.
1386.It Pa init.<hostname>.log
1387Captured output of the initialization job for each host.
1388.It Pa junk.log
1389Option
1390.Fl J
1391counts the number of dependencies directly added to decide when to run
1392.Nm pkg_delete Fl a .
1393This file sums up how many ports were built, and how many ports had
1394dependencies each time
1395.Nm
1396decides to junk.
1397.It Pa locks/
1398Directory where locks are created.
1399There are three types of locks:
1400.Bl -bullet
1401.It
1402pkgpath locks for building, where the slash in a pkgpath is replaced
1403with a dot like so:
1404.Pa locks/devel.make
1405to flatten the structure.
1406.It
1407distfile locks for fetching, using the distfile name without the path like so:
1408.Pa locks/distfile.dist .
1409.It
1410host locks for dependency handling and junking, like so:
1411.Pa locks/host:hostname .
1412.El
1413.It Pa packages/pkgname.log
1414one file or symlink per pkgname.
1415.It Pa paths/some/path.log
1416one file or symlink per pkgpath.
1417.It Pa performance.log
1418Some parts of
1419.Nm
1420are computationally intensive, such as the engine runs to determine
1421new stuff that can be built, and the actual display reports.
1422.Pp
1423Both those activities are rate-limited, so that
1424.Nm
1425doesn't run its engine at each new package build,
1426and doesn't update its display every time there is a phase change.
1427.Pp
1428Lines tagged with
1429.Sq ENG
1430correspond to the engine;
1431lines tagged with
1432.Sq REP
1433correspond to the display reports.
1434.Pp
1435Lines ending with a dash
1436.Sq -
1437correspond to new activity that didn't trigger
1438a computation.
1439.Pp
1440Other lines will feature a plus
1441.Sq +
1442for normal runs, or an exclamation point
1443.Sq !
1444for forced runs, followed by two numbers:
1445the next timestamp at which we'll be allowed to run, and
1446a measure of how much time it took to run this pass.
1447.Pp
1448That information is mostly relevant while
1449.Nm
1450is building lots of small packages very quickly.
1451.It Pa signature.log
1452Discrepancies between hosts that prevent them from starting up.
1453.It Pa size.log
1454Size of work directory at the end of each build, built only with
1455.Fl s .
1456.It Pa stats.log
1457Simple log of the B=... line summaries.
1458Mostly useful for making plots and tweaking performance.
1459.It Pa stop
1460Not a logfile at all, but a file created by the user to stop
1461.Nm
1462creating new jobs.
1463.It Pa stop-<hostname>
1464Not a logfile at all, but created by the user to stop hostname creating
1465new jobs.
1466.It Pa summary.log
1467A summary file generated at end of build that lists packages not built
1468or not installable, along with a reason for it.
1469This summarizes packages not built because of existing locks, because of
1470errors, but also because they depend on something that was not built.
1471.Pp
1472In that last case,
1473.Pa summary.log
1474contains a chain of dependencies leading to the problematic package, or
1475in case of build cycles, stopping at the first loop.
1476.It Pa term-report.log
1477Saves all terminal output, so that it can be replayed at hi speed with
1478.Xr dpb-replay 1 .
1479.It Pa vars.log
1480Logs the directories that were walked in the ports tree for dependency
1481information, including the path to a dependency that triggered this
1482particular step.
1483.El
1484.Sh DIAGNOSTICS
1485.Bl -tag -offset aaaa -width truc
1486.It Waiting for hosts to finish STARTUP...
1487Displayed on the console while
1488.Nm
1489is setting up hosts, getting essential data from the ports tree,
1490running a
1491.Ar STARTUP
1492script, collecting base library signatures.
1493.It stuck on <lockfilename>
1494Display on the console when
1495.Nm
1496detects a "frozen" port has happened outside of
1497.Nm Ns 's
1498purview, namely because the ports tree itself has that specific
1499port locked without
1500.Nm Ns 's
1501knowledge.
1502See
1503.Xr bsd.port.mk 5 ,
1504.Xr portlock 1 .
1505.It (Junk lock obtained for <host> at <time>)
1506.It (Junk lock released for <host> at <time>)
1507Printed in a
1508.Pa paths/pkgpath.log
1509file when attempting to get a
1510.Sq junk lock .
1511On a given host, all dependency operations are serialized.
1512The dependency computation itself is handled by the main
1513.Nm
1514process, which needs to know exactly which dependencies are used
1515at a given point, so that
1516.Ar junk
1517can clean up the host correctly.
1518In particular,
1519.Ar junk
1520will not clean up dependencies already scheduled for installation.
1521Ports that do not obtain the lock on first try are put to sleep.
1522.It Received IO
1523Printed in a
1524.Pa paths/pkgpath.log
1525file when woken up before trying attempting to obtain a
1526.Ar junk
1527lock again...
1528.It Woken up <fullpkgpath>
1529Printed in a
1530.Pa paths/pkgpath.log
1531when waking another task by sending it SIGIO,
1532so that it may attempt to obtain the junk lock again.
1533.It (Junk lock failure for <host> at <time>)
1534All ports sleeping for a
1535.Ar junk
1536lock are woken at the same time, so only one of them will obtain the lock,
1537and the others will fail and be put to sleep again.
1538.It Short-cut: depends already handled by <fullpkgpath>
1539Printed in a
1540.Pa paths/pkgpath.log
1541when a port wakes up after others that ran
1542.Xr pkg_add 1 .
1543As
1544.Nm
1545maintains dependencies for a given host globally, it coalesces depends lists
1546together.
1547.It Don't run junk because nojunk in <fullpkgpath>
1548Printed in a
1549.Pa paths/pkgpath.log
1550while evaluating whether to run
1551.Ar junk .
1552Normally,
1553.Ar junk
1554happens at regular intervals, but ports marked
1555.Sq nojunk
1556will delay that.
1557.Nm
1558still keeps track of attempted junks.
1559.It Still tainted: <bool>
1560A host may have a tag (kde3/kde4) that prevents building differently tagged
1561ports.
1562This will be cleansed by
1563.Ar junk
1564eventually.
1565This prints in
1566.Ar path/pkgpath.log
1567to indicate whether this particular
1568.Ar junk
1569will keep the host tainted with a tag or not.
1570.It Forced junk, retainting: <tag>
1571Printed at end of
1572.Ar prepare-results ,
1573when an eventual junk was run even though some ports still hold a tag.
1574.It Can't run junk because of lock on <fullpkgpath>
1575.Ar junk
1576can't happen because
1577.Ar fullpkgpath
1578is locked and is marked
1579.Sq nojunk .
1580.It Avoided depends for <dependencies>
1581As dependencies are handled globally per-host, some ports can avoid
1582.Xr pkg_add 1
1583altogether because another port already installed the correct dependencies.
1584.It SPINNING ON MAIN
1585Printed in
1586.Ar debug.log ,
1587this is an actual bug: the engine said it can build, there are cores available,
1588but
1589.Nm
1590can't start a new build job.
1591.It SPINNING ON FETCH
1592Printed in
1593.Ar debug.log ,
1594this is an actual bug: the engine said it can fetch, there are fetching
1595cores available, but
1596.Nm
1597can't start a new fetch job.
1598.It KILLED: <job> stuck at <somewhere>
1599Printed in
1600.Ar path/pkgpath.log
1601when a port exceeds its timeout.
1602.It !: <path> tried and didn't get it
1603Printed in
1604.Ar engine.log
1605Scanning the port didn't give us useful information.
1606See
1607.Ar vars.log
1608for gory details.
1609.El
1610.Sh BUGS AND LIMITATIONS
1611.Nm
1612performs best with lots of paths to build.
1613When just used to build a few ports, there's a high risk of starvation
1614as there are bottlenecks in parts of the tree.
1615.Pp
1616Fetch jobs don't deal with checksum changes yet:
1617if a fetch fails because of a wrong checksum, if you update the distinfo
1618file and remove the lock,
1619.Nm
1620won't pick it up.
1621.Pp
1622Note that
1623.Nm
1624does not manage installed packages in any intelligent way, it will just
1625call
1626.Xr pkg_add 1
1627during its depend stage to install its dependencies.
1628With
1629.Fl u ,
1630it will call pkg_add -r.
1631With
1632.Fl U ,
1633it will call pkg_add -r -D installed,
1634but there is nothing else going on.
1635This is especially true when using
1636.Fl R ,
1637ensure the machine is clean of possibly older packages first, or run
1638.Nm
1639with
1640.Fl U .
1641.Pp
1642In particular
1643.Fl R
1644and
1645.Fl J
1646together may lead to strange issues.
1647.Pp
1648On heterogeneous networks, calibration of build info and choice of speed
1649factors is not perfect, and somewhat a dark art.
1650Using distinct speed factors on a build log that comes from a single
1651machine works fine, but using the build info coming from several machines
1652does not work all that well.
1653.Pp
1654.Nm
1655should check
1656.Pa /usr/include
1657and
1658.Pa /usr/X11R6/include
1659for consistency, but it doesn't.
1660.Pp
1661When a host fails consistency check, there is not yet a way to re-add it
1662after fixing the problem.
1663You have to stop
1664.Nm ,
1665cleanup and restart.
1666.Pp
1667The default limits in
1668.Pa login.conf
1669are too small for bulk builds on any kind of parallel machines.
1670Bump number of processes, file descriptors, and memory.
1671.Pp
1672Even though
1673.Nm
1674tries really hard to check heterogeneous networks for sanity (checking
1675shared libraries and .la files), it is still dependent on the user to
1676make sure all the hosts build ports the same way.
1677.Pp
1678Make sure your NFS setup is consistent.
1679The ports dir itself should be exported or synchronized.
1680Distfiles, the package repository,  and the plist repository should be exported,
1681but WRKOBJDIR should not be on NFS unless you have absolutely no choice,
1682or if you exhibit deep masochistic tendencies.
1683Pay particular attention to discrepancies in
1684.Pa /etc/mk.conf .
1685.Pp
1686Also,
1687.Nm
1688connects to external hosts through
1689.Xr ssh 1 ,
1690relying on
1691.Xr ssh_config 5
1692for any special cases.
1693.Pp
1694When fetching distfiles,
1695.Nm
1696may freeze and spin in a tight loop while the last distfiles are being fetched.
1697This is definitely a bug, which has been around for quite some time, which
1698is a bit difficult to reproduce, and hasn't been fixed yet.
1699So if
1700.Nm
1701stops updating its display right around the end of fetch, you've hit the bug.
1702Just kill
1703.Nm
1704and restart it.
1705.Sh SEE ALSO
1706.Xr clean-old-distfiles 1 ,
1707.Xr dpb-replay 1 ,
1708.Xr proot 1 ,
1709.Xr pkgpath 7
1710.Sh HISTORY
1711The original
1712.Nm dpb
1713command was written by Nikolay Sturm.
1714This version is a complete rewrite from scratch using all the stuff
1715we learnt over the years to make it better.
1716.Sh AUTHORS
1717.An Marc Espie Aq Mt espie@openbsd.org
1718