1bdep-sync(1)                General Commands Manual               bdep-sync(1)
2
3
4

NAME

6       bdep-sync - synchronize project and build configurations
7

SYNOPSIS

9       bdep sync [options] [pkg-spec] [cfg-spec] [pkg-args]
10       bdep sync [options] [pkg-spec] [cfg-spec] --upgrade|-u | --patch|-p
11       bdep sync [options] [pkg-spec] [cfg-spec] [--upgrade|-u | --patch|-p]
12                 dep-spec...
13
14       dep-spec = pkg[/ver]
15       cfg-spec = (@cfg-name | --config|-c cfg-dir)... | --all|-a
16       pkg-spec = (--directory|-d pkg-dir)... | prj-spec
17       prj-spec = --directory|-d prj-dir
18       pkg-args = (pkg | cfg-var)...
19

DESCRIPTION

21       The  sync command synchronizes a project with its build configurations.
22       The first form (no --upgrade or --patch and only pkg-args arguments, if
23       any,  are  specified)  upgrades the project packages to the latest ver‐
24       sion/iteration, adjusts their dependencies according to the latest man‐
25       ifest information, and updates the lockfile.
26
27       If no project or package directory is specified, then the current work‐
28       ing directory is assumed. If no configuration is  specified,  then  the
29       default  configuration  is  assumed.  See  bdep-projects-configs(1) for
30       details on specifying projects and  configurations.  Optional  pkg-args
31       are  the  additional dependency packages and/or configuration variables
32       to pass to the underlying bpkg-pkg-build(1) command.
33
34       The second form (no arguments but either --upgrade or --patch is speci‐
35       fied),  in addition to the first form's functionality, also upgrades or
36       patches immediate (by default or if --immediate|-i is specified) or all
37       (if  --recursive|-r is specified) dependencies of the specified project
38       packages.
39
40       The third form (one or more dep-spec arguments are specified), in addi‐
41       tion to the first form's functionality, also upgrades (by default or if
42       --upgrade is specified) or patches (if --patch is specified) the speci‐
43       fied  dependencies.  If  --immediate|-i or --recursive|-r is specified,
44       then it also upgrades or patches the immediate or all  dependencies  of
45       the  specified dependencies, respectively. Alternative to --upgrade and
46       --patch, the desired upgrade (or downgrade) version  can  be  specified
47       explicitly.
48
49       Note  also  that --immediate|-i or --recursive|-r can only be specified
50       with an explicit --upgrade or --patch.
51

EXAMPLES

53       As an example, consider project prj with two packages, foo and libfoo:
54
55       prj/
56       ├── foo/
57       └── libfoo/
58
59       Assuming foo and libfoo have been initialized in the default build con‐
60       figuration,  the  following  invocations illustrate the common sync use
61       cases (the current working directory is shown before the shell prompt).
62
63       Synchronize foo and libfoo with the default configuration:
64
65       prj/$ bdep sync
66
67       The same (all initialized packages in a project are always synchronized
68       at once):
69
70       prj/$ cd foo
71       foo/$ bdep sync
72
73       Add  a dependency on libx with sync fetching and configuring a suitable
74       version:
75
76       foo/$ edit manifest  # Add 'depends: libx ^1.0.0'
77       foo/$ bdep sync
78
79       Upgrade all the immediate dependencies of foo:
80
81       foo/$ bdep sync -u
82
83       Upgrade all the dependencies of  all  the  initialized  packages  in  a
84       project recursively:
85
86       foo/$ cd ../
87       prj/$ bdep sync -u -r
88
89       Upgrade libx to the latest version:
90
91       prj/$ bdep sync libx
92
93       Upgrade libx and its immediate dependencies to the latest version:
94
95       prj/$ bdep sync -i libx
96
97       Upgrade libx to the latest patch version:
98
99       prj/$ bdep sync -p libx
100
101       Upgrade  libx  and all its dependencies recursively to the latest patch
102       version.
103
104       prj/$ bdep sync -p -r libx
105
106       Upgrade libx to version 1.2.3.
107
108       prj/$ bdep sync libx/1.2.3
109
110       Upgrade libx to version 1.2.3 and patch all  its  dependencies,  recur‐
111       sively:
112
113       prj/$ bdep sync -p -r libx/1.2.3
114

SYNC OPTIONS

