Skip to content

Commit 14ebdb9

Browse files
decathorpejackorp
authored andcommitted
[Rust] Expand section about cargo + crate dependencies
Rust crates as packaged by Fedora are not really a suitable development target - this is one of the reasons why using them as a replacement for crates.io is not a supported use case. While it was intentional that there was no documentation for how to use the Fedora packages for Rust crates for local development (it is not a supported use case, after all), this has caused confusion on multiple occasions. To remove this ambiguity, this commit explicitly documents this use case as unsupported in the developer documentation.
1 parent 7003feb commit 14ebdb9

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tech/languages/rust/rust-cargo.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,22 @@ $ cargo run
4343
Hello, world!
4444
```
4545

46-
# crates.io repository
46+
# Using Rust libraries ("crates")
4747
Rust calls its compilation unit (either library or executable) a crate. Your project
4848
is such a crate and it can also depend on other crates specified in `Cargo.toml`. The
4949
default repository to look for dependencies is [crates.io](https://crates.io/) but you
50-
can also specify dependencies on a git repository.
50+
can also specify dependencies on a git repository. More information about all the
51+
different ways of specifying dependencies is available in the
52+
[cargo book](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html).
5153

52-
**Note:** Cargo currently supports only source dependencies.
54+
While many Rust crates are also packaged for Fedora Linux (as `rust-$crate`, with
55+
`rust-$crate-*-devel` packages available from the package repositories), the crates
56+
packaged this way are primarily intended to be used for building RPM packages for Rust
57+
applications. Using these crates as a replacement for [crates.io](https://crates.io/)
58+
is not a supported use case. In some cases they also diverge from crates as published
59+
on crates.io because of downstream-specific patches (both concerning crate dependencies
60+
and behaviour), so they might not even be a suitable development target.
61+
62+
**Note:** Both crates.io and Fedora only distribute Rust crates as source code. Rust
63+
does not yet provide a stable ABI, so it is not possible to distribute pre-compiled Rust
64+
crates / libraries in a binary format.

0 commit comments

Comments
 (0)