Commit graph

11870 commits

Author SHA1 Message Date
Josh Triplett 0d028608b3 Link to rustc documentation for -C strip 2021-12-23 23:40:14 -08:00
Josh Triplett 75e544d545 Stabilize the strip profile option, now that rustc has stable -C strip
https://github.com/rust-lang/rust/pull/90058/ stabilized `-Z strip` as
`-C strip`. Stabilize the corresponding Cargo option.

Update the documentation to move it from the unstable reference to the
profiles documentation.

Update the tests to account for stabilization, but make them no-ops on
stable/beta for now until rustc 1.58 releases.
2021-12-23 23:40:13 -08:00
Midas Lambrichts f0992e3b11 Add comment explaining the lowercasing in the levenshtein distance calculation. 2021-12-22 20:57:15 +01:00
Weihang Lo e0d02755a3
Move section titles into comment 2021-12-22 01:45:57 +08:00
Midas Lambrichts 42528799e2 Make levenshtein distance case insensitive.
When typing in a single character shortcut as a capital, it always
returns `b` as the suggestion as every one-letter abbreviation
is a lev distance 1 away from the capitalized one.
By making the levenshtein distance case insensitive, the case-mismatched
one-letter abbriviation (e.g. `C` to `c`) will be suggested, rather
than `b`
2021-12-21 12:56:28 +01:00
Weihang Lo 6f912788ed
Test cargo build being resilient to filesystem loop 2021-12-21 02:46:05 +08:00
bors 47b869c107 Auto merge of #10212 - SamMorrowDrums:patch-1, r=alexcrichton
[docs] Adds basic CI yaml for GitHub Actions

Currently there is no documentation for GitHub Actions, so I have attempted to add an Actions Workflow that is equivalent to the other CI snippets in the file. You can view a successful run of this Action in my repo for experimenting with this here: https://github.com/SamMorrowDrums/rust-action-test/actions/runs/1593666172

The Rust code I tested it with is just the boilerplate from `cargo init`.
2021-12-20 16:35:00 +00:00
Sam Morrow deee87c428 add pull_request trigger and update add note on fail case 2021-12-20 16:43:03 +01:00
Sam Morrow a7a60a5421 add information on starter workflow 2021-12-20 15:49:10 +01:00
Weihang Lo 0926c3b9c4
The first version of pull request template
We're trying to extract information out off the head of contributors.
Hope this help the review process more friendly for everyone.
2021-12-19 17:44:36 +08:00
Sam Morrow e91db920a0 further simplify the workflow 2021-12-17 20:02:11 +01:00
bors 3787309df6 Auto merge of #10209 - jonhoo:pub-manifest-from-str, r=alexcrichton
Add function for parsing already-read manifest

This makes the function formerly known as `do_read_manifest` public
under the name `read_manifest_from_str` so that Cargo-as-a-library users
can parse a manifest without re-reading a `Cargo.toml` file they have
already read from disk themselves.
2021-12-17 16:12:16 +00:00
Sam Morrow 7572047529 add in override flag to set default cargo toolchain 2021-12-17 12:02:13 +01:00
Sam Morrow bb48cd5b71
Adds basic CI yaml for GitHub Actions 2021-12-17 11:37:42 +01:00
bors fcef61230c Auto merge of #10210 - nyurik:test-help, r=ehuss
Minor docs change for `cargo test --help`

Per #10208, make `cargo test -- --help` more discoverable.
2021-12-17 02:30:38 +00:00
Yuri Astrakhan 229c7cfa28 Minor docs change for cargo test --help
Per #10208, make `cargo test -- --help` more discoverable.
2021-12-16 21:03:36 -05:00
Jon Gjengset 7e160e5110 Add function for parsing already-read manifest
This makes the function formerly known as `do_read_manifest` public
under the name `read_manifest_from_str` so that Cargo-as-a-library users
can parse a manifest without re-reading a `Cargo.toml` file they have
already read from disk themselves.
2021-12-16 15:18:53 -08:00
bors 8f8212c7ba Auto merge of #10205 - hi-rustin:rustin-patch-clippy, r=Eh2406
Make clippy happy

Remove needless borrow.
2021-12-16 22:49:38 +00:00
bors bfb7f2e083 Auto merge of #10202 - weihanglo:github-issue-config, r=alexcrichton
Enhance descriptions of issue templates