116       --upgrade|-u
117              Upgrade dependencies to the latest available version that satis‐
118              fies all the constraints.
119
120       --patch|-p
121              Upgrade dependencies to the latest available patch version  that
122              satisfies all the constraints.
123
124       --immediate|-i
125              Also upgrade or patch immediate dependencies.
126
127       --recursive|-r
128              Also upgrade or patch all dependencies, recursively.
129
130       --fetch|-f
131              Perform the fetch command prior to synchronization.
132
133       --fetch-full|-F
134              Perform the fetch --full command prior to synchronization.
135
136       --yes|-y
137              Don't prompt for confirmation when up/down-grading dependencies.
138
139       --implicit
140              Perform  implicit synchronization. This mode is normally used by
141              other tools  (for  example,  a  build  system  hook)  to  ensure
142              projects and configurations are synchronized. To improve perfor‐
143              mance, especially for the "everything is  already  synchronized"
144              case,  sync  executed in this mode assumes that no configuration
145              flags (see bdep-config(1)) have changed since the last  explicit
146              synchronization.  It  also  does not search for a project in the
147              current working directory – if  any,  its  directory  should  be
148              specified explicitly with --config|-c.
149
150       --all|-a
151              Use all build configurations.
152
153       --config|-c dir
154              Specify the build configuration as a directory.
155
156       --directory|-d dir
157              Assume project/package is in the specified directory rather than
158              in the current working directory.
159
160       --config-name|-n name
161              Specify the build configuration as a name.
162
163       --config-id num
164              Specify the build configuration as an id.
165

COMMON OPTIONS

167       The common options are summarized below with a more  detailed  descrip‐
168       tion available in bdep-common-options(1).
169
170       -v     Print essential underlying commands being executed.
171
172       -V     Print all underlying commands being executed.
173
174       --quiet|-q
175              Run quietly, only printing error messages.
176
177       --verbose level
178              Set the diagnostics verbosity to level between 0 and 6.
179
180       --jobs|-j num
181              Number of jobs to perform in parallel.
182
183       --no-progress
184              Suppress  progress  indicators for long-lasting operations, such
185              as network transfers, building, etc.
186
187       --bpkg path
188              The package manager program to be used for  build  configuration
189              management.
190
191       --bpkg-option opt
192              Additional option to be passed to the package manager program.
193
194       --build path
195              The build program to be used to build packages.
196
197       --build-option opt
198              Additional option to be passed to the build program.
199
200       --curl path
201              The curl program to be used for network operations.
202
203       --curl-option opt
204              Additional option to be passed to the curl program.
205
206       --pager path
207              The pager program to be used to show long text.
208
209       --pager-option opt
210              Additional option to be passed to the pager program.
211
212       --options-file file
213              Read additional options from file.
214
215       --default-options dir
216              The directory to load additional default options files from.
217
218       --no-default-options
219              Don't load default options files.
220

DEFAULT OPTIONS FILES

222       See  bdep-default-options-files(1)  for  an  overview  of  the  default
223       options files. For the sync command the search start directory  is  the
224       project directory, except for the implicit mode for which only the pre‐
225       defined directories  (system,  etc)  are  searched  in.  The  following
226       options  files are searched for in each directory and, if found, loaded
227       in the order listed:
228
229       bdep.options
230       bdep-{sync|sync-implicit}.options # (mode-dependent)
231
232       The following sync command options cannot be specified in  the  default
233       options files:
234
235       --directory|-d
236       --implicit
237       --config|-c
238

ENVIRONMENT

240       The  BDEP_SYNC  environment  variable can be used to suppress automatic
241       synchronization on build system invocation. If  set,  auto-synchroniza‐
242       tion  will  only be performed if the variable's value is true or 1. The
243       ability to suppress auto-synchronization can be useful when  you  don't
244       have usable bdep and/or bpkg.
245
246       To  avoid recursive re-synchronization, the sync command also maintains
247       the BDEP_SYNCED_CONFIGS environment variable. It contains a space-sepa‐
248       rated, "-quoted list of configuration paths that have been or are being
249       synchronized by the current bdep invocation  chain.  The  sync  command
250       examines  this  variable  and silently ignores synchronization requests
251       that have been or are already being performed.
252

BUGS

254       Send bug reports to the users@build2.org mailing list.
255
257       Copyright (c) 2014-2020 the build2 authors.
258
259       Permission is granted to copy, distribute and/or modify  this  document
260       under the terms of the MIT License.
261
262
263
264bdep 0.13.0                        July 2020                      bdep-sync(1)
Impressum