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

NAME

6       bdep-init - initialize project in build configurations
7

SYNOPSIS

9       bdep init [options] [pkg-spec] [cfg-spec] [pkg-args]
10       bdep init [options] [prj-spec] --empty|-E
11       bdep init [options] [pkg-spec] --config-add|-A cfg-dir [@cfg-name]
12                 [pkg-args]
13       bdep init [options] [pkg-spec] --config-create|-C cfg-dir [@cfg-name]
14                 [cfg-args] [-- pkg-args]
15
16       cfg-spec = (@cfg-name | --config|-c cfg-dir)... | --all|-a
17       pkg-spec = (--directory|-d pkg-dir)... | prj-spec
18       prj-spec = --directory|-d prj-dir
19       pkg-args = (?pkg | cfg-var)...
20       cfg-args = [-- [bpkg-options]] [--existing|-e | (module | cfg-var)...]
21

DESCRIPTION

23       The  init command initializes a project in one or more build configura‐
24       tions. The first form initializes the specified project packages  (pkg-
25       spec),  or,  if  the  project  itself  is specified (prj-spec), all its
26       available packages, in one or more build configurations (cfg-spec) that
27       have already been associated with the project (bdep-config(1)).
28
29       If  no  project directory is specified, then the current working direc‐
30       tory is assumed. If no configuration is  specified,  then  the  default
31       configuration  is  assumed  (failing if multiple default configurations
32       are present). See bdep-projects-configs(1) for  details  on  specifying
33       projects  and  configurations. Optional pkg-args are the additional de‐
34       pendency packages and/or configuration variables to pass to the  under‐
35       lying bpkg-pkg-build(1) command.
36
37       The  second  form  (--empty  is specified) initializes an empty project
38       database that can later be  used  to  first  add  build  configurations
39       (bdep-config(1))  and  then initialize project packages using the first
40       form.
41
42       The third (--config-add) and fourth (--config-create) forms are  short‐
43       cuts  to  first adding an existing or newly created build configuration
44       and then initializing project packages in that configuration.  Semanti‐
45       cally  they are equivalent to first performing the config add or config
46       create commands (bdep-config(1)), respectively, followed by  the  first
47       form.   Optional  cfg-args  in the fourth form are the additional argu‐
48       ments to the underlying bpkg-cfg-create(1) command. Note that  in  this
49       case  to  specify  pkg-args without specifying cfg-args you have to use
50       two -- separators, for example:
51
52       $ bdep init -C ../prj-gcc @gcc -- -- ?sys:libsqlite3/*
53
54       Configuration variables can be specified  to  only  apply  to  specific
55       packages  in pkg-args using the argument grouping mechanism (bdep-argu‐
56       ment-grouping(1)). Additionally, such packages can be placed into  spe‐
57       cific linked configurations by specifying the configuration with one of
58       the --config* options (or @ notation) using the  same  grouping  mecha‐
59       nism. For example (assuming gcc is linked to common):
60
61       $ bdep init @gcc { @common config.liblarge.extra=true }+ ?liblarge
62

EXAMPLES

64       As an example, consider project prj with two packages, foo and libfoo:
65
66       prj/
67       |-- foo/
68       `-- libfoo/
69
70       The  following  invocations  illustrate  the common init use cases (the
71       current working directory is shown before the shell prompt).
72
73       Create new build configuration in ../prj-gcc, call it gcc, and initial‐
74       ize project packages foo and libfoo in this configuration:
75
76       prj/$ bdep init -C ../prj-gcc @gcc cc config.cxx=g++
77
78       Create  new  build  configuration  in  ../prj-clang using bpkg-cfg-cre‐
79       ate(1). Then add it calling it clang and initialize project package foo
80       in this configuration:
81
82       prj/$ bpkg create -d ../prj-clang cc config.cxx=clang++
83       prj/$ cd foo
84       foo/$ bdep init -A ../../prj-clang @clang
85
86       Initialize project package libfoo in the build configuration clang:
87
88       foo/$ cd ..
89       prj/$ bdep init -d libfoo @clang
90
91       The following set of invocations achieves the same end result but using
92       the bdep-config(1) command to manage configuration.
93
94       Initialize an empty project database:
95
96       prj/$ bdep init --empty
97
98       Create new build configuration in ../prj-gcc, call it gcc:
99
100       prj/$ bdep config create ../prj-gcc @gcc cc config.cxx=g++
101
102       Add existing build configuration in ../prj-clang, call it clang.
103
104       prj/$ bdep config add ../prj-clang @clang
105
106       Initialize project packages foo and libfoo in build configurations  gcc
107       and clang.
108
109       prj/$ bdep init @gcc @clang
110
111       Or, alternatively, in all the build configurations:
112
113       prj/$ bdep init -a
114

INIT OPTIONS

116       --empty|-E
117              Initialize an empty build configuration set.
118
119       --config-add|-A dir
120              Add an existing build configuration dir.
121
122       --config-create|-C dir
123              Create a new build configuration in dir.
124
125       --no-sync
126              Enter  the project into the database but do not initialize it in
127              the build configurations. The  initialization  can  be  finished
128              later with an explicit bdep-sync(1) command.
129
130       --sys-no-query
131              Do  not  query the system package manager for the installed ver‐
132              sions of packages specified with the sys scheme. See the  corre‐
133              sponding bpkg-pkg-build(1) option for details.
134
135       --sys-install
136              Instruct  the  system  package manager to install available ver‐
137              sions of packages specified with the sys scheme that are not al‐
138              ready  installed. See the corresponding bpkg-pkg-build(1) option
139              for details.
140
141       --sys-no-fetch
142              Do not fetch the system package manager metadata before querying
143              for  available  versions  of  packages  specified  with  the sys
144              scheme. See the corresponding bpkg-pkg-build(1) option  for  de‐
145              tails.
146
147       --sys-no-stub
148              Do no require a stub for packages specified with the sys scheme.
149              See the corresponding bpkg-pkg-build(1) option for details.
150
151       --sys-yes
152              Assume the answer to the system package manager prompts is  yes.
153              See the corresponding bpkg-pkg-build(1) option for details.
154
155       --sys-sudo prog
156              The  sudo program to use for system package manager interactions
157              that normally require administrative privileges  (fetch  package
158              metadata,  install  packages,  etc). See the corresponding bpkg-
159              pkg-build(1) option for details.
160
161       --create-host-config
162              Create  a  configuration  for  build-time  dependencies  without
163              prompt (see bdep-sync(1) for details).
164
165       --create-build2-config
166              Create  a  configuration  for  build  system module dependencies
167              without prompt (see bdep-sync(1) for details).
168
169       --type|--config-type typ
170              The type of the configuration being created. By default, config‐
171              uration  of  type  target is created. See bpkg-cfg-create(1) for
172              background on configuration types.
173
174       --default
175              Make the added or created configuration the default.
176
177       --no-default
178              Don't make the first added or created configuration the default.
179
180       --forward
181              Make the added or created configuration forwarded.
182
183       --no-forward
184              Don't make the added or created configuration forwarded.
185
186       --auto-sync
187              Make the added or created configuration  automatically  synchro‐
188              nized.
189
190       --no-auto-sync
191              Don't make the added or created configuration automatically syn‐
192              chronized.
193
194       --existing|-e
195              Initialize a bpkg configuration based on an existing build  sys‐
196              tem configuration.
197
198       --wipe Wipe  the  configuration directory clean before creating the new
199              configuration.
200
201       --all|-a
202              Use all build configurations.
203
204       --config|-c dir
205              Specify the build configuration as a directory.
206
207       --directory|-d dir
208              Assume project/package is in the specified directory rather than
209              in the current working directory.
210
211       --config-name|-n name
212              Specify the build configuration as a name.
213
214       --config-id num
215              Specify the build configuration as an id.
216

COMMON OPTIONS

218       The  common  options are summarized below with a more detailed descrip‐
219       tion available in bdep-common-options(1).
220
221       -v     Print essential underlying commands being executed.
222
223       -V     Print all underlying commands being executed.
224
225       --quiet|-q
226              Run quietly, only printing error messages.
227
228       --verbose level
229              Set the diagnostics verbosity to level between 0 and 6.
230
231       --stdout-format format
232              Representation format to use for printing to stdout.
233
234       --jobs|-j num
235              Number of jobs to perform in parallel.
236
237       --progress
238              Display progress indicators for long-lasting operations, such as
239              network transfers, building, etc.
240
241       --no-progress
242              Suppress  progress  indicators for long-lasting operations, such
243              as network transfers, building, etc.
244
245       --diag-color
246              Use color in diagnostics.
247
248       --no-diag-color
249              Don't use color in diagnostics.
250
251       --bpkg path
252              The package manager program to be used for  build  configuration
253              management.
254
255       --bpkg-option opt
256              Additional option to be passed to the package manager program.
257
258       --build path
259              The build program to be used to build packages.
260
261       --build-option opt
262              Additional option to be passed to the build program.
263
264       --curl path
265              The curl program to be used for network operations.
266
267       --curl-option opt
268              Additional option to be passed to the curl program.
269
270       --pager path
271              The pager program to be used to show long text.
272
273       --pager-option opt
274              Additional option to be passed to the pager program.
275
276       --options-file file
277              Read additional options from file.
278
279       --default-options dir
280              The directory to load additional default options files from.
281
282       --no-default-options
283              Don't load default options files.
284

DEFAULT OPTIONS FILES

286       See  bdep-default-options-files(1)  for  an overview of the default op‐
287       tions files. For the init command the search  start  directory  is  the
288       project directory. The following options files are searched for in each
289       directory and, if found, loaded in the order listed:
290
291       bdep.options
292       bdep-{config config-add}.options                # if --config-add|-A
293       bdep-{config config-add config-create}.options  # if --config-create|-C
294       bdep-init.options
295
296       The following init command options cannot be specified in  the  default
297       options files:
298
299       --directory|-d
300       --config-add|-A
301       --config-create|-C
302       --wipe
303

BUGS

305       Send bug reports to the users@build2.org mailing list.
306
308       Copyright (c) 2014-2023 the build2 authors.
309
310       Permission  is  granted to copy, distribute and/or modify this document
311       under the terms of the MIT License.
312
313
314
315bdep 0.16.0                        June 2023                      bdep-init(1)
Impressum