## Why

To discuss new features with larger scope, I think it's better discuss with the community, not just people in this repo. Hope these changes can guide people to a more proper place for this kind of feature request.

## Screenshots

#### Add two new types of issue template

- Question
- Inspiring Idea

<img width="500" alt="image" src="https://user-images.githubusercontent.com/14314532/146328466-f234c431-e355-4da1-a34a-b7b4c2490599.png">

#### Mention internal forum and zulip to guide user to discuss

<img width="500" alt="image" src="https://user-images.githubusercontent.com/14314532/146328580-4798983a-58d3-4e5e-9006-bf6d1d089c83.png">
2021-12-16 17:20:24 +00:00
bors 180f599f60 Auto merge of #10196 - charlesroussel:master, r=alexcrichton
Add workaround for sporadic kills when building on Macos

This is the workaround for the issue https://github.com/rust-lang/cargo/issues/10060
2021-12-16 16:36:36 +00:00
Charles Roussel c9c67c0a93 Add workaround for sporadic kills when building on Macos 2021-12-16 16:59:57 +01:00
bors b05697de66 Auto merge of #10188 - weihanglo:issue-9528, r=alexcrichton
Detect filesystem loop during walking the projects

Resolves #9528

~~This PR also adds a new dependency `same-file` but since it's already a
dependency of `cargo-util`, so nothing added actually.~~

Use `walkdir` to detect filesystem loop and gain performance boost!
2021-12-16 15:48:52 +00:00
bors b9bc3d1e86 Auto merge of #10204 - hi-rustin:rustin-patch-doc, r=alexcrichton
Error about not having any crates with documentation

close https://github.com/rust-lang/cargo/issues/10194

Error about not having any crates with documentation.
2021-12-16 15:08:37 +00:00
hi-rustin 38826af279 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-16 22:31:03 +08:00
hi-rustin 07843ed8fb add open_no_doc_crate test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-16 22:29:32 +08:00
hi-rustin 94d076703e Error when the absence of any crates with files
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-16 19:56:05 +08:00
Weihang Lo 5e5b1312ae
Mention forum and zulip in feature-request issue template 2021-12-16 18:53:06 +08:00
Weihang Lo a2ae9915bc
Enhance issue template config 2021-12-16 14:47:33 +08:00
bors 99627cdca4 Auto merge of #10201 - ehuss:dep-doc-false, r=Eh2406
Don't document libs with doc=false

The `doc=false` setting was not being checked in the `[lib]` table when determining dependencies to document. This changes it so that that setting is honored.
2021-12-16 00:23:34 +00:00
Eric Huss 6e568690a6 Don't document libs with doc=false 2021-12-15 15:13:54 -08:00
bors da8dd70c5c Auto merge of #10198 - pinkforest:master, r=ehuss
Bumps up tar to 0.4.36

Minor changes - All tests pass and some manual tests
2021-12-15 04:59:49 +00:00
pinkforest e4f09b6afa Bumps up tar to 0.4.36 2021-12-15 15:01:43 +11:00
Jon Gjengset 1372afc6bd Fix up config_include test 2021-12-14 19:39:03 -08:00
Weihang Lo b49fe506f9
Return bool instead of CargoResult for filter
Since `StripPrefixError` returned from [`Path::strip_prefix`] is just an
error with "prefix not found. We can simply return false for it.

Also use `Match::is_ignore` instead of manually matching.

[`Path::strip_prefix`]: https://doc.rust-lang.org/1.57.0/std/path/struct.Path.html#method.strip_prefix
2021-12-15 09:47:16 +08:00
Weihang Lo 6fa0f01d87
Test filesystem loop during traversal
Use unordered since order of warning differs on each platform.
2021-12-15 09:42:14 +08:00
Weihang Lo 3591a5bdaf
Use walkdir to walk filesyste and detect loop 2021-12-15 09:42:14 +08:00
Jon Gjengset 934d2d63f5 Use toml_edit to check dotted key for --config 2021-12-14 14:25:32 -08:00
Jon Gjengset 18871b3394 Merge remote-tracking branch 'upstream/master' into config-cli-simple 2021-12-14 12:16:59 -08:00
bors a359ce1607 Auto merge of #10152 - steven-joruk:quiet-config, r=ehuss
Support `term.quiet` configuration

