Skip to content

Commit c68c015

Browse files
committed
auto merge of #6906 : catamorphism/rust/rustpkg-doc, r=graydon
r? @graydon
2 parents 5ddbc88 + 5b09dca commit c68c015

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/rustpkg.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ or the equivalent on Windows.
3030

3131
Each workspace may contain one or more packages.
3232

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+
3339
# Package structure
3440

3541
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,
6672
or on a remote Web server, in which case the package ID resembles a URL.
6773
For example, `github.com/mozilla/rust` is a package ID
6874
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.
6979

7080
## Source files
7181

@@ -76,6 +86,15 @@ rustpkg searches for four different fixed filenames in order to determine the cr
7686
* `test.rs`: Assumed to contain tests declared with the `#[test]` attribute.
7787
* `bench.rs`: Assumed to contain benchmarks declared with the `#[bench]` attribute.
7888

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+
7998
# Custom build scripts
8099

81100
A file called `pkg.rs` at the root level in a workspace is called a *package script*.

0 commit comments

Comments
 (0)