@@ -30,6 +30,12 @@ or the equivalent on Windows.
30
30
31
31
Each workspace may contain one or more packages.
32
32
33
+ When building code that contains one or more directives of the form ` extern mod P ` ,
34
+ rustpkg automatically searches for packages named ` P ` in the ` RUST_PATH ` (as described above).
35
+ It builds those dependencies if necessary.
36
+ Thus, when using rustpkg,
37
+ there is no need for ` -L ` flags to tell the linker where to find libraries for external crates.
38
+
33
39
# Package structure
34
40
35
41
A valid workspace must contain each of the following subdirectories:
@@ -66,6 +72,10 @@ A package can be stored in a workspace on the local file system,
66
72
or on a remote Web server, in which case the package ID resembles a URL.
67
73
For example, ` github.com/mozilla/rust ` is a package ID
68
74
that would refer to the git repository browsable at ` http://github.com/mozilla/rust ` .
75
+ A package ID can also specify a version, like:
76
+ ` github.com/mozilla/rust#0.3 ` .
77
+ In this case, ` rustpkg ` will check that the repository ` github.com/mozilla/rust ` has a tag named ` 0.3 ` ,
78
+ and report an error otherwise.
69
79
70
80
## Source files
71
81
@@ -76,6 +86,15 @@ rustpkg searches for four different fixed filenames in order to determine the cr
76
86
* ` test.rs ` : Assumed to contain tests declared with the ` #[test] ` attribute.
77
87
* ` bench.rs ` : Assumed to contain benchmarks declared with the ` #[bench] ` attribute.
78
88
89
+ ## Versions
90
+
91
+ ` rustpkg ` packages do not need to declare their versions with an attribute inside one of the source files,
92
+ because ` rustpkg ` infers it from the version control system.
93
+ When building a package that is in a ` git ` repository,
94
+ ` rustpkg ` assumes that the most recent tag specifies the current version.
95
+ When building a package that is not under version control,
96
+ or that has no tags, ` rustpkg ` assumes the intended version is 0.1.
97
+
79
98
# Custom build scripts
80
99
81
100
A file called ` pkg.rs ` at the root level in a workspace is called a * package script* .
0 commit comments