Commit graph

12427 commits

Author SHA1 Message Date
bors d98628848c Auto merge of #10696 - ehuss:update-curl, r=epage
Update libcurl

This updates to the latest libcurl.

Changes in curl:
* 0.4.42: https://github.com/alexcrichton/curl-rust/releases/tag/0.4.42
* 0.4.43: https://github.com/alexcrichton/curl-rust/releases/tag/0.4.43

Changes in libcurl:
* From 7.80.0 to 7.83.1: https://curl.se/changes.html

There were several security issues addressed recently (https://curl.se/docs/security.html), however, I don't think any of them are particularly concerning for us.
2022-05-23 16:50:11 +00:00
Eric Huss 1bfb897485 Update libcurl 2022-05-23 08:21:50 -07:00
likzn 1179e7ef6b cargo fmt 2022-05-23 21:06:34 +08:00
likzn 89c24bf811 refactor logic 2022-05-23 21:01:55 +08:00
bors 9bc91ff2a8 Auto merge of #10693 - alex-semenyuk:typos_cargo, r=ehuss
Fixed small typos

Fixed small typos
2022-05-23 02:35:39 +00:00
alexey semenyuk d48a773696
Reverted option 2022-05-22 22:15:41 +00:00
alexey semenyuk 9dc393e15b
Update faq.md 2022-05-22 15:25:55 +00:00
alexey semenyuk acbb3ca753
Update faq.md 2022-05-22 15:19:49 +00:00
alexey semenyuk aa771595a9
Update cargo-run.md 2022-05-22 14:00:01 +00:00
alexey semenyuk 14154d17e7
Update semver.md 2022-05-22 13:03:25 +00:00
alexey semenyuk c6c5face62
Typos 2022-05-21 17:56:22 +00:00
Danil Hendra Suryawan 7952680d8d No printing executable names when running tests with json message format 2022-05-21 23:18:46 +07:00
bors 83a7983ec1 Auto merge of #10685 - Muscraft:cargo-add-workspace-source, r=epage
fix bugs with `workspace` key and `update_toml`

### Motivations and Context

When working on an external subcommand to help with the switch to workspace inheritance, I found issues with the output `Cargo.toml` it was creating. When a `cargo_add::Dependency` would change its source to a `WorkspsaceSource`, `workspace = true` would not show up. This lead me to discover that the `default-features` key was not being removed when the `workspace` key was set.

This fixes those issues but brought up questions about how to deal with removing keys and clearing conflicting fields in a `Dependency`. After talking with `@epage,` it was decided that this was the minimal set of changes to make while the changes to fix the other issues is workshopped.

### Changes
- add `default-features` to the list of keys to remove when the source is a `WorkspaceSource`
- insert a `workspace` key when the source is a `WorkspaceSource`
2022-05-20 22:41:12 +00:00
bors 7524ccdc03 Auto merge of #10687 - ehuss:version-bump, r=epage
Bump to 0.64.0, update changelog
2022-05-20 21:52:59 +00:00
Eric Huss f4c174d58f Update changelog for 1.62 2022-05-20 14:20:52 -07:00
Scott Schafer ffc1053238 fix bug where update_toml would not remove default-features if workspace was set 2022-05-20 16:10:02 -05:00
Scott Schafer 9ab1cf9e30 fix bug where workspace = true would not show up after update_toml 2022-05-20 16:01:27 -05:00
Eric Huss 447384ed72 Bump to 0.64.0 2022-05-20 13:27:39 -07:00
Jon Gjengset c262f100ec Restore proper error for crate not in local reg
Fixes #10682.
2022-05-20 18:24:26 +00:00
bors f624095e1c Auto merge of #10678 - cbeuw:patch-1, r=weihanglo
List C compiler as a build dependency in README

Cargo requires a C compiler to build, this should be specified in README
```
$ cargo tree --invert cc
cc v1.0.73
[build-dependencies]
├── curl-sys v0.4.55+curl-7.83.1
│   ├── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
│   └── curl v0.4.43
│       ├── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
│       ├── crates-io v0.34.0 (C:\Users\IEUser\Documents\cargo\crates\crates-io)
│       │   └── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
│       └── git2-curl v0.15.0
│           └── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
├── libgit2-sys v0.13.4+1.4.2
│   ├── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
│   └── git2 v0.14.4
│       ├── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
│       ├── cargo-test-support v0.1.0 (C:\Users\IEUser\Documents\cargo\crates\cargo-test-support)
│       │   [dev-dependencies]
│       │   └── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
│       └── git2-curl v0.15.0 (*)
├── libnghttp2-sys v0.1.7+1.45.0
│   └── curl-sys v0.4.55+curl-7.83.1 (*)
├── libssh2-sys v0.2.23
│   └── libgit2-sys v0.13.4+1.4.2 (*)
└── libz-sys v1.1.6
    ├── curl-sys v0.4.55+curl-7.83.1 (*)
    ├── flate2 v1.0.23
    │   ├── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
    │   └── cargo-test-support v0.1.0 (C:\Users\IEUser\Documents\cargo\crates\cargo-test-support) (*)
    │   [build-dependencies]
    │   └── cargo v0.63.0 (C:\Users\IEUser\Documents\cargo)
    ├── libgit2-sys v0.13.4+1.4.2 (*)
    └── libssh2-sys v0.2.23 (*)
```
2022-05-20 01:56:04 +00:00
bors c8c6e33996 Auto merge of #10539 - Urgau:check-cfg-build-script, r=ehuss
Add unstable `rustc-check-cfg` build script output

This PR adds a new build script output as unstable behind `-Zcheck-cfg=output`: `rustc-check-cfg`.

### What does this PR try to resolve?

This PR add a way to add to use the unstable `--check-cfg` command line option of `rustc` and `rustdoc`.

It was discover in [Bump bootstrap compiler to 1.61.0 beta](https://github.com/rust-lang/rust/pull/95678#discussion_r842803445) that `rustc_llvm` sets some custom `cfg` from a build script and because `--check-cfg=values()` is globally enable in the Rust codebase that cause the compilation to fail. For now no values are checked in stage 0 for the entire codebase which is a shame and should be fixed with the addition of this feature.

### How should we test and review this PR?

Commits are separated in: implementation, tests and doc.

Testing should simply be done by adding a valid `cargo:rustc-check-cfg` in a build script.
Watch the added tests or doc to have an example.

### Additional information

This PR is also the logical next step after `-Zcheck-cfg-features`.
2022-05-20 00:55:25 +00:00
Andy Wang 3c1596d8bb
List C compiler as a build dependency 2022-05-19 23:15:50 +01:00
Urgau f2a1e4363f Factor custom flags management to one function 2022-05-19 01:14:48 +02:00
Loïc BRANSTETT 276c6d18ea Add doc for -Zextra-check-cfg and rustc-check-cfg 2022-05-18 21:27:07 +02:00
Loïc BRANSTETT 805f5c2f0a Add tests for cargo:rustc-check-cfg 2022-05-18 21:26:56 +02:00
Loïc BRANSTETT d16631fd52 Add support for cargo:rustc-check-cfg in build script 2022-05-18 21:26:56 +02:00
likzn d6d53ae514 fix test 2022-05-19 00:25:59 +08:00
likzn a5a0f6809d fix typo 2022-05-18 23:42:42 +08:00
likzn ef7d9b7f8e extract to registry 2022-05-18 23:40:07 +08:00
likzn 4401fc9b9c Merge branch 'master' into fix_publish_p 2022-05-18 23:04:07 +08:00
likzn 95cb21d6a1 fix cargo -p 2022-05-18 22:40:55 +08:00
bors a4c1cd0eb6 Auto merge of #10675 - Muscraft:update-contrib-docs, r=weihanglo
Add notes about pre-stabilization to contributor unstable docs

This PR is meant to add more direction for contributors on the path to stabilization for unstable features. It adds a section titled `Pre-Stabilization` to the unstable contributor docs.

The idea for this [came out of the discussion](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/workspace.20inheritance.20stabilization/near/281856280) about when and how to stabilize workspace inheritance. The notes that are being added were derived from the above comment as well as the [the adding of the `Call for Testing`](https://github.com/rust-lang/this-week-in-rust/issues/3236) section to TWiR. [This comment](https://github.com/rust-lang/this-week-in-rust/pull/3260#discussion_r874977470) gives more information as well.

As for the requirement of testing notes, [there is still discussion about if they are needed](https://github.com/rust-lang/this-week-in-rust/pull/3260#discussion_r874985133).

While what was added is not comprehensive it is meant as a guide for what to do as each feature has different requirements for stabilization

r? `@epage`
2022-05-18 01:52:07 +00:00
Scott Schafer 5418d581b7 Add notes about pre-stabilization to contributor unstable docs 2022-05-17 12:44:10 -05:00
bors d14c59dfe9 Auto merge of #10674 - petrochenkov:linklib, r=ehuss
reference: Update syntax supported by `rustc-link-lib`

This doc already contains a link below pointing to the relevant rustc documentation https://doc.rust-lang.org/nightly/rustc/command-line-arguments.html#-l-link-the-generated-crate-to-a-native-library which has the updated syntax.
2022-05-17 15:20:10 +00:00
Vadim Petrochenkov 53ec56cbae reference: Update syntax supported by rustc-link-lib 2022-05-17 14:51:58 +03:00
bors 6d6dd9d9be Auto merge of #10665 - cuviper:patch-1, r=ehuss
Correct the release dates for 1.61 and 1.62
2022-05-12 23:16:57 +00:00
Josh Stone 51106c9409
Correct the release dates for 1.61 and 1.62 2022-05-12 14:55:27 -07:00
bors 3f052d8eed Auto merge of #10659 - Muscraft:prestabilization-inheritance-docs, r=epage
pre-stabilization documentation for workspace inheritance

This is adding documentation for how we would like users to test workspace inheritance.

This came about from a discussion between `@epage` and I on better ways to document "pre-stabilization" features that are looking for people to test them. One of the ideas was to add some of the documentation to `unstable.md` so that it is all in one area. Having it in one area allows us to link to it so there are testing notes and documentation in one place. It also helps when posting in various places looking for testers as we can link to the nightly docs as needed. One idea was to post in TWiR [under a new table](https://github.com/rust-lang/this-week-in-rust/issues/3236) and this also helps with this.

The new documentation covers
- What we are looking for from testers
- Where to give feedback
- How to test this feature
- An example port as a guide

r? `@epage`
2022-05-12 15:19:04 +00:00
Scott Schafer 6892cc3022 pre-stabilization documentation for workspace inheritance 2022-05-12 10:13:20 -05:00
bors fbe2e689aa Auto merge of #10658 - epage:fix, r=ehuss
test: Make curr_dir work in/out of workspace

### What does this PR try to resolve?

Get snapbox tests passing when testing `cargo` as part of the `rust-lang/rust` workspace via a git submodule.
- When running tests in the `rust-lang/cargo` repo, `file!` is relative to
the crate root and tests are run relative to the crate root and
everything is fine.
- When running tests in the `rust-lang/rust` repo, `file!` is relative to
the workspace root and tests are run relative to the crate root and
there is much sadness.

If we are compiling relative to the crate root, we could make the path
absolute and everything would be dandy but this needs to happen at
compile time.  Didn't see a way to do this.

We could stop using `curr_dir` but that makes the tests a bit noisier
with more overhead for creating a new tests from an existing case.

Since we can reasonly know what all roots will be used for `file!`, we
can just hard code-in support for those two roots.  Much happiness
ensues as everything works with this surgical hack.

### How should we test and review this PR?

I ran the tests in both the `cargo` and `rust` repos.  You can as well.

### Additional information
2022-05-12 14:00:45 +00:00
Ed Page dde4a1c381 test: Make curr_dir work in/out of workspace
When running tests in the `rust-lang/cargo` repo, `file!` is relative to
the crate root and tests are run relative to the crate root and
everything is fine.

When running tests in the `rust-lang/rust` repo, `file!` is relative to
the workspace root and tests are run relative to the crate root and
there is much sadness.

If we are compiling relative to the crate root, we could make the path
absolute and everything would be dandy but this needs to happen at
compile time.  Didn't see a way to do this.

We could stop using `curr_dir` but that makes the tests a bit noisier
with more overhead for creating a new tests from an existing case.

Since we can reasonly know what all roots will be used for `file!`, we
can just hard code-in support for those two roots.  Much happiness
ensues as everything works with this surgical hack.
2022-05-12 03:28:27 -05:00
bors 526f7473f4 Auto merge of #10660 - ehuss:fix-no_cross_doctests-race, r=weihanglo
Fix no_cross_doctests race condition.

The change in #10594 to the `no_cross_doctests` test introduced a race condition. The two `rustc` invocations happen concurrently, which means the order is not deterministic. This adds`_unordered` along with differentiating text to fix the issue.
2022-05-11 23:10:18 +00:00
bors cf09f37d20 Auto merge of #10657 - hi-rustin:rustin-patch-docs-typo, r=weihanglo
Fix typo

See: https://github.com/rust-lang/cargo/pull/10633#discussion_r870130957

r? `@epage`
2022-05-11 21:15:09 +00:00
Eric Huss e952070946 Fix no_cross_doctests race condition. 2022-05-11 14:10:49 -07:00
hi-rustin f6d4039c2a Fix typo
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-05-11 21:08:04 +08:00
bors 23ae8a0a0f Auto merge of #10650 - epage:install, r=ehuss
feat(install): Support `foo@version` like cargo-add

### What does this PR try to resolve?

This aims to make `cargo install` consistent with
- `cargo add foo@version` from #10472
- pkgid changes in #10582
- `cargo yank foo@version` from #10597

It also offers a shorthand for people installing a specific version.

### How should we test and review this PR?

#10582 acted as the FCP for this, see #10597

Documentation updates are split into their own commit to not clog up browsing the code.

Examine the tests to see if they make sense

### Additional information

While the `foo@vewrsion` syntax is the same, each's semantics are different.  We had decided it was better to have the same syntax with different semantics than having the user worry about what syntax they use where.  In `cargo install`s case, it has an
implicit-but-required `=` operand while `cargo-add` allows any operand.

This doesn't use the full `pkgid` syntax because that allows syntax that
is unsupported here.

This doesn't use `cargo-add`s parser because that is for version reqs.

I held off on reusing the parser from `cargo-yank` because they had
different type system needs and the level of duplication didn't seem
worth it (see Rule of Three).
2022-05-11 03:25:36 +00:00
bors 08bef9dfb7 Auto merge of #10649 - Muscraft:fix-typos, r=epage
fix typos found by the `typos-cli` crate

This fixes various typos inside `cargo`. They were found by [`typos-cli`](https://crates.io/crates/typos-cli). A few different typos were left out as they seemed either intentional or were needed. Typos found in `LICENSE-THIRD-PARTY` were left alone as well.

r? `@epage`
2022-05-10 23:58:15 +00:00
bors dd531963ea Auto merge of #10597 - epage:yank, r=ehuss
feat(yank): Support foo@version like cargo-add

### What does this PR try to resolve?

In #10472, cargo-add was merged with support for an inline version
syntax of `cargo add foo@version`.  That also served as the change proposal for
extending that syntax to `cargo yank` for convenience and consistency.

### How should we test and review this PR?

Documentation updates are split into their own commit to not clog up browsing the code.

The ops API is generic enough that this is implemented purely in the command.

For now, the `foo@version` syntax parser is being left in the command, rather than being shared, as we see how the behavior of these different parsers diverge for their target needs to see what makes sense for refactoring.  See also The Rule of Three
- This doesn't use the full `pkgid` syntax (modified in #10582) because that allows syntax that is unsupported here.
- This doesn't use `cargo-add`s parser because that is for version reqs.

Tests were added for various combinations of flags and behavior.

### Additional information

The major difference is that `cargo-add` is specifying a version-req
while `cargo-yank` is specifying a version.  This was originally discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Multiple.20ways.20of.20specifying.20versions) and there seemed to be a desire to have one syntax rather than the user thinking about a syntax per type of version (which users won't always think about).  See also #10582 which extended the pkgid spec syntax and has some more discussion on this general trend.

`cargo-install` will be updated in a subsequent PR.
2022-05-10 21:53:54 +00:00
Scott Schafer cab6d30c1d fix typos found by the typos-cli crate 2022-05-10 16:47:28 -05:00
bors f6434599af Auto merge of #10648 - Muscraft:update-workspace-inheritance-docs, r=epage
add `cargo-features` to unstable docs for workspace inheritance

The unstable docs for workspace inheritance did not include `cargo-features = ["workspace-inheritance"]`. If a user were to follow the docs cargo would throw an error saying to `feature `workspace-inheritance` is required`. It would be better to explicitly add this to the unstable docs and remove it during stabilization.

r? `@epage`
2022-05-10 19:34:45 +00:00