Fixes #10128

This follows the existing support for `--verbose` and `term.verbose`.

I've renamed the related tests to be a bit clearer now there are more cases, and the existing quiet tests now prove that they hide the cargo log.

I'm unsure whether I'm supposed to regenerate the documentation as part of this?
2021-12-14 18:40:22 +00:00
bors c689f55b8c Auto merge of #10193 - sstangl:help-alias-10138, r=alexcrichton
Display alias target on 'cargo help <alias>`

```
Previously, `cargo help <alias>` resolved the alias and displayed the
help for the targeted subcommand. For example, if `br` were aliased to
`build --release`, `cargo help br` would display the manpage for
cargo-build.

With this patch, it will print "'br' is aliased to 'build --release'".
```

Addresses issue #10138.

This is my first patch to Cargo. I attempted to follow the style of the surrounding code. Please let me know if any changes are required: happy to make them. In particular, I wasn't sure if any tests exist for this path.
2021-12-14 17:50:46 +00:00
bors c87b986a5c Auto merge of #10145 - QiangHeisenberg:deprecated, r=alexcrichton
delete --host command and message

close https://github.com/rust-lang/cargo/issues/10121

The warning for this command has been around for a long time, and it seems safe to delete it now.
According to Alex's words in the issue, I think he supports deletion. I'm sorry if I misunderstood it and feel free to close it.
2021-12-14 17:07:04 +00:00
bors 0bbfc5e536 Auto merge of #10191 - weihanglo:issue-9881, r=alexcrichton
Improve I/O error message for fingerprint of build script

It is a bit rough but I don't think there is a network I/O error
in `pkg_fingerprint`. Checking only `io::Error` type should be fine.

Resolves #9881
2021-12-13 21:09:58 +00:00
bors 1ee19f3403 Auto merge of #10177 - ehuss:list-alias, r=alexcrichton
Explicitly mark aliases in `cargo list`.

This I think makes it a little clearer that these are aliases, and matches the form used for built-in aliases.
2021-12-13 20:26:34 +00:00
bors a4cdd757e5 Auto merge of #10171 - ehuss:no-executable-doc, r=alexcrichton
Don't emit "executable" JSON field for non-executables.

The "executable" field of JSON artifact messages was accidentally filled (with the path to `index.html`) when documenting a binary target. This fixes it so that it is null.

Closes #10149
2021-12-13 19:48:00 +00:00
bors dadeae842c Auto merge of #10166 - ehuss:scrape-examples-unstable-doc, r=alexcrichton
Move scrape-examples docs to correct section.

This was erroneously put in the stabilized section.
2021-12-13 19:10:44 +00:00
bors c7db2995d0 Auto merge of #10161 - weihanglo:issue-7473, r=alexcrichton
Do not suggest source config if nothing to vendor

fixes #7473

Also remove the empty vendor dir if we've just created it but didn't vendor anything.
2021-12-13 18:26:26 +00:00
bors 599961b320 Auto merge of #10155 - ehuss:bump-deps, r=alexcrichton
Bump versions of local deps.

There have only been very minor changes since the last version.
2021-12-13 17:47:44 +00:00
bors 5d7ac5897d Auto merge of #10154 - ehuss:version-bump, r=alexcrichton
Bump to 0.60.0, update changelog
2021-12-13 17:00:36 +00:00
bors 85d146239d Auto merge of #10153 - ehuss:fix-profile-docs, r=alexcrichton
Fix some profile documentation.

The `test` and `bench` sections had wrong information about which profile is used.  This also has some changes to try to format and clarify selection a little.
2021-12-13 16:16:58 +00:00
bors 3aaa8f975d Auto merge of #10172 - ehuss:doc-lib-before-bin, r=alexcrichton
Document lib before bin.

This changes it so that documenting a library is required to finish before documenting a binary. The issue is that the binary may have intra-doc links to the library. If they are documented concurrently, then the links will sometimes fail (since it is a race).   Or, if doing `cargo doc --bins`, then the library docs wouldn't exist at all.

Note that in the tests this introduces some more name collisions if you just run `cargo doc --bins` and there is a colliding library/binary name. There is some risk that someone might be trying to run the commands separately to get around the collision error, but I think it is unlikely.
2021-12-13 15:38:31 +00:00