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       --create-host-config
131              Create  a  configuration  for  build-time  dependencies  without
132              prompt (see bdep-sync(1) for details).
133
134       --create-build2-config
135              Create a configuration  for  build  system  module  dependencies
136              without prompt (see bdep-sync(1) for details).
137
138       --type|--config-type typ
139              The type of the configuration being created. By default, config‐
140              uration of type target is created.  See  bpkg-cfg-create(1)  for
141              background on configuration types.
142
143       --default
144              Make the added or created configuration the default.
145
146       --no-default
147              Don't make the first added or created configuration the default.
148
149       --forward
150              Make the added or created configuration forwarded.
151
152       --no-forward
153              Don't make the added or created configuration forwarded.
154
155       --auto-sync
156              Make  the  added or created configuration automatically synchro‐
157              nized.
158
159       --no-auto-sync
160              Don't make the added or created configuration automatically syn‐
161              chronized.
162
163       --existing|-e
164              Initialize  a bpkg configuration based on an existing build sys‐
165              tem configuration.
166
167       --wipe Wipe the configuration directory clean before creating  the  new
168              configuration.
169
170       --all|-a
171              Use all build configurations.
172
173       --config|-c dir
174              Specify the build configuration as a directory.
175
176       --directory|-d dir
177              Assume project/package is in the specified directory rather than
178              in the current working directory.
179
180       --config-name|-n name
181              Specify the build configuration as a name.
182
183       --config-id num
184              Specify the build configuration as an id.
185

COMMON OPTIONS

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

DEFAULT OPTIONS FILES

242       See  bdep-default-options-files(1)  for  an overview of the default op‐
243       tions files. For the init command the search  start  directory  is  the
244       project directory. The following options files are searched for in each
245       directory and, if found, loaded in the order listed:
246
247       bdep.options
248       bdep-{config config-add}.options                # if --config-add|-A
249       bdep-{config config-add config-create}.options  # if --config-create|-C
250       bdep-init.options
251
252       The following init command options cannot be specified in  the  default
253       options files:
254
255       --directory|-d
256       --config-add|-A
257       --config-create|-C
258       --wipe
259

BUGS

261       Send bug reports to the users@build2.org mailing list.
262
264       Copyright (c) 2014-2021 the build2 authors.
265
266       Permission  is  granted to copy, distribute and/or modify this document
267       under the terms of the MIT License.
268
269
270
271bdep 0.14.0                      October 2021                     bdep-init(1)
Impressum