forked from thought-machine/please
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.html
1735 lines (1582 loc) · 53.8 KB
/
config.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<h1 id="config-file-reference" class="title-1">Please config file reference</h1>
<p>
The root of a Please repo is identified by a <code class="code">.plzconfig</code> file.
This also has a number of options to control various parts of its behaviour which might be
useful to tailor it to your environment.
</p>
<p>
Please looks in several locations for these files and builds it up bit by bit.
In order (from lowest priority to highest):
</p>
<ul class="bulleted-list">
<li>
<span><code class="code">/etc/please/plzconfig</code></span>
</li>
<li>
<span><code class="code">~/.config/please/plzconfig</code></span>
</li>
<li>
<span><code class="code">.plzconfig</code></span>
</li>
<li>
<span
><code class="code">.plzconfig_<arch></code> (e.g.
<code class="code">.plzconfig_linux_amd64</code>)</span
>
</li>
<li>
<span>
<code class="code">.plzconfig.*</code> read from <code class="code">--profile</code>
(e.g. <code class="code">--profile=remote</code>)</span>
</li>
<li>
<span><code class="code">.plzconfig.local</code></span>
</li>
</ul>
<p>
Profile-specific config files can be defined and take precedence over the config file being
evaluated. Except <code class="code">.plzconfig.local</code> which always has highest precedence.
This is achieved by having a sibling config file with the name ending with the
profile name (i.e. <code class="code" >.plzconfig.remote</code>, <code class="code"
>.plzconfig_linux_amd64.remote</code>, etc.) and running the command with the
<code class="code">--profile</code> flag set (ie. <code class="code">--profile=remote</code>).
</p>
<p>
One would normally check in <code class="code">.plzconfig</code> (and
arch-specific equivalents if needed).<br />
<code class="code">/etc/please/plzconfig</code> is there to facilitate
per-machine config in cases where the repo is often deleted - this is quite
common in CI systems.<br />
Finally you normally add <code class="code">.plzconfig.local</code> to
.gitignore to allow people to override settings locally if needed.
</p>
<p>
The file format is very similar to
<a
class="copy-link"
href="https://git-scm.com/docs/git-config#_syntax"
target="_blank"
rel="noopener"
>Git's config</a
>; it's broken into sections by headers in square brackets, and each section
contains <code class="code">option = value</code> pairs. Comments start with a
semicolon.
</p>
<p>
We'll list out the various options by section. The option names are all
case-insensitive, the values are of course case sensitive (except in the case
of boolean variables which accept various forms of
<code class="code">true</code>, <code class="code">false</code>,
<code class="code">yes</code>, <code class="code">no</code>, etc).<br />
Various parameters can be repeated (they're noted as such below); this means
passing them multiple times in their entirety, e.g.
</p>
<pre class="code-container">
<!-- prettier-ignore -->
<code>
buildfilename = BUILD
buildfilename = BUILD.plz
</code>
</pre>
<p>Comma-separating on the same line won't generally work.</p>
<section class="mt4">
<h2 id="please" class="title-2">[Please]</h2>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.version">Version</h3>
<p>
Defines the version of plz that this repo is supposed to use
currently. If it's not present or the version matches the currently
running version no special action is taken; otherwise if
<code class="code">SelfUpdate</code> is set Please will attempt to
download an appropriate version, otherwise it will issue a warning and
continue.
</p>
<p>
Note that if this is not set, you can run
<code class="code">plz update</code> to update to the latest version
available on the server.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.versionchecksum">VersionChecksum</h3>
<p>
Defines a hex-encoded sha256 checksum that the downloaded version must
match. Can be specified multiple times to support different
architectures.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.location">Location</h3>
<p>
Defines the directory Please is installed into.<br />
Defaults to <code class="code">~/.please</code> but you might want it
to be somewhere else if you're installing via another method.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.selfupdate">
SelfUpdate <span class="normal">(bool)</span>
</h3>
<p>
Sets whether plz will attempt to update itself when the version set in
the config file is different.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.downloadlocation">DownloadLocation <span class="normal">(bool)</span></h3>
<p>
Defines the location to download Please from when self-updating.
Defaults to the Please web server (<a
class="copy-link"
href="https://get.please.build"
target="_blank"
rel="noopener"
>https://get.please.build</a
>), but you can point it to some location of your own if you prefer to
keep traffic within your network or use home-grown versions.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title">Nonce</h3>
<p>
This is an arbitrary string that is added to the hash of every build
target. It provides a way to force a rebuild of everything when it's
changed.<br />
We will bump the default of this whenever we think it's required -
although it's been a pretty long time now and we hope that'll
continue.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.numthreads">
NumThreads <span class="normal">(int)</span>
</h3>
<p>
Number of parallel build operations to run.<br />
Is overridden by the equivalent command-line flag, if that's passed.
Defaults to the number of CPUs plus two.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.defaultrepo">DefaultRepo</h3>
<p>
Location of the please repo to use by default, if not already in a please repo.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.pluginrepo">PluginRepo <span class="normal">(repeated string)</span></h3>
<p>
{{ index .ConfigHelpText "please.pluginrepo" }}
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.autoclean">Autoclean <span class="normal">(b ool)</span></h3>
<p>
Automatically clean stale versions without prompting. Defaults to true.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.numoldversions">NumOldVersions <span class="normal">(int)</span></h3>
<p>
The number of old versions to keep. Defaults to 10.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.toolsurl">ToolsUrl</h3>
<p>
{{ index .ConfigHelpText "please.toolsurl" }}
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="please.motd">MOTD</h3>
<p>
{{ index .ConfigHelpText "please.motd" }}
</p>
</div>
</li>
</ul>
</section>
<section class="mt4">
<h2 id="parse" class="title-2">[Parse]</h2>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.buildfilename">
BuildFileName <span class="normal">(repeated string)</span>
</h3>
<p>
Sets the names that Please uses for its build files. Defaults to
<code class="code">BUILD</code>.<br />
For clarity the documentation refers to them simply as BUILD files but
you could reconfigure them here to be something else.<br />
One case this can be particularly useful is in cases where you have a
subdirectory named
<code class="code">build</code> on a case-insensitive file system like
HFS+.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.blacklistdirs">
BlacklistDirs <span class="normal">(repeated string)</span>
</h3>
<p>
Directories to blacklist when recursively searching for BUILD files
(e.g. when using <code class="code">plz build ...</code> or
similar).<br />
This is generally useful when you have large directories within your
repo that don't need to be searched, especially things like
<code class="code">node_modules</code> that have come from external
package managers.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.experimentaldir">
ExperimentalDir <span class="normal">(repeated string)</span>
</h3>
<p>
Directory containing experimental code. This is subject to some extra
restrictions:
</p>
<ul class="bulleted-list">
<li>
<span>
Code in the experimental dir can override normal visibility
constraints
</span>
</li>
<li>
<span>
Code outside the experimental dir can never depend on code inside
it
</span>
</li>
<li>
<span>Tests are excluded from general detection</span>
</li>
</ul>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.preloadbuilddefs">
PreloadBuildDefs <span class="normal">(repeated string)</span>
</h3>
<p>
Files to preload by the parser before loading any BUILD files.<br />
Since this is done before the first package is parsed they must be
files in the repository, they cannot be
<code class="code">subinclude()</code> paths.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.preloadsubincludes">
PreloadSubincludes <span class="normal">(repeated string)</span>
</h3>
<p>
Subinclude targets to preload by the parser before loading any BUILD files.<br/>
Subincludes can be slow so it's recommended to use PreloadBuildDefs where possible.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.builddefsdir">
BuildDefsDir <span class="normal">(repeated string)</span>
</h3>
<p>
Tells Please about any directories that contain custom build definitions. These are used by `plz help` to
provide help text for build rules that are not built in. Defaults to <code>build_defs</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.numthreads">
NumThreads <span class="normal">(int)</span>
</h3>
<p>
The number of threads to use while parsing the build graph. Default is the number of CPU threads + 2.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="parse.gitfunctions">GitFunctions</h3>
<p>
Activates built-in functions git_branch, git_commit, git_show and git_state. If disabled they will not be usable at parse time. Defaults to true.
</p>
</div>
</li>
</ul>
</section>
<section class="mt4">
<h2 id="plugindefinition" class="title-2">[PluginDefinition]</h2>
<p class="red">
This feature is still experimental; some aspects may not work fully or at all
just yet. Proceed with caution!
</p>
<p>Used in repos that implement a Please plugin. By adding this section to your <code class="code">.plzconfig</code>,
your project can be included as a plugin in other Please repos.
</p>
<p>The following sets up a plugin with ID foo.</p>
<pre class="code-container">
<!-- prettier-ignore -->
<code>
[PluginDefinition]
Name = foo
[PluginConfig "foo_tool"]
ConfigKey = FooTool
; It is resolved relative to the subrepo for this plugin
DefaultValue = //tools:foo
</code>
</pre>
<p>Another Please repo can then override these values as such:</p>
<pre class="code-container">
<!-- prettier-ignore -->
<code>
[Plugin "foo"]
FooTool = foo_tool
</code>
</pre>
<p>This config value is then available to the build definitions as <code class="code">CONFIG.FOO.FOO_TOOL</code>.</p>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="plugindefinition.description">
Description <span class="normal">(string)</span>
</h3>
<p>
A description of the plugin. If set, this can be read and output by
<code class="code">plz help <plugin></code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="plugindefinition.builddefsdir">
BuildDefsDir <span class="normal">(repeatable string)</span>
</h3>
<p>
Tells Please about any directories in the plugin that contain custom
build definitions. These are used by <code class="code">plz help <plugin></code> to provide
help text for build rules that are not built in. Defaults to <code class="code">build_defs</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="plugindefinition.documentationsite">
DocumentationSite <span class="normal">(string)</span>
</h3>
<p>
A link to where the plugin's documentation is hosted.
</p>
</div>
</li>
</section>
<section class="mt4">
<h2 id="pluginconfig" class="title-2">[PluginConfig "config_key"]</h2>
<p class="red">
This feature is still experimental; some aspects may not work fully or at all
just yet. Proceed with caution!
</p>
<p>Used in conjunction with <a href="#plugindefinition" class="copy-link">[PluginDefinition]</a> to define configuration
values for a plugin.
</p>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.configkey">
ConfigKey
</h3>
<p>
The key consumers of this plugin will use to set this value in their
<a href="#plugin" class="copy-link">[Plugin]</a> section.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.defaultvalue">
DefaultValue
</h3>
<p>
The default value for this config value, if any.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.optional">
Optional <span class="normal">(bool)</span>
</h3>
<p>
If true, this config value may be empty.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.repeatable">
Repeatable <span class="normal">(bool)</span>
</h3>
<p>
If true, this config value may be repeated.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.inherit">
Inherit <span class="normal">(bool)</span>
</h3>
<p>
If true, this config value will always be inherited by the parent repo, when this repo is a subrepo.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.type">Type</h3>
<p>
The type of this config value. The options are <code class="code">str</code>, <code class="code">int</code>,
or <code class="code">bool</code>. Defaults to <code class="code">str</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="pluginconfig.help">Help</h3>
<p>
A help string describing what this config property does.
</p>
</div>
</li>
</ul>
</section>
<section class="mt4">
<h2 id="plugin" class="title-2">[Plugin "plugin-id"]</h2>
<p class="red">
This feature is still experimental; some aspects may not work fully or at all
just yet. Proceed with caution!
</p>
<p>This section can be used to define configuration specific to a plugin identified by its ID.</p>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="plugin.target">
Target <span class="normal">(build label)</span>
</h3>
<p>{{ index .ConfigHelpText "plugin.target" }}</p>
</div>
</li>
</ul>
</section>
<section class="mt4">
<h2 id="display" class="title-2">[Display]</h2>
<p>
Contains options relating to display output. These have no impact on build
output.
</p>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="display.updatetitle">
UpdateTitle <span class="normal">(bool)</span>
</h3>
<p>
Whether to update the window title as things are built. This is off by
default because while many Linux shells will reset it afterwards,
others won't and it's not ideal for us to leave it messed up.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="display.systemstats">
SystemStats <span class="normal">(bool)</span>
</h3>
<p>
Whether or not to show basic system resource usage in the interactive
display. Defaults to <code class="code">False</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="display.colourscheme">ColourScheme</h3>
<p>
Shell colour scheme mode, dark or light. Adapts interactive display
colours to the colour scheme mode. Defaults to
<code class="code">dark</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="display.maxworkers">
MaxWorkers <span class="normal">(int)</span>
</h3>
<p>{{ index .ConfigHelpText "display.maxworkers" }}</p>
</div>
</li>
</ul>
</section>
<section class="mt4">
<h2 id="colours" class="title-2">[Colours]</h2>
<p>{{ index .ConfigHelpText "colours" }}</p>
</section>
<section class="mt4">
<h2 id="build" class="title-2">[Build]</h2>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.arch">Arch</h3>
<p>Architecture to compile for. Defaults to the host architecture.</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.timeout">
Timeout <span class="normal">(int)</span>
</h3>
<p>
Timeout for build operations, in seconds. Defaults to 600 (ten
minutes).
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.path">
Path <span class="normal">(repeated string)</span>
</h3>
<p>
The PATH variable that will be passed to the build processes.<br />
Defaults to <code class="code">/usr/local/bin:/usr/bin:/bin</code> but
of course can be modified if you need to get binaries from other
locations.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.config">Config</h3>
<p>
The build config to use when one is not chosen on the command line.
Defaults to <code class="code">opt</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.fallbackconfig">FallbackConfig</h3>
<p>
The build config to use when one is chosen and a required target does
not have one by the same name. Also defaults to
<code class="code">opt</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.passenv">
PassEnv <span class="normal">(repeated string)</span>
</h3>
<p>
A list of environment variables to pass from the current environment
to build rules. For example
<code class="code">PassEnv = HTTP_PROXY</code>
would copy your HTTP_PROXY environment variable to the build env for
any rules.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.passunsafeenv">
PassUnsafeEnv <span class="normal">(repeated string)</span>
</h3>
<p>
Similar to PassEnv. A list of environment variables to pass from the
current environment to build rules. For example
<code class="code">PassUnsafeEnv = HTTP_PROXY</code> would copy your
HTTP_PROXY environment variable to the build env for any rules. Unlike
PassEnv, environment variable values are not used to calculate build
target hashes.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.lang">Lang</h3>
<p>
Sets the language passed to build rules when building. This can be
important for some tools (although hopefully not many) - we've mostly
observed it with Sass. Defaults to
<code class="code">en_GB.UTF-8</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.downloadlinkable">DownloadLinkable</h3>
<p>
When set, targets with links defined that are built remotely are downloaded. Link definition is usually used
to make artifacts available in certain locations for proper tool integration.
</p>
<p>
Linkable targets are identified by rules with the following labels: <code class="code">link:destination</code>,
<code class="code">hlink:destination</code>, <code class="code">dlink:destination</code>,
<code class="code">dhlink:destination</code> and <code class="code">codegen</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.linkgeneratedsources">LinkGeneratedSources</h3>
<p>
When set, Please will link generated sources back into the source tree. A <code>.gitignore</code> can be
generated with <code>plz generate --update_gitignore .gitignore</code>. This can help with getting Please to
work with IDEs and tooling. This can be set to <code class="code">hard</code> to generate hard links.
</p>
<p>
Generated sources are identified by rules with the <code class="code">codegen</code> label.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.updategitignore">UpdateGitignore</h3>
<p>
When set, Please will update the nearest <code class="code">.gitignore</code> with generated sources
automatically during builds. This must be used in conjunction with LinkGeneratedSources.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.arcattool">ArcatTool</h3>
<p>
Defines the tool used to concatenate files which we use to build
the output of various build rules. Defaults to
<code class="code">arcat</code> (formerly <code class="code">jarcat</code>).<br />
For more information, feel free to purr-use the arcat page
<a class="copy-link" href="https://github.com/please-build/arcat" rel="noopener">here</a>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.xattrs">XAttrs</h3>
<p>{{ index .ConfigHelpText "build.xattrs" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.nonce">Nonce</h3>
<p>{{ index .ConfigHelpText "build.nonce" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.httpproxy">HttpProxy</h3>
<p>{{ index .ConfigHelpText "build.httpproxy" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.hashcheckers">HashCheckers</h3>
<p>{{ index .ConfigHelpText "build.hashcheckers" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.hashfunction">HashFunction</h3>
<p>{{ index .ConfigHelpText "build.hashfunction" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.exitonerror">ExitOnError <span class="normal">(bool)</span></h3>
<p>{{ index .ConfigHelpText "build.exitonerror" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="build.paralleldownloads">ParallelDownloads <span class="normal">(int)</span></h3>
<p>{{ index .ConfigHelpText "build.paralleldownloads" }}</p>
</div>
</li>
</ul>
</section>
<section class="mt4">
<h2 id="buildenv" class="title-2">[BuildEnv]</h2>
<p>
A set of extra environment variables to define for build rules. For example:
</p>
<pre class="code-container">
<!-- prettier-ignore -->
<code>
[buildenv]
secret-passphrase = 12345
</code>
</pre>
<p>
This would become SECRET_PASSPHRASE for any rules. These can be useful for
passing secrets into custom rules; any variables containing SECRET or
PASSWORD won't be logged.
</p>
</section>
<section class="mt4">
<h2 id="sandbox" class="title-2">[Sandbox]</h2>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="sandbox.tool">
Tool
</h3>
<p>
The binary to use for sandboxing build/test actions. Typically this
is <code>please_sandbox</code>, which currently only does anything on Linux.<br />
It receives the program to execute and all its arguments in its <code>argv</code>,
it is expected to do whatever it needs to then <code>exec</code> the real action.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="sandbox.build">
Build <span class="normal">(bool)</span>
</h3>
<p>
Activates sandboxing for build actions, which isolates them
from network access, IPC and the repo-local filesystem. Currently
only works on Linux. Defaults to <code class="code">False</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="sandbox.test">
Test <span class="normal">(bool)</span>
</h3>
<p>
Activates sandboxing for test actions, which isolates them
from network access, IPC and the repo-local filesystem. Currently
only works on Linux. Defaults to <code class="code">False</code>.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="sandbox.dir">
Dir <span class="normal">(repeated string)</span>
</h3>
<p>
Directories that the sandbox tool should mask (it's unspecified how, although mounting an
empty filesystem over the top is the current implementation).<br />
These are passed to the tool itself in the <code>SANDBOX_DIRS</code> env var as a comma-separated list.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="sandbox.namespace">
Namespace <span class="normal">(bool)</span>
</h3>
<p>{{ index .ConfigHelpText "sandbox.namespace" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="sandbox.excludeabletargets">
ExcludeableTargets (repeated build label)
</h3>
<p>
<p>{{ index .ConfigHelpText "sandbox.excludeabletargets" }}. Values can be wildcards, e.g.
<code class="code">//third_party/...</code></p>
</p>
</div>
</li>
</ul>
<p>N.B. On Ubuntu Noble (24.04) or later, sandboxing may fail with a "Permission denied" error (often referring
to <code class="code">/proc/self/setgroups</code>). This is due to a
<a href="https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces">security change</a>
which prohibits unprivileged user namespaces, which the sandboxing relies upon.<br/>
To fix this, you need to create an AppArmor profile allowing it; we have an
<a href="https://github.com/thought-machine/please/blob/master/tools/misc/apparmor_profile">example</a>
for the default install location, which you should copy to <code class="code">/etc/apparmor.d/build.please</code>,
then run <code class="code">sudo systemctl reload apparmor</code> to apply the new profile.</p>
</section>
<section class="mt4">
<h2 id="remote" class="title-2">[Remote]</h2>
<ul class="bulleted-list">
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.url">URL</h3>
<p>
Sets the URL to communicate with the remote server on.<br />
Typically this would look something like
<code class="code">127.0.0.1:8989</code>, i.e. it is given without a
protocol.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.instance">Instance</h3>
<p>
Defines the name of the remote instance to request. Depending on the
server implementation or configuration this may be required; if so it
must be set here to agree with it.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.numexecutors">
NumExecutors <span class="normal">(int)</span>
</h3>
<p>Defines the number of remote executors to use simultaneously.</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.name">Name</h3>
<p>
A name for this worker instance. This is informational only and
attached to artifacts uploaded to remote storage to identify the
original machine that created them.
</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.casurl">CasUrl</h3>
<p>{{ index .ConfigHelpText "remote.casurl" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.asseturl">AssetUrl</h3>
<p>{{ index .ConfigHelpText "remote.asseturl" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.displayurl">DisplayUrl</h3>
<p>{{ index .ConfigHelpText "remote.displayurl" }}</p>
</div>
</li>
<li>
<div>
<h3 class="mt1 f6 lh-title" id="remote.tokenfile">TokenFile</h3>
<p>{{ index .ConfigHelpText "remote.tokenfile" }}</p>
</div>
</li>