@@ -199,7 +199,9 @@ license-file = "..."
199
199
200
200
# Appveyor: `repository` is required. `branch` is optional; default is `master`
201
201
# `service` is optional; valid values are `github` (default), `bitbucket`, and
202
- # `gitlab`.
202
+ # `gitlab`; `id` is optional; you can specify the appveyor project id if you
203
+ # want to use that instead. `project_name` is optional; use when the repository
204
+ # name differs from the appveyor project name.
203
205
appveyor = { repository = " ..." , branch = " master" , service = " github" }
204
206
205
207
# Circle CI: `repository` is required. `branch` is optional; default is `master`
@@ -299,6 +301,7 @@ codegen-units = 1 # if > 1 enables parallel code generation which improves
299
301
# compile times, but prevents some optimizations.
300
302
# Passes `-C codegen-units`. Ignored when `lto = true`.
301
303
panic = ' unwind' # panic strategy (`-C panic=...`), can also be 'abort'
304
+ incremental = true # whether or not incremental compilation is enabled
302
305
303
306
# The release profile, used for `cargo build --release`.
304
307
[profile .release ]
@@ -309,6 +312,7 @@ lto = false
309
312
debug-assertions = false
310
313
codegen-units = 1
311
314
panic = ' unwind'
315
+ incremental = false
312
316
313
317
# The testing profile, used for `cargo test`.
314
318
[profile .test ]
@@ -319,6 +323,7 @@ lto = false
319
323
debug-assertions = true
320
324
codegen-units = 1
321
325
panic = ' unwind'
326
+ incremental = true
322
327
323
328
# The benchmarking profile, used for `cargo bench` and `cargo test --release`.
324
329
[profile .bench ]
@@ -329,6 +334,7 @@ lto = false
329
334
debug-assertions = false
330
335
codegen-units = 1
331
336
panic = ' unwind'
337
+ incremental = false
332
338
333
339
# The documentation profile, used for `cargo doc`.
334
340
[profile .doc ]
@@ -339,6 +345,7 @@ lto = false
339
345
debug-assertions = true
340
346
codegen-units = 1
341
347
panic = ' unwind'
348
+ incremental = true
342
349
```
343
350
344
351
### The ` [features] ` section
@@ -475,10 +482,12 @@ as:
475
482
``` toml
476
483
[workspace ]
477
484
478
- # Optional key, inferred if not present
485
+ # Optional key, inferred from path dependencies if not present.
486
+ # Additional non-path dependencies that should be included must be given here.
487
+ # In particular, for a virtual manifest, all members have to be listed.
479
488
members = [" path/to/member1" , " path/to/member2" , " path/to/member3/*" ]
480
489
481
- # Optional key, empty if not present
490
+ # Optional key, empty if not present.
482
491
exclude = [" path1" , " path/to/dir2" ]
483
492
```
484
493
@@ -528,10 +537,23 @@ crate will be treated as a normal package, as well as a workspace. If the
528
537
` package ` table is not present in a workspace manifest, it is called a * virtual
529
538
manifest* .
530
539
531
- When working with * virtual manifests* , package-related cargo commands, like
532
- ` cargo build ` , won't be available anymore. But, most of such commands support
533
- the ` --all ` option, will execute the command for all the non-virtual manifest in
534
- the workspace.
540
+ #### Package selection
541
+
542
+ In a workspace, package-related cargo commands like ` cargo build ` apply to
543
+ packages selected by ` -p ` / ` --package ` or ` --all ` command-line parameters.
544
+ When neither is specified, the optional ` default-members ` configuration is used:
545
+
546
+ ``` toml
547
+ [workspace ]
548
+ members = [" path/to/member1" , " path/to/member2" , " path/to/member3/*" ]
549
+ default-members = [" path/to/member2" , " path/to/member3/foo" ]
550
+ ```
551
+
552
+ When specified, ` default-members ` must expand to a subset of ` members ` .
553
+
554
+ When ` default-members ` is not specified, the default is the root manifest
555
+ if it is a package, or every member manifest (as if ` --all ` were specified
556
+ on the command-line) for virtual workspaces.
535
557
536
558
#TODO: move this to a more appropriate place
537
559
### The project layout
@@ -550,7 +572,8 @@ each file you want to build.
550
572
551
573
Your project can optionally contain folders named ` examples ` , ` tests ` , and
552
574
` benches ` , which Cargo will treat as containing examples,
553
- integration tests, and benchmarks respectively.
575
+ integration tests, and benchmarks respectively. Analogous to ` bin ` targets, they
576
+ may be composed of single files or directories with a ` main.rs ` file.
554
577
555
578
``` shell
556
579
▾ src/ # directory containing source files
@@ -562,10 +585,16 @@ integration tests, and benchmarks respectively.
562
585
main.rs
563
586
▾ examples/ # (optional) examples
564
587
* .rs
588
+ ▾ * / # (optional) directories containing multi-file examples
589
+ main.rs
565
590
▾ tests/ # (optional) integration tests
566
591
* .rs
592
+ ▾ * / # (optional) directories containing multi-file tests
593
+ main.rs
567
594
▾ benches/ # (optional) benchmarks
568
595
* .rs
596
+ ▾ * / # (optional) directories containing multi-file benchmarks
597
+ main.rs
569
598
```
570
599
571
600
To structure your code after you've created the files and folders for your
@@ -723,19 +752,28 @@ other copies. The syntax is similar to the `[dependencies]` section:
723
752
[patch .crates-io ]
724
753
foo = { git = ' https://github.com/example/foo' }
725
754
bar = { path = ' my/local/bar' }
755
+
756
+ [dependencies .baz ]
757
+ git = ' https://github.com/example/baz'
758
+
759
+ [patch .'https://github .com/example/baz' ]
760
+ baz = { git = ' https://github.com/example/patched-baz' , branch = ' my-branch' }
726
761
```
727
762
728
763
The ` [patch] ` table is made of dependency-like sub-tables. Each key after
729
764
` [patch] ` is a URL of the source that's being patched, or ` crates-io ` if
730
765
you're modifying the https://crates.io registry. In the example above
731
766
` crates-io ` could be replaced with a git URL such as
732
- ` https://github.com/rust-lang-nursery/log ` .
767
+ ` https://github.com/rust-lang-nursery/log ` ; the second ` [patch] `
768
+ section in the example uses this to specify a source called ` baz ` .
733
769
734
770
Each entry in these tables is a normal dependency specification, the same as
735
771
found in the ` [dependencies] ` section of the manifest. The dependencies listed
736
772
in the ` [patch] ` section are resolved and used to patch the source at the
737
773
URL specified. The above manifest snippet patches the ` crates-io ` source (e.g.
738
- crates.io itself) with the ` foo ` crate and ` bar ` crate.
774
+ crates.io itself) with the ` foo ` crate and ` bar ` crate. It also
775
+ patches the ` https://github.com/example/baz ` source with a ` my-branch ` that
776
+ comes from elsewhere.
739
777
740
778
Sources can be patched with versions of crates that do not exist, and they can
741
779
also be patched with versions of crates that already exist. If a source is
0 commit comments