Commit graph

11632 commits

Author SHA1 Message Date
Eric Huss
a58725ad00 Use version from rustbuild. 2021-12-06 17:46:46 -08:00
Eric Huss
f5cb79e85b Remove pre_release in version info.
This field is no longer being used, as pre-release versions have
not been used in cargo for quite some time, and I don't anticipate
them ever returning.
2021-12-06 15:19:01 -08:00
Eric Huss
67581052d8 Move cargo's self-version code to a dedicated module. 2021-12-06 14:59:28 -08:00
bors
cf474a5de7 Auto merge of #10133 - joshtriplett:release-short, r=ehuss
Support abbreviating `--release` as `-r`

Of the options people regularly pass to cargo, `--release` seems by far
the most common. Yet even on the command line, we expect people to type
out `--release`.

Add a short version `-r`, and add some tests in the testsuite that
confirm it works.
2021-12-05 19:44:23 +00:00
bors
f9089fc5be Auto merge of #10158 - matklad:depodoc, r=ehuss
doc: nudge towards simple version requirements

Cargo is very ingeniously designed such that the simplest thing you can do when sepcifying a dependency, `time = "1.2.3"`, is also the best thing you can do. However, new Rust folks often overthink this, and use more verbose syntaxes, which at best is unnecessary, and and at worst creates pains downstream. For example, https://github.com/elastic/elasticsearch-rs/blob/master/elasticsearch/Cargo.toml contains a mistrue of default, `~` and `^` requirements, which lets the reader wondering what's going on.

Let's try to help the situation by focusing on default requirements in the docs
2021-12-05 16:00:35 +00:00
Aleksey Kladov
ec3909e254 doc: fix some stale URLs 2021-12-05 14:47:03 +03:00
Aleksey Kladov
7039064d5b doc: nudge towards simple version requirements 2021-12-05 14:47:01 +03:00
bors
0507d9f5ce Auto merge of #10164 - weihanglo:issue-10131, r=ehuss
Upgrade clap to 2.34.0

That includes the fix of preventing panicking on a broken pipe.
accf3d2511

Fixes #10131
2021-12-04 18:41:25 +00:00
Weihang Lo
cc267c7a72
Upgrade clap to 2.34.0
That includes the fix of preventing panicking on a broken pipe.
accf3d2511
2021-12-05 01:33:38 +08:00
bors
d38f20d5b9 Auto merge of #10157 - luqmana:opnotsupp, r=ehuss
Treat EOPNOTSUPP the same as ENOTSUP when ignoring failed flock calls.

On some platforms, `ENOTSUP` and `EOPNOTSUPP` are distinct and it's not consistent which error is returned. e.g. the BSDs will return `EOPNOTSUPP` ([FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=flock&sektion=2#ERRORS), [OpenBSD](https://man.openbsd.org/flock.2#ERRORS)) whereas [macOS](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/flock.2.html) returns `ENOTSUP`.
2021-12-04 16:25:23 +00:00
Aleksey Kladov
7aa646d56e
Update src/doc/src/reference/specifying-dependencies.md
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2021-12-04 19:02:58 +03:00
Aleksey Kladov
519aaa85d7 doc: nudge towards simple version requirements 2021-12-04 11:01:01 +03:00
Josh Triplett
c92d917f31 Update documentation for the -r short option for --release 2021-12-03 22:39:24 -08:00
Luqman Aden
6963df3b94 Treat EOPNOTSUPP the same as ENOTSUP when ignoring failed flock calls. 2021-12-01 14:29:01 -08:00
bors
451a0430c9 Auto merge of #10141 - ehuss:note-rustflags-removal, r=alexcrichton
Add note about RUSTFLAGS removal from build scripts.

The RUSTFLAGS environment variable was removed from build scripts in #9601, but the release notes did not make a note of this change. This adds a highlight to this potentially breaking change.
2021-11-30 17:47:34 +00:00
Eric Huss
cfee33e8b0 Add note about RUSTFLAGS removal from build scripts. 2021-11-30 09:33:59 -08:00
bors
2ad6cb7f5d Auto merge of #10139 - hi-rustin:rustin-patch-clippy, r=Eh2406
Make clippy happy

