1bdep-init(1) General Commands Manual bdep-init(1)
2
3
4
6 bdep-init - initialize project in build configurations
7
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
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
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
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
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 --stdout-format format
201 Representation format to use for printing to stdout.
202
203 --jobs|-j num
204 Number of jobs to perform in parallel.
205
206 --progress
207 Display progress indicators for long-lasting operations, such as
208 network transfers, building, etc.
209
210 --no-progress
211 Suppress progress indicators for long-lasting operations, such
212 as network transfers, building, etc.
213
214 --bpkg path
215 The package manager program to be used for build configuration
216 management.
217
218 --bpkg-option opt
219 Additional option to be passed to the package manager program.
220
221 --build path
222 The build program to be used to build packages.
223
224 --build-option opt
225 Additional option to be passed to the build program.
226
227 --curl path
228 The curl program to be used for network operations.
229
230 --curl-option opt
231 Additional option to be passed to the curl program.
232
233 --pager path
234 The pager program to be used to show long text.
235
236 --pager-option opt
237 Additional option to be passed to the pager program.
238
239 --options-file file
240 Read additional options from file.
241
242 --default-options dir
243 The directory to load additional default options files from.
244
245 --no-default-options
246 Don't load default options files.
247
249 See bdep-default-options-files(1) for an overview of the default op‐
250 tions files. For the init command the search start directory is the
251 project directory. The following options files are searched for in each
252 directory and, if found, loaded in the order listed:
253
254 bdep.options
255 bdep-{config config-add}.options # if --config-add|-A
256 bdep-{config config-add config-create}.options # if --config-create|-C
257 bdep-init.options
258
259 The following init command options cannot be specified in the default
260 options files:
261
262 --directory|-d
263 --config-add|-A
264 --config-create|-C
265 --wipe
266
268 Send bug reports to the users@build2.org mailing list.
269
271 Copyright (c) 2014-2022 the build2 authors.
272
273 Permission is granted to copy, distribute and/or modify this document
274 under the terms of the MIT License.
275
276
277
278bdep 0.15.0 July 2022 bdep-init(1)