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       --stdout-format format
209              Representation format to use for printing to stdout.
210
211       --jobs|-j num
212              Number of jobs to perform in parallel.
213
214       --progress
215              Display progress indicators for long-lasting operations, such as
216              network transfers, building, etc.
217
218       --no-progress
219              Suppress  progress  indicators for long-lasting operations, such
220              as network transfers, building, etc.
221
222       --bpkg path
223              The package manager program to be used for  build  configuration
224              management.
225
226       --bpkg-option opt
227              Additional option to be passed to the package manager program.
228
229       --build path
230              The build program to be used to build packages.
231
232       --build-option opt
233              Additional option to be passed to the build program.
234
235       --curl path
236              The curl program to be used for network operations.
237
238       --curl-option opt
239              Additional option to be passed to the curl program.
240
241       --pager path
242              The pager program to be used to show long text.
243
244       --pager-option opt
245              Additional option to be passed to the pager program.
246
247       --options-file file
248              Read additional options from file.
249
250       --default-options dir
251              The directory to load additional default options files from.
252
253       --no-default-options
254              Don't load default options files.
255

DEFAULT OPTIONS FILES

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

ENVIRONMENT

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

BUGS

289       Send bug reports to the users@build2.org mailing list.
290
292       Copyright (c) 2014-2022 the build2 authors.
293
294       Permission is granted to copy, distribute and/or modify  this  document
295       under the terms of the MIT License.
296
297
298
299bdep 0.15.0                        July 2022                      bdep-sync(1)
Impressum