This expression borrows a reference (`&core::registry::PackageRegistry`) that is immediately dereferenced by the compiler.
2021-11-30 15:01:06 +00:00
hi-rustin
de5efea8b6 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-30 21:26:56 +08:00
bors
294967c53f Auto merge of #10137 - ehuss:lto-pdb-collision-test, r=alexcrichton
Fix some tests with output collisions.

This fixes some tests which run afoul of creating colliding outputs (tracked in #6313). In particular, these tests are creating duplicate pdb files on Windows because they have a binary and a library (dylib) with the same name. This is causing significant issues on rust-lang's CI (https://github.com/rust-lang/rust/issues/81890) where the MSVC linker is failing with a mysterious LNK1201 error. Presumably two LINK.exe processes are trying to write to the same PDB file at the same time, which causes it to fail.

Ideally this shouldn't happen, but I don't really have any ideas on how to resolve it, as the name of the PDB has some importance.

I have not been able to reproduce the LNK1201 error. My hope is that this change will help alleviate the issue, though.

I updated the `doc_all_member_dependency_same_name` test to illustrate that it is hitting a collision, which is a fundamental part of that test (and something we should probably figure out how to resolve in the future).
2021-11-29 19:04:22 +00:00
Eric Huss
2507d53bb6 Fix some tests with output collisions. 2021-11-29 11:04:08 -08:00
bors
26105a45e9 Auto merge of #10109 - hi-rustin:rustin-patch-docs-profile, r=ehuss
Description of the targets that can be applied

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

Adds a description of the targets to which the default profile can be applied.
2021-11-29 18:27:56 +00:00
bors
c5fddb0f56 Auto merge of #10130 - weihanglo:issue-8690, r=alexcrichton
Improve unused patch message when source URLs mismatched

Resolves #8690

`Resolve.unused_patches` does not contains info about which source
URLs they are going to patch. As a result, we cannot provide a precise
message but only list all possible URLs of the packages with the same
name in the resolved graph.

There is a little flaw that if multiple patches are patching the same
package, the source URL of the used one would be shown as a possible
URL in the warning.
2021-11-29 16:29:46 +00:00
bors
533512008a Auto merge of #10132 - ehuss:doctest-xcompile-note, r=alexcrichton
Add a note about doctest xcompile.

This adds a note when running with `--verbose` if doctests are being skipped because they do not support cross-compiling.

I decided to use verbose instead of always displaying it because I felt it could get really noisy.  However, I'm a bit on the fence.  I'm kinda curious what is blocking doctest-xcompile from being stabilized?
2021-11-29 15:48:33 +00:00
Josh Triplett
2f53ca2df1 Support abbreviating --release as -r
Of the options people regularly pass to cargo, `--release` seems by far
the most common. Yet even on the command line, we expect people to type
out `--release`.

Add a short version `-r`, and add some tests in the testsuite that
confirm it works.
2021-11-28 20:25:57 -08:00
Eric Huss
ca3356a25c Add a note about doctest xcompile. 2021-11-28 17:32:11 -08:00
bors
8032ac5ef0 Auto merge of #10124 - matklad:edit-template-url, r=ehuss
book: add edit links to specific pages
2021-11-28 17:03:18 +00:00
Aleksey Kladov
3028bbac25 book: add edit links to specific pages 2021-11-28 11:41:17 +03:00
hi-rustin
c066a2384f Description of the targets that can be applied
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-28 14:00:05 +08:00
Weihang Lo
91791c4fb1
Improve unused patch message when source URLs mismatched
`Resolve.unused_patches` does not contains info about which source
URLs they are going to patch. As a result, we cannot provide a precise
message but only list all possible URLs of the packages with the same
name in the resolved graph.

There is a little flaw that if multiple patches are patching the same
package, the source URL of the used one would be shown as a possible
URL in the warning.
2021-11-28 09:20:06 +08:00
bors
b85ad15963 Auto merge of #10093 - hi-rustin:rustin-patch-rustc, r=ehuss
Add crate type flag to rustc command

part of https://github.com/rust-lang/cargo/issues/10083

- Add crate type flag to rustc command
- Add tests
- Update docs
2021-11-26 15:30:19 +00:00
bors
7f08ace4f1 Auto merge of #10117 - estebank:update-test-for-emoji, r=ehuss
Change test to not trigger emoji error

This change is needed to land rust-lang/rust#88781, as it changes the
handling of emojis in source code to treat them as identifiers.
2021-11-24 17:54:39 +00:00
Esteban Kuber
0dfe70f7e1 Change test to not trigger emoji error
This change is needed to land rust-lang/rust#88781, as it changes the
handling of emojis in source code to treat them as identifiers.
2021-11-24 17:07:40 +00:00
hi-rustin
137f9bc3d1 Add crate-type unstable doc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-23 23:21:39 +08:00
hi-rustin
660ce6bba4 Add tests
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-23 22:58:18 +08:00
bors
e1fb17631e Auto merge of #10110 - hi-rustin:rustin-patch-build-test, r=alexcrichton
re-enable lto_build test on 32-bit MSVC

re-enable lto_build test on 32-bit MSVC. Because https://github.com/rust-lang/rust/pull/27224 landed.
2021-11-22 16:53:06 +00:00
bors
a2c6ec7522 Auto merge of #10103 - ehuss:tree-cycle, r=alexcrichton
Fix a couple issues with cyclic features and dev-dependencies

This fixes two issues with cyclic features and dev-dependencies:

* `cargo tree` would enter an infinite loop for cyclic features.
* The resolver would return a confusing error if a cyclic dev-dependency attempted to enable a feature on its parent that resulted in a cycle.  This fixes it to resolve correctly.

Fixes #10101
2021-11-22 16:18:31 +00:00
hi-rustin
a22a68e937 re-enabled lto_build test on 32-bit MSVC
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-22 22:12:48 +08:00
bors
df8cda0a12 Auto merge of #10107 - hi-rustin:rustin-patch-install, r=ehuss
Add --message-format for install command

close https://github.com/rust-lang/cargo/issues/10104
2021-11-21 16:13:58 +00:00
bors
934bc6143e Auto merge of #10106 - russweas:master, r=ehuss
Update curl dependency, remove M1 macOS build error note

Curl subversion 41 includes a workaround for the m1 macOS build error.
See https://github.com/rust-lang/rust/issues/90342#issuecomment-974698158
2021-11-21 15:31:50 +00:00
bors
fa107dda36 Auto merge of #10105 - hi-rustin:rustin-patch-clippy, r=ehuss
Make clippy happy

Make clippy happy. Remove redundant clone.
2021-11-21 14:45:20 +00:00
hi-rustin
0c5f348bc2 Add crate type flag to rustc command
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 12:31:00 +08:00
hi-rustin
890b0e888b Update install doc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 12:22:02 +08:00
hi-rustin
6351472a80 Add --message-format for install
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 12:16:50 +08:00
Russ Weas
22ff7ac47c Update curl dependency, remove M1 macOS build error note 2021-11-20 22:04:58 -06:00
hi-rustin
a0dffe0f43 Make clippy happy
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-21 11:40:31 +08:00
bors
7a947ae523 Auto merge of #10043 - jyn514:hard-error, r=ehuss
Give a hard error if `-Zrustdoc-scrape-examples` is missing a flag

It's the same as if the option wasn't passed, and it makes it difficult to
figure out why rustdoc isn't generating examples.

Fixes https://github.com/rust-lang/cargo/issues/10042 (cc `@willcrichton)`
2021-11-20 18:23:22 +00:00
Eric Huss
2eee644c68 Fix resolve error with cyclic dev-dependency features.
There is a convoluted situation where a cyclic dev-dependency attempts
to enable a feature on its parent. It would result in a confusing error
saying a package didn't have a feature.

This check was intended only for CLI features, not features passed
through the dependency graph.
2021-11-19 18:10:10 -08:00
Eric Huss
d7ab4a6598 cargo tree: Fix stack overflow on cyclic features. 2021-11-19 18:07:31 -08:00
bors
5907635259 Auto merge of #10097 - Eh2406:silly, r=alexcrichton
silly fix, pointer to the empty slice

Just a silly thing. I don't know when this was fixed. NLL? But we no longer need a real Vec to produce a pointer to the empty slice.
2021-11-18 23:00:05 +00:00
Jacob Finkelman
2f7009f52a silly fix 2021-11-18 22:46:28 +00:00