-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #11869 - epage:impl, r=weihanglo
docs(contrib): Pull impl info out of architecture This is a follow up to #11809. Personally, I found mixing this stuff with architecture less than ideal as it buried the more practical information among details that might not have been as important. With us moving architecture information into doc comments, this provides us an opportunity to rectify this. Not a fan of the name of this chapter but its a start. I've left in the old architecture chapter as there is still content to find a home for (resolver).
- Loading branch information
Showing
9 changed files
with
66 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,3 @@ | ||
# Files | ||
|
||
See [nightly docs](https://doc.rust-lang.org/nightly/nightly-rustc/cargo/index.html) | ||
|
||
## Filesystems | ||
|
||
Cargo tends to get run on a very wide array of file systems. Different file | ||
systems can have a wide range of capabilities, and Cargo should strive to do | ||
its best to handle them. Some examples of issues to deal with: | ||
|
||
* Not all file systems support locking. Cargo tries to detect if locking is | ||
supported, and if not, will ignore lock errors. This isn't ideal, but it is | ||
difficult to deal with. | ||
* The [`fs::canonicalize`] function doesn't work on all file systems | ||
(particularly some Windows file systems). If that function is used, there | ||
should be a fallback if it fails. This function will also return `\\?\` | ||
style paths on Windows, which can have some issues (such as some tools not | ||
supporting them, or having issues with relative paths). | ||
* Timestamps can be unreliable. The [`fingerprint`] module has a deeper | ||
discussion of this. One example is that Docker cache layers will erase the | ||
fractional part of the time stamp. | ||
* Symlinks are not always supported, particularly on Windows. | ||
|
||
[`fingerprint`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/fingerprint.rs | ||
[`fs::canonicalize`]: https://doc.rust-lang.org/std/fs/fn.canonicalize.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Filesystem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Architecture Overview | ||
|
||
See the | ||
[nightly docs](https://doc.rust-lang.org/nightly/nightly-rustc/cargo/index.html) | ||
for an overview of `cargo`s architecture and links out to further details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Debugging | ||
|
||
## Logging | ||
|
||
Cargo uses the [`env_logger`] crate to display debug log messages. The | ||
`CARGO_LOG` environment variable can be set to enable debug logging, with a | ||
value such as `trace`, `debug`, or `warn`. It also supports filtering for | ||
specific modules. Feel free to use the standard [`log`] macros to help with | ||
diagnosing problems. | ||
|
||
```sh | ||
# Outputs all logs with levels debug and higher | ||
CARGO_LOG=debug cargo generate-lockfile | ||
|
||
# Don't forget that you can filter by module as well | ||
CARGO_LOG=cargo::core::resolver=trace cargo generate-lockfile | ||
|
||
# This will print lots of info about the download process. `trace` prints even more. | ||
CARGO_HTTP_DEBUG=true CARGO_LOG=cargo::ops::registry=debug cargo fetch | ||
|
||
# This is an important command for diagnosing fingerprint issues. | ||
CARGO_LOG=cargo::core::compiler::fingerprint=trace cargo build | ||
``` | ||
|
||
[`env_logger`]: https://docs.rs/env_logger | ||
[`log`]: https://docs.rs/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Filesystem | ||
|
||
Cargo tends to get run on a very wide array of file systems. Different file | ||
systems can have a wide range of capabilities, and Cargo should strive to do | ||
its best to handle them. Some examples of issues to deal with: | ||
|
||
* Not all file systems support locking. Cargo tries to detect if locking is | ||
supported, and if not, will ignore lock errors. This isn't ideal, but it is | ||
difficult to deal with. | ||
* The [`fs::canonicalize`] function doesn't work on all file systems | ||
(particularly some Windows file systems). If that function is used, there | ||
should be a fallback if it fails. This function will also return `\\?\` | ||
style paths on Windows, which can have some issues (such as some tools not | ||
supporting them, or having issues with relative paths). | ||
* Timestamps can be unreliable. The [`fingerprint`] module has a deeper | ||
discussion of this. One example is that Docker cache layers will erase the | ||
fractional part of the time stamp. | ||
* Symlinks are not always supported, particularly on Windows. | ||
|
||
[`fingerprint`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/fingerprint.rs | ||
[`fs::canonicalize`]: https://doc.rust-lang.org/std/fs/fn.canonicalize.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Implementing a Change | ||
|
||
This chapter gives an overview of what you need to know in making a change to cargo. | ||
|
||
If you feel something is missing that would help you, feel free to ask on | ||
[Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo). |
2 changes: 1 addition & 1 deletion
2
...c/contrib/src/architecture/subcommands.md → ...contrib/src/implementation/subcommands.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters