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  configurations  are  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. If no project packages are specified  explicitly,  then  this
39       form  upgrades  or patches dependencies of all the initialized packages
40       in a project.
41
42       The third form (one or more dep-spec arguments are specified), in addi‐
43       tion to the first form's functionality, also upgrades (by default or if
44       --upgrade is specified) or patches (if --patch is specified) the speci‐
45       fied  dependencies.  If  --immediate|-i or --recursive|-r is specified,
46       then it also upgrades or patches the immediate or all  dependencies  of
47       the  specified dependencies, respectively. Alternative to --upgrade and
48       --patch, the desired upgrade (or downgrade) version  can  be  specified
49       explicitly.
50
51       Note  also  that --immediate|-i or --recursive|-r can only be specified
52       with an explicit --upgrade or --patch.
53
54       Configuration variables can be specified  to  only  apply  to  specific
55       packages in pkg-args and dep-spec using the argument grouping mechanism
56       (bdep-argument-grouping(1)). Additionally, packages in pkg-args can  be
57       placed into specific linked configurations by specifying the configura‐
58       tion with one of the --config* options (or @ notation) using  the  same
59       grouping mechanism.
60
61       If  during  synchronization  a build-time dependency is encountered and
62       there is no build configuration of a suitable type associated with  the
63       project,  then  the  user  is  prompted  (unless  the respective --cre‐
64       ate-*-config option is specified) to automatically create such  a  con‐
65       figuration  and  associate  it with the project. See bpkg-cfg-create(1)
66       for background on configuration types.
67

EXAMPLES

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

SYNC OPTIONS

132       --upgrade|-u
133              Upgrade dependencies to the latest available version that satis‐
134              fies all the constraints.
135
136       --patch|-p
137              Upgrade dependencies to the latest available patch version  that
138              satisfies all the constraints.
139
140       --immediate|-i
141              Also upgrade or patch immediate dependencies.
142
143       --recursive|-r
144              Also upgrade or patch all dependencies, recursively.
145
146       --yes|-y
147              Don't prompt for confirmation when up/down-grading dependencies.
148
149       --disfigure
150              Disfigure  project  packages  during synchronization effectively
151              causing their from-scratch reconfiguration.
152
153       --fetch|-f
154              Perform the fetch command prior to synchronization.
155
156       --fetch-full|-F
157              Perform the fetch --full command prior to synchronization.
158
159       --create-host-config
160              Create  a  configuration  for  build-time  dependencies  without
161              prompt.
162
163       --create-build2-config
164              Create  a  configuration  for  build  system module dependencies
165              without prompt.
166
167       --implicit
168              Perform implicit synchronization. This mode is normally used  by
169              other  tools  (for  example,  a  build  system  hook)  to ensure
170              projects and configurations are synchronized. To improve perfor‐
171              mance,  especially  for the "everything is already synchronized"
172              case, sync executed in this mode assumes that  no  configuration
173              flags  (see bdep-config(1)) have changed since the last explicit
174              synchronization. It also does not search for a  project  in  the
175              current  working  directory  –  if  any, its directory should be
176              specified explicitly with --config|-c.
177
178       --all|-a
179              Use all build configurations.
180
181       --config|-c dir
182              Specify the build configuration as a directory.
183
184       --directory|-d dir
185              Assume project/package is in the specified directory rather than
186              in the current working directory.
187
188       --config-name|-n name
189              Specify the build configuration as a name.
190
191       --config-id num
192              Specify the build configuration as an id.
193

COMMON OPTIONS

195       The  common  options are summarized below with a more detailed descrip‐
196       tion available in bdep-common-options(1).
197
198       -v     Print essential underlying commands being executed.
199
200       -V     Print all underlying commands being executed.
201
202       --quiet|-q
203              Run quietly, only printing error messages.
204
205       --verbose level
206              Set the diagnostics verbosity to level between 0 and 6.
207
208       --jobs|-j num
209              Number of jobs to perform in parallel.
210
211       --no-progress
212              Suppress progress indicators for long-lasting  operations,  such
213              as network transfers, building, etc.
214
215       --bpkg path
216              The  package  manager program to be used for build configuration
217              management.
218
219       --bpkg-option opt
220              Additional option to be passed to the package manager program.
221
222       --build path
223              The build program to be used to build packages.
224
225       --build-option opt
226              Additional option to be passed to the build program.
227
228       --curl path
229              The curl program to be used for network operations.
230
231       --curl-option opt
232              Additional option to be passed to the curl program.
233
234       --pager path
235              The pager program to be used to show long text.
236
237       --pager-option opt
238              Additional option to be passed to the pager program.
239
240       --options-file file
241              Read additional options from file.
242
243       --default-options dir
244              The directory to load additional default options files from.
245
246       --no-default-options
247              Don't load default options files.
248

DEFAULT OPTIONS FILES

250       See bdep-default-options-files(1) for an overview of  the  default  op‐
251       tions  files.  For  the  sync command the search start directory is the
252       project directory, except for the implicit mode for which only the pre‐
253       defined  directories  (system,  etc) are searched in. The following op‐
254       tions files are searched for in each directory and, if found, loaded in
255       the order listed:
256
257       bdep.options
258       bdep-{sync|sync-implicit}.options # (mode-dependent)
259
260       The  following  sync command options cannot be specified in the default
261       options files:
262
263       --directory|-d
264       --implicit
265       --config|-c
266

ENVIRONMENT

268       The BDEP_SYNC environment variable can be used  to  suppress  automatic
269       synchronization  on  build system invocation. If set, auto-synchroniza‐
270       tion will only be performed if the variable's value is true or  1.  The
271       ability  to  suppress auto-synchronization can be useful when you don't
272       have usable bdep and/or bpkg.
273
274       To avoid recursive re-synchronization, the sync command also  maintains
275       the BDEP_SYNCED_CONFIGS environment variable. It contains a space-sepa‐
276       rated, "-quoted list of configuration paths that have been or are being
277       synchronized by the current bdep invocation chain. The sync command ex‐
278       amines this variable and silently ignores synchronization requests that
279       have been or are already being performed.
280

BUGS

282       Send bug reports to the users@build2.org mailing list.
283
285       Copyright (c) 2014-2021 the build2 authors.
286
287       Permission  is  granted to copy, distribute and/or modify this document
288       under the terms of the MIT License.
289
290
291
292bdep 0.14.0                      October 2021                     bdep-sync(1)
Impressum