github.phpd.cn/thought-machine/please@v12.2.0+incompatible/docs/config.html (about) 1 2 <h1>Please config file reference</h1> 3 4 <p>The root of a Please repo is identified by a .plzconfig file. This also has a number of 5 options to control various parts of its behaviour which might be useful to tailor it 6 to your environment.</p> 7 8 <p>Please looks in several locations for these files and builds it up bit by bit. In order 9 (from lowest priority to highest): 10 <ul> 11 <li>/etc/plzconfig</li> 12 <li>~/.please/plzconfig</li> 13 <li>.plzconfig</li> 14 <li>.plzconfig_<arch> (e.g. .plzconfig_linux_amd64)</li> 15 <li>.plzconfig.local</li> 16 </ul> 17 One would normally check in .plzconfig (and arch-specific equivalents if needed).<br/> 18 /etc/plzconfig is there to facilitate per-machine config in cases where the repo is often 19 deleted - this is quite common in CI systems.<br/> 20 Finally you normally add .plzconfig.local to .gitignore to allow people to override 21 settings locally if needed.</p> 22 23 <p>The file format is very similar to 24 <a href="https://git-scm.com/docs/git-config#_syntax">Git's config</a>; it's broken into 25 sections by headers in square brackets, and each section contains <code>option = value</code> 26 pairs. Comments start with a semicolon.</p> 27 28 <p>We'll list out the various options by section. The option names are all case-insensitive, 29 the values are of course case sensitive (except in the case of boolean variables which accept 30 various forms of <code>true</code>, <code>false</code>, <code>yes</code>, <code>no</code> etc).<br/> 31 Various parameters can be repeated (they're noted as such below); this means passing them 32 multiple times in their entirety, e.g. 33 <pre><code> 34 buildfilename = BUILD 35 buildfilename = BUCK 36 </code></pre> 37 Comma-separating on the same line won't work.</p> 38 39 <h3>[Please]</h3> 40 41 <ul> 42 <li><b>Version</b><br/> 43 Defines the version of plz that this repo is supposed to use currently. If it's not present 44 or the version matches the currently running version no special action is taken; otherwise 45 if <code>SelfUpdate</code> is set Please will attempt to download an appropriate 46 version, otherwise it will issue a warning and continue.<br/><br/> 47 48 Note that if this is not set, you can run <code>plz update</code> to update to the latest 49 version available on the server.</li> 50 51 <li><b>Location</b><br/> 52 Defines the directory Please is installed into.<br/> 53 Defaults to <code>~/.please</code> but you might want it to be somewhere else if you're 54 installing via another method (e.g. the debs and install script still use <code>/opt/please</code>).</li> 55 56 <li><b>SelfUpdate</b> (bool)<br/> 57 Sets whether plz will attempt to update itself when the version set in the config file is 58 different.</li> 59 60 <li><b>DownloadLocation</b><br/> 61 Defines the location to download Please from when self-updating. Defaults to the Please 62 web server, but you can point it to some location of your own if you prefer to keep 63 traffic within your network or use home-grown versions.</li> 64 65 <li><b>BuildFileName</b> (repeated string)<br/> 66 Sets the names that Please uses instead of <code>BUILD</code> for its build files.<br/> 67 For clarity the documentation refers to them simply as BUILD files but you could 68 reconfigure them here to be something else.<br/> 69 One case this can be particularly useful is in cases where you have a subdirectory named 70 <code>build</code> on a case-insensitive file system like HFS+.</li> 71 72 <li><b>BlacklistDirs</b> (repeated string)<br/> 73 Directories to blacklist when recursively searching for BUILD files (e.g. when using 74 <code>plz build ...</code> or similar).<br/> 75 This is generally useful when you have large directories within your repo that don't 76 need to be searched, especially things like <code>node_modules</code> that have 77 come from external package managers.</li> 78 79 <li><b>Lang</b><br/> 80 Sets the language passed to build rules when building. This can be important for some 81 tools (although hopefully not many) - we've mostly observed it with Sass.</li> 82 83 <li><b>Nonce</b><br/> 84 This is an arbitrary string that is added to the hash of every build target. It provides 85 a way to force a rebuild of everything when it's changed.<br/> 86 We will bump the default of this whenever we think it's required - although it's been 87 a pretty long time now and we hope that'll continue.</li> 88 89 <li><b>NumThreads</b> (int)<br/> 90 Number of parallel build operations to run.<br/> 91 Is overridden by the equivalent command-line flag, if that's passed.</li> 92 </ul> 93 94 <h3>[Display]</h3> 95 96 <p>Contains options relating to display output. These have no impact on build output.</p> 97 98 <ul> 99 <li><b>UpdateTitle</b> (bool)<br/> 100 Whether to update the window title as things are built. This is off by default because while 101 many Linux shells will reset it afterwards, others won't and it's not ideal for us to leave 102 it messed up.</li> 103 </ul> 104 105 <h3>[Build]</h3> 106 107 <ul> 108 109 <li><b>Timeout</b> (int)<br/> 110 Timeout for build operations, in seconds. Defaults to 600 (ten minutes).</li> 111 112 <li><b>Path</b> (repeated string)<br/> 113 The PATH variable that will be passed to the build processes.<br/> 114 Defaults to <code>/usr/local/bin:/usr/bin:/bin</code> but of course can be modified if 115 you need to get binaries from other locations.</li> 116 117 <li><b>Config</b><br/> 118 The build config to use when one is not chosen on the command line. Defaults to <code>opt</code>.</li> 119 120 <li><b>FallbackConfig</b><br/> 121 The build config to use when one is chosen and a required target does not have 122 one by the same name. Also defaults to <code>opt</code>.</li> 123 124 <li><b>PassEnv</b> (repeated string)<br/> 125 A list of environment variables to pass from the current environment to build rules. For example 126 <code>PassEnv = HTTP_PROXY</code> 127 would copy your HTTP_PROXY environment variable to the build env for any rules.</li> 128 129 </ul> 130 131 <h3>[Cache]</h3> 132 133 <ul> 134 135 <li><b>Dir</b><br/> 136 Sets the directory to use for the dir cache.<br/> 137 The default is <code>.plz-cache</code>, if set to the empty string the dir cache will 138 be disabled.</li> 139 140 <li><b>DirCacheCleaner</b><br/> 141 The binary to use for cleaning the directory cache.<br/> 142 Defaults to <code>cache_cleaner</code> in the plz install directory.<br/> 143 Can also be set to the empty string to disable attempting to run it - note that this 144 will of course lead to the dir cache growing without limit which may ruin your day 145 if it fills your disk :)</li> 146 147 <li><b>DirCacheHighWaterMark</b> (size)<br/> 148 Starts cleaning the directory cache when it is over this number of bytes.<br/> 149 Can also be given with human-readable suffixes like 10G, 200MB etc.</li> 150 151 <li><b>DirCacheLowWaterMark</b> (size)<br/> 152 When cleaning the directory cache, it's reduced to at most this size.</li> 153 154 <li><b>HttpUrl</b><br/> 155 Base URL of the HTTP cache.<br/> 156 Not set to anything by default which means the cache will be disabled.</li> 157 158 <li><b>HttpWriteable</b> (bool)<br/> 159 If True this plz instance will write content back to the HTTP cache.<br/> 160 By default it runs in read-only mode.</li> 161 162 <li><b>HttpTimeout</b> (int)<br/> 163 Timeout for operations contacting the HTTP cache, in seconds.</li> 164 165 <li><b>RpcUrl</b><br/> 166 Base URL of the RPC cache.<br/> 167 Not set to anything by default which means the cache will be disabled.</li> 168 169 <li><b>RpcWriteable</b> (bool)<br/> 170 If True this plz instance will write content back to the RPC cache.<br/> 171 By default it runs in read-only mode.</li> 172 173 <li><b>RpcTimeout</b> (int)<br/> 174 Timeout for operations contacting the RPC cache, in seconds.</li> 175 176 <li><b>RpcMaxMsgSize</b> (bytes)<br/> 177 Maximum size of a single message that we'll send to the RPC server.<br/> 178 This should agree with the server's limit, if it's higher the artifacts will be rejected.<br/> 179 The value is given as a byte size so can be suffixed with M, GB, KiB, etc.</li> 180 181 </ul> 182 183 <h3>[Test]</h3> 184 185 <ul> 186 <li><b>Timeout</b> (int)<br/> 187 Sets the default timeout length, in seconds, for any test that isn't explicitly given one. 188 Defaults to 600 (10 minutes).</li> 189 190 <li><b>DefaultContainer</b><br/> 191 Sets the default type of containerisation to use for tests that are given 192 <code>container = True</code>.<br/> 193 Currently the only option is "docker" but we intend to add rkt support at some point.</li> 194 </ul> 195 196 <h3>[Cover]</h3> 197 198 <ul> 199 <li><b>FileExtension</b> (repeated string)<br/> 200 Extensions of files to consider for coverage.<br/> 201 Defaults to a reasonably obvious set for the builtin rules including <code>.go</code>, 202 <code>.py</code>, <code>.java</code>, etc.</li> 203 204 <li><b>ExcludeExtension</b> (repeated string)<br/> 205 Extensions of files to exclude from coverage.<br/> 206 Typically this is for generated code; the default is to exclude protobuf extensions like 207 <code>.pb.go</code>, <code>_pb2.py</code>, etc.</li> 208 </ul> 209 210 <h3>[Metrics]</h3> 211 212 <p>Options related to metric collection. Currently the only metrics implementation pushes 213 to a <a href="https://prometheus.io/">Prometheus</a> 214 <a href="https://github.com/prometheus/pushgateway">pushgateway</a> for collection.</p> 215 216 <ul> 217 <li><b>PushGatewayURL</b><br/> 218 The URL of the pushgateway to send metrics to.</li> 219 220 <li><b>PushFrequency</b> (integer)<br/> 221 The frequency, in milliseconds, to push statistics at. Defaults to 100.</li> 222 </ul> 223 224 <h3>[CustomMetricLabels]</h3> 225 226 <p>Describes optional labels to attach to metrics.<br/> 227 For technical reasons this is a separate section to the main metrics options.</p> 228 229 <p>These are defined as key-value pairs, where the key is the label attached to the metric 230 and the value is a command to run on the system that defines the value to attach.<br/> 231 Hence these labels are run once at startup and constant across all build targets.</p> 232 233 <p>For example:<br/> 234 <pre><code>branch = git rev-parse --abbrev-ref HEAD</code></pre> 235 to attach the current git branch to all metrics reported.</p> 236 237 <p>In general it's a good idea not to let the cardinality of your labels become too large, 238 so you might want to filter it to only print whether the user is on master or not.</p> 239 240 <h3>[Docker]</h3> 241 242 <p>Options relating to tests that are run inside Docker containers.</p> 243 244 <ul> 245 <li><b>DefaultImage</b><br/> 246 The default image used for any test that doesn't specify another.</li> 247 248 <li><b>AllowLocalFallback</b> (bool)<br/> 249 If True, will attempt to run the test locally if containerised running fails.</li> 250 251 <li><b>Timeout</b> (int)<br/> 252 Default timeout for Dockerised tests, in seconds. Default is 1200 (twenty minutes).</li> 253 254 <li><b>ResultsTimeout</b> (int)<br/> 255 Timeout to wait when trying to retrieve results from inside the container. Default is 20 seconds.</li> 256 257 <li><b>RemoveTimeout</b> (int)<br/> 258 Timeout to wait when trying to remove a container after running a test. Defaults to 20 seconds.</li> 259 260 <li><b>RunArgs</b> (repeated string)<br/> 261 Arguments passed to <code>docker run</code> when running a test.</li> 262 </ul> 263 264 <h3>[Gc]</h3> 265 266 <p>Options relating to use of <code>plz gc</code>.</p> 267 268 <ul> 269 <li><b>Keep</b> (build label)<br/> 270 Marks targets that gc should always keep. Can include meta-targets such as 271 <code>//test/...</code> and <code>//docs:all</code>.</li> 272 <li><b>KeepLabel</b><br/> 273 Defines a target label to be kept; for example, if you set this to <code>go</code>, 274 no Go targets would ever be considered for deletion.</li> 275 </ul> 276 277 <h3>[Go]</h3> 278 279 <p>Properties that affect how the various Go build rules work.</p> 280 281 <ul> 282 <li><b>GoVersion</b><br/> 283 String identifying the version of the Go compiler.<br/> 284 This is only now really important for anyone targeting versions of Go earlier than 1.5 since 285 some of the tool names have changed (<code>6g</code> and <code>6l</code> 286 became <code>compile</code> and <code>link</code> in Go 1.5).<br/> 287 We're pretty sure that targeting Go 1.4 works; we're not sure about 1.3 (never tried) but 288 1.2 certainly doesn't since some of the flags to <code>go tool pack</code> are different. 289 We assume nobody is terribly bothered about this... 290 </li> 291 292 <li><b>GoRoot</b><br/> 293 If set, will set the GOROOT environment variable appropriately during build actions.</li> 294 295 <li><b>GoPath</b><br/> 296 If set, will set the GOPATH environment variable appropriately during build actions.</li> 297 298 <li><b>TestTool</b><br/> 299 Sets the location of the <code>please_go_test</code> tool that is used to template the test 300 main for <code>go_test</code> rules.</li> 301 302 <li><b>CgoCCTool</b><br/> 303 Sets the location of <code>CC</code> while building <code>cgo_library</code> and <code>cgo_test</code> 304 rules. Defaults to <code>gcc</code></li> 305 </ul> 306 307 <h3>[Python]</h3> 308 309 <p>Properties that affect how the various Python build rules work.</p> 310 311 <ul> 312 <li><b>PipTool</b><br/> 313 The tool that is invoked during <code>pip_library</code> rules. Defaults to, well, <code>pip</code>.</li> 314 315 <li><b>PexTool</b><br/> 316 The tool that's invoked to build pexes. Defaults to <code>please_pex</code> in the install directory.</li> 317 318 <li><b>DefaultInterpreter</b><br/> 319 The interpreter used for <code>python_binary</code> and <code>python_test</code> rules when none is 320 specified on the rule itself. Defaults to <code>python</code> but you could of course set it to 321 <code>pypy</code>.</li> 322 323 <li><b>ModuleDir</b><br/> 324 Defines a directory containing modules from which they can be imported at the top level.<br/> 325 By default this is empty but by convention we define our <code>pip_library</code> rules in 326 <code>third_party/python</code> and set this appropriately. Hence any of those third-party 327 libraries that try something like <code>import six</code> will have it work as they expect, 328 even though it's actually in a different location within the .pex.</li> 329 330 <li><b>DefaultPipRepo</b><br/> 331 Defines a location for a pip repo to download wheels from.<br/> 332 By default <code>pip_library</code> uses PyPI (although see below on that) but you may well want 333 to use this define another location to upload your own wheels to.<br/> 334 Is overridden by the <code>repo</code> argument to <code>pip_library</code>.</li> 335 336 <li><b>UsePyPI</b> (bool)<br/> 337 Whether or not to use PyPI for <code>pip_library</code> rules or not. Defaults to true, if you 338 disable this you will presumably want to set DefaultPipRepo to use one of your own.<br/> 339 Is overridden by the <code>use_pypi</code> argument to <code>pip_library</code>.</li> 340 341 <li><b>WheelNameScheme</b> (string)<br/> 342 Defines a custom templatized wheel naming scheme.<br/> 343 Templatized variables should be surrounded in curly braces within the scheme, and the available options are: <code>url_base</code>, <code>package_name</code>, and <code>version</code>. The default search pattern is <code>{url_base}/{package_name}-{version}-${{OS}}-${{ARCH}}.whl</code> along with a few common variants.</li> 344 </ul> 345 346 <h3>[Java]</h3> 347 348 <p>Properties that affect how the various Java build rules work.</p> 349 350 <ul> 351 <li><b>JavacTool</b><br/> 352 Defines the tool used for the Java compiler. Defaults to <code>javac</code>.</li> 353 354 <li><b>JlinkTool</b><br/> 355 Defines the tool used for the Java linker. Defaults to <code>jlink</code>.</li> 356 357 <li><b>JavaHome</b><br/> 358 Defines the Java home folder.</li> 359 360 <li><b>JarTool</b><br/> 361 Defines the tool used to build a .jar. Defaults to <code>jar</code>.</li> 362 363 <li><b>JarcatTool</b><br/> 364 Defines the tool used to concatenate .jar files which we use to build the output 365 of <code>java_binary</code> and <code>java_test</code>.Defaults to <code>jarcat</code> 366 in the Please install directory.<br/> 367 Any resemblance to 368 <a href="http://4.bp.blogspot.com/_fzolLOGJOn0/TRkl9BFE_4I/AAAAAAAAEGQ/vxs9pwhDCVA/s1600/Cat-Packed.in.Glass.jpg">this</a> 369 or <a href="http://d104xtrw2rzoau.cloudfront.net/wp-content/uploads/2013/06/15806-cat_stuck_jar_27_8_2012.jpg">this</a> 370 is purr-ly coincidental.</li> 371 372 <li><b>PleaseMavenTool</b><br/> 373 Defines the tool used to fetch information from Maven in <code>maven_jars</code> rules.<br/> 374 Defaults to <code>please_maven</code> in the Please install directory.</li> 375 376 <li><b>JUnitRunner</b><br/> 377 Defines the .jar containing the JUnit runner. This is built into all <code>java_test</code> rules 378 since it's necessary to make JUnit do anything useful.<br/> 379 Defaults to <code>junit_runner.jar</code> in the Please install directory.</li> 380 381 <li><b>DefaultTestPackage</b><br/> 382 The Java classpath to search for functions annotated with <code>@Test</code>.</li> 383 384 <li><b>SourceLevel</b> (int)<br/> 385 The default Java source level when compiling. Defaults to 8.</li> 386 387 <li><b>TargetLevel</b> (int)<br/> 388 The default Java bytecode level to target. Defaults to 8.</li> 389 </ul> 390 391 <h3><a name="cpp">[Cpp]</a></h3> 392 393 <p>Properties that affect how the various C++ build rules work.</p> 394 395 <ul> 396 <li><b>CCTool</b><br/> 397 The tool invoked to compile C code. Defaults to <code>gcc</code> but you might 398 want to set it to <code>clang</code>, for example.</li> 399 400 <li><b>CppTool</b><br/> 401 The tool invoked to compile C++ code. Defaults to <code>g++</code> but you might 402 want to set it to <code>clang++</code>, for example.</li> 403 404 <li><b>LdTool</b><br/> 405 The tool invoked to link object files. Defaults to <code>ld</code> but you could 406 also set it to <code>gold</code>, for example.</li> 407 408 <li><b>ArTool</b><br/> 409 The tool invoked to archive static libraries. Defaults to <code>ar</code>.</li> 410 411 <li><b>AsmTool</b><br/> 412 The tool invoked as an assembler. Currently only used on OSX for 413 <code>cc_embed_binary</code> rules and so defaults to <code>nasm</code>.</li> 414 415 <li><b>LinkWithLdTool</b><br/> 416 If true, instructs Please to use the tool set earlier in <code>ldtool</code> 417 to link binaries instead of <code>cctool</code>.<br/> 418 This is an esoteric setting that most people don't want; a vanilla <code>ld</code> 419 will not perform all steps necessary here (you'll get lots of missing symbol messages 420 from having no libc etc). Generally best to leave this disabled.</li> 421 422 <li><b>DefaultOptCflags</b><br/> 423 Compiler flags passed to all C rules during <code>opt</code> builds; 424 these are typically pretty basic things like 425 what language standard you want to target, warning flags, etc.<br/> 426 Defaults to <code>--std=c99 -O3 -DNDEBUG -Wall -Werror</code></li> 427 428 <li><b>DefaultDbgCflags</b><br/> 429 Compiler rules passed to all C rules during <code>dbg</code> builds.<br/> 430 Defaults to <code>--std=c99 -g3 -DDEBUG -Wall -Werror</code>.</li> 431 432 <li><b>DefaultOptCppflags</b><br/> 433 Compiler flags passed to all C++ rules during <code>opt</code> builds; 434 these are typically pretty basic things like 435 what language standard you want to target, warning flags, etc.<br/> 436 Defaults to <code>--std=c++11 -O3 -DNDEBUG -Wall -Werror</code></li> 437 438 <li><b>DefaultDbgCppflags</b><br/> 439 Compiler rules passed to all C++ rules during <code>dbg</code> builds.<br/> 440 Defaults to <code>--std=c++11 -g3 -DDEBUG -Wall -Werror</code>.</li> 441 442 <li><b>DefaultLdFlags</b><br/> 443 Linker flags passed to all C++ rules.<br/> 444 By default this is empty.</li> 445 446 <li><b>DefaultNamespace</b><br/> 447 Namespace passed to all <code>cc_embed_binary</code> rules when not overridden 448 by the <code>namespace</code> argument to that rule.<br/> 449 Not set by default, if you want to use those rules you'll need to set it or 450 pass it explicitly to each one.</li> 451 452 <li><b>Coverage</b><br/> 453 If true (the default), coverage will be available for C and C++ build rules.<br/> 454 This is still a little experimental but should work for GCC. Right now it does 455 <b>not</b> work for Clang (it likely will in Clang 4.0 which will likely support 456 <code>--fprofile-dir</code>) and so this can be useful to disable it.<br/> 457 It's also useful in some cases for CI systems etc if you'd prefer to avoid the overhead, 458 since the tests have to be compiled with extra instrumentation and without optimisation.</li> 459 </ul> 460 461 <h3>[Proto]</h3> 462 463 <p>Properties that affect how the <code>proto_library</code> and 464 <code>grpc_library</code> rules work.</p> 465 466 <p>As noted elsewhere, these rules are fairly complex and do a bunch of things 467 internally, so they correspondingly have a lot of options here.</p> 468 469 <p>Obviously the various gRPC-related properties only apply to <code>grpc_library</code> 470 rules, whereas <code>proto_library</code> rules are affected by all of them.</p> 471 472 <ul> 473 474 <li><b>ProtocTool</b><br/> 475 The binary invoked to compile .proto files. Defaults to <code>protoc</code>.</li> 476 477 <li><b>ProtocGoPlugin</b><br/> 478 The binary passed to protoc as a plugin to generate Go code. Defaults to 479 <code>protoc-gen-go</code>.<br/> 480 We've found this easier to manage with a <code>go_get</code> rule instead 481 though, so you can also pass a build label here. See the Please repo for an example.</li> 482 483 <li><b>GrpcPythonPlugin</b><br/> 484 The plugin invoked to compile Python code for <code>grpc_library</code>.<br/> 485 Defaults to <code>protoc-gen-grpc-python</code>.</li> 486 487 <li><b>GrpcJavaPlugin</b><br/> 488 The plugin invoked to compile Java code for <code>grpc_library</code>.<br/> 489 Defaults to <code>protoc-gen-grpc-java</code>.</li> 490 491 <li><b>Language</b> (repeated string)<br/> 492 Sets the default set of languages that proto rules are built for.<br/> 493 Chosen from the set of {<code>cc</code>, <code>java</code>, <code>go</code>, 494 <code>py</code>}.<br/> 495 Defaults to all of them!</li> 496 497 <li><b>ProtocVersion</b><br/> 498 Identifies the version of the protoc compiler. This is mostly there to force 499 a rebuild when it's changed.<br/> 500 Note that since various incompatibilities can appear with different versions, 501 it's a good idea for this to match the version of the actual compiler at all times.</li> 502 503 <li><b>PythonDep</b><br/> 504 An in-repo dependency that's applied to any Python targets built.</li> 505 506 <li><b>JavaDep</b><br/> 507 An in-repo dependency that's applied to any Java targets built.</li> 508 509 <li><b>GoDep</b><br/> 510 An in-repo dependency that's applied to any Go targets built.</li> 511 512 <li><b>GrpcVersion</b><br/> 513 Identifies the version of the gRPC compiler. This is mostly there to force 514 a rebuild when it's changed.<br/> 515 Note that since various incompatibilities can appear with different versions, 516 it's a good idea for this to match the version of the actual compiler at all times.</li> 517 518 <li><b>PythonGrpcDep</b><br/> 519 An in-repo dependency that's applied to any Python gRPC targets built.</li> 520 521 <li><b>JavaGrpcDep</b><br/> 522 An in-repo dependency that's applied to any Java gRPC targets built.</li> 523 524 <li><b>GoGrpcDep</b><br/> 525 An in-repo dependency that's applied to any Go gRPC targets built.</li> 526 527 </ul> 528 529 <h3>[Licences]</h3> 530 531 <p>Please has a limited ability to detect licences from third-party code. We 532 obviously can't be 100% sure of these due to the complex nature of dependency 533 management formats and the many, many different forms each licence can be 534 described as. Hopefully though this should offer some help in cases where 535 licences can be detected.</p> 536 537 <ul> 538 <li><b>Accept</b> (repeated string)<br/> 539 Licences that are accepted in this repository.<br/> 540 When this is empty licences are ignored. As soon as it's set any licence 541 detected or assigned must be accepted explicitly here.<br/> 542 There's no fuzzy matching, so some package managers (especially PyPI and 543 Maven, but shockingly not npm which rather nicely uses SPDX) will generate 544 a lot of slightly different spellings of the same thing, which will all 545 have to be accepted here. We'd rather that than trying to "cleverly" match 546 them which might result in matching the wrong thing.</li> 547 548 <li><b>Reject</b><br/> 549 Licences that are explicitly rejected in this repository.<br/> 550 An astute observer will notice that this is not very different to just not 551 adding it to the accept section, but it does have the advantage of explicitly 552 documenting things that the team aren't allowed to use.</li> 553 </ul> 554 555 <h3>[Aliases]</h3> 556 557 <p>This section lets you define new commands to run at the command line. These are 558 currently implemented as a simple text-based replacement of the original command 559 which limits some applications, but they can still be very useful.</p> 560 561 <p>They're written with a simple <code>alias = replacement</code> syntax:</p> 562 563 <pre><code> 564 [aliases] 565 deploy = run //deployment:deployer -- 566 </code></pre> 567 568 <p>This would transform <code>plz deploy //src:please</code> into 569 <code>plz run //deployment:deployer -- //src:please</code>.</p> 570 571 <p>You can also do subcommands of aliases, with a slightly different syntax:</p> 572 573 <pre><code> 574 [aliases "deploy"] 575 dev = run //deployment:deployer -- --env=dev 576 prod = run //deployment:deployer -- --env=prod 577 </code></pre> 578 579 <p>These are then invoked as <code>plz deploy dev</code> and 580 <code>plz deploy prod</code> respectively.<br/> 581 Due to the limitations of parsing our config format, you can only have one 582 level of subcommand of aliases.</p> 583 584 <h3>[Bazel]</h3> 585 586 <p>This section defines some settings to help with limited Bazel compatibility.<br/> 587 We don't aspire to be fully compatible and mimic all the semantics of their system, 588 but we hope to ease migration and cross-testing by being able to parse simple repos.</p> 589 590 <p>Currently the only attribute here is <code>compatibility</code>, when that is enabled 591 some aspects of the parser behave a little differently; some of the rule names and flags 592 change, <code>//visibility:public</code> is interpreted specially and WORKSPACE files are 593 parsed to find dependencies in <code>//external</code>.<p> 594 595 <p>There is a <code>--bazel_compat</code> flag to <code>plz init</code> which sets this 596 on initialising a new repo.</p> 597 598 <p>We don't have a separate setting for it, but switching this on will also allow limited 599 Buck compatibility. Specifically <code>include_defs</code> becomes available and the 600 various C++ rules gain <code>cxx_</code> aliases.</p>