Skip to content

Commit 47e19f0

Browse files
authored
Merge branch 'master' into doc_versioning
2 parents 27987b6 + c3abcfe commit 47e19f0

File tree

184 files changed

+4221
-2006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4221
-2006
lines changed

.github/ISSUE_TEMPLATE/tracking_issue.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ accepted feature or RFC from implementation to stabilization. Please do not
1010
file a tracking issue until the feature or RFC has been approved.
1111
-->
1212

13-
**About tracking issues**
14-
15-
Tracking issues are used to record the overall progress of implementation.
16-
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
17-
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
18-
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
19-
2013
**Summary**
2114

15+
RFC: [#NNNN](https://github.com/rust-lang/rfcs/pull/NNNN) <!-- If this is an RFC -->
2216
Original issue: #NNNN <!-- if there is a related issue that spawned this feature -->
2317
Implementation: #NNNN <!-- link to the PR that implemented this feature if applicable -->
2418
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#my-feature
@@ -32,3 +26,10 @@ Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#m
3226
**Future extensions**
3327

3428
<!-- An optional section where you can mention where the feature may be extended in the future, but is explicitly not intended to address. -->
29+
30+
**About tracking issues**
31+
32+
Tracking issues are used to record the overall progress of implementation.
33+
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
34+
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
35+
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

.github/workflows/contrib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install mdbook
1515
run: |
1616
mkdir mdbook
17-
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.3/mdbook-v0.4.3-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
17+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
1818
echo `pwd`/mdbook >> $GITHUB_PATH
1919
- name: Deploy docs
2020
run: |

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- run: cd src/doc/semver-check && cargo +stable run
104104
- run: |
105105
mkdir mdbook
106-
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.3.7/mdbook-v0.3.7-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
106+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
107107
echo `pwd`/mdbook >> $GITHUB_PATH
108108
- run: cargo doc --no-deps
109109
- run: cd src/doc && mdbook build --dest-dir ../../target/doc

CHANGELOG.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,70 @@
11
# Changelog
22

3+
## Cargo 1.51 (2021-03-25)
4+
[75d5d8cf...HEAD](https://github.com/rust-lang/cargo/compare/75d5d8cf...HEAD)
5+
6+
### Added
7+
8+
### Changed
9+
10+
### Fixed
11+
12+
### Nightly only
13+
314
## Cargo 1.50 (2021-02-11)
4-
[8662ab42...HEAD](https://github.com/rust-lang/cargo/compare/8662ab42...HEAD)
15+
[8662ab42...rust-1.50.0](https://github.com/rust-lang/cargo/compare/8662ab42...rust-1.50.0)
516

617
### Added
718
- Added the `doc` field to `cargo metadata`, which indicates if a target is
819
documented.
920
[#8869](https://github.com/rust-lang/cargo/pull/8869)
21+
- Added `RUSTC_WORKSPACE_WRAPPER`, an alternate RUSTC wrapper that only runs
22+
for the local workspace packages, and caches its artifacts independently of
23+
non-wrapped builds.
24+
[#8976](https://github.com/rust-lang/cargo/pull/8976)
25+
- Added `--workspace` to `cargo update` to update only the workspace members,
26+
and not their dependencies. This is particularly useful if you update the
27+
version in `Cargo.toml` and want to update `Cargo.lock` without running any
28+
other commands.
29+
[#8725](https://github.com/rust-lang/cargo/pull/8725)
1030

1131
### Changed
1232
- `.crate` files uploaded to a registry are now built with reproducible
1333
settings, so that the same `.crate` file created on different machines
1434
should be identical.
1535
[#8864](https://github.com/rust-lang/cargo/pull/8864)
36+
- Git dependencies that specify more than one of `branch`, `tag`, or `rev` are
37+
now rejected.
38+
[#8984](https://github.com/rust-lang/cargo/pull/8984)
39+
- The `rerun-if-changed` build script directive can now point to a directory,
40+
in which case Cargo will check if any file in that directory changes.
41+
[#8973](https://github.com/rust-lang/cargo/pull/8973)
42+
- Slightly optimize `cargo vendor`
43+
[#8937](https://github.com/rust-lang/cargo/pull/8937)
44+
- If Cargo cannot determine the username or email address, `cargo new` will no
45+
longer fail, and instead create an empty authors list.
46+
[#8912](https://github.com/rust-lang/cargo/pull/8912)
47+
- Add period to allowed feature name characters.
48+
[#8932](https://github.com/rust-lang/cargo/pull/8932)
49+
- The progress bar width has been reduced to provide more room to display the
50+
crates currently being built.
51+
[#8892](https://github.com/rust-lang/cargo/pull/8892)
52+
- `cargo new` will now support `includeIf` directives in `.gitconfig` to match
53+
the correct directory when determining the username and email address.
54+
[#8886](https://github.com/rust-lang/cargo/pull/8886)
1655

1756
### Fixed
57+
- Fixed `cargo metadata` and `cargo tree` to only download packages for the
58+
requested target.
59+
[#8987](https://github.com/rust-lang/cargo/pull/8987)
60+
- Updated libgit2, which brings in many fixes, particularly fixing a zlib
61+
error that occasionally appeared on 32-bit systems.
62+
[#8998](https://github.com/rust-lang/cargo/pull/8998)
63+
- Fixed stack overflow with a circular dev-dependency that uses the `links`
64+
field.
65+
[#8969](https://github.com/rust-lang/cargo/pull/8969)
66+
- Fixed `cargo publish` failing on some filesystems, particularly 9p on WSL2.
67+
[#8950](https://github.com/rust-lang/cargo/pull/8950)
1868

1969
### Nightly only
2070
- Allow `resolver="1"` to specify the original feature resolution behavior.
@@ -23,6 +73,14 @@
2373
and `cargo:rustc-link-arg` build script options.
2474
[docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#extra-link-arg)
2575
[#8441](https://github.com/rust-lang/cargo/pull/8441)
76+
- Implemented external credential process support, and added `cargo logout`.
77+
([RFC 2730](https://github.com/rust-lang/rfcs/blob/master/text/2730-cargo-token-from-process.md))
78+
([docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#credential-process))
79+
[#8934](https://github.com/rust-lang/cargo/pull/8934)
80+
- Fix panic with `-Zbuild-std` and no roots.
81+
[#8942](https://github.com/rust-lang/cargo/pull/8942)
82+
- Set docs.rs as the default extern-map for crates.io
83+
[#8877](https://github.com/rust-lang/cargo/pull/8877)
2684

2785
## Cargo 1.49 (2020-12-31)
2886
[75615f8e...rust-1.49.0](https://github.com/rust-lang/cargo/compare/75615f8e...rust-1.49.0)
@@ -79,8 +137,6 @@
79137
- Fixed the new feature resolver downloading extra dependencies that weren't
80138
strictly necessary.
81139
[#8823](https://github.com/rust-lang/cargo/pull/8823)
82-
- Vendored builds now work with `-Zbuild-std`.
83-
[#8834](https://github.com/rust-lang/cargo/pull/8834)
84140

85141
## Cargo 1.48 (2020-11-19)
86142
[51b66125...rust-1.48.0](https://github.com/rust-lang/cargo/compare/51b66125...rust-1.48.0)

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo"
3-
version = "0.51.0"
3+
version = "0.52.0"
44
edition = "2018"
55
authors = ["Yehuda Katz <[email protected]>",
66
"Carl Lerche <[email protected]>",
@@ -22,7 +22,7 @@ path = "src/cargo/lib.rs"
2222
atty = "0.2"
2323
bytesize = "1.0"
2424
cargo-platform = { path = "crates/cargo-platform", version = "0.1.1" }
25-
crates-io = { path = "crates/crates-io", version = "0.31.1" }
25+
crates-io = { path = "crates/crates-io", version = "0.33.0" }
2626
crossbeam-utils = "0.8"
2727
crypto-hash = "0.3.1"
2828
curl = { version = "0.4.23", features = ["http2"] }
@@ -32,8 +32,8 @@ pretty_env_logger = { version = "0.4", optional = true }
3232
anyhow = "1.0"
3333
filetime = "0.2.9"
3434
flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
35-
git2 = "0.13.12"
36-
git2-curl = "0.14.0"
35+
git2 = "0.13.16"
36+
git2-curl = "0.14.1"
3737
glob = "0.3.0"
3838
hex = "0.4"
3939
home = "0.5"
@@ -44,7 +44,7 @@ jobserver = "0.1.21"
4444
lazycell = "1.2.0"
4545
libc = "0.2"
4646
log = "0.4.6"
47-
libgit2-sys = "0.12.14"
47+
libgit2-sys = "0.12.18"
4848
memchr = "2.1.3"
4949
num_cpus = "1.0"
5050
opener = "0.4"

crates/cargo-test-support/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ cargo = { path = "../.." }
1313
cargo-test-macro = { path = "../cargo-test-macro" }
1414
filetime = "0.2"
1515
flate2 = { version = "1.0", default-features = false, features = ["zlib"] }
16-
git2 = "0.13"
16+
git2 = "0.13.16"
1717
glob = "0.3"
1818
lazy_static = "1.0"
1919
remove_dir_all = "0.5"
2020
serde_json = "1.0"
2121
tar = { version = "0.4.18", default-features = false }
22+
toml = "0.5.7"
2223
url = "2.0"

crates/cargo-test-support/src/git.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use some of the helper functions in this file to interact with the repository.
4141
use crate::{path2url, project, Project, ProjectBuilder};
4242
use std::fs;
4343
use std::path::{Path, PathBuf};
44+
use std::sync::Once;
4445
use url::Url;
4546

4647
#[must_use]
@@ -124,11 +125,25 @@ impl Repository {
124125

125126
/// Initialize a new repository at the given path.
126127
pub fn init(path: &Path) -> git2::Repository {
128+
default_search_path();
127129
let repo = t!(git2::Repository::init(path));
128130
default_repo_cfg(&repo);
129131
repo
130132
}
131133

134+
fn default_search_path() {
135+
use crate::paths::GLOBAL_ROOT;
136+
use git2::{opts::set_search_path, ConfigLevel};
137+
static INIT: Once = Once::new();
138+
INIT.call_once(|| unsafe {
139+
let path = GLOBAL_ROOT.join("blank_git_search_path");
140+
t!(set_search_path(ConfigLevel::System, &path));
141+
t!(set_search_path(ConfigLevel::Global, &path));
142+
t!(set_search_path(ConfigLevel::XDG, &path));
143+
t!(set_search_path(ConfigLevel::ProgramData, &path));
144+
})
145+
}
146+
132147
fn default_repo_cfg(repo: &git2::Repository) {
133148
let mut cfg = t!(repo.config());
134149
t!(cfg.set_str("user.email", "[email protected]"));

crates/cargo-test-support/src/paths.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::sync::Mutex;
1414
static CARGO_INTEGRATION_TEST_DIR: &str = "cit";
1515

1616
lazy_static! {
17-
static ref GLOBAL_ROOT: PathBuf = {
17+
pub static ref GLOBAL_ROOT: PathBuf = {
1818
let mut path = t!(env::current_exe());
1919
path.pop(); // chop off exe name
2020
path.pop(); // chop off 'debug'
@@ -127,10 +127,8 @@ impl CargoPathExt for Path {
127127
if let Err(e) = remove_dir_all::remove_dir_all(self) {
128128
panic!("failed to remove {:?}: {:?}", self, e)
129129
}
130-
} else {
131-
if let Err(e) = fs::remove_file(self) {
132-
panic!("failed to remove {:?}: {:?}", self, e)
133-
}
130+
} else if let Err(e) = fs::remove_file(self) {
131+
panic!("failed to remove {:?}: {:?}", self, e)
134132
}
135133
}
136134

crates/cargo-test-support/src/registry.rs

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ pub struct Package {
146146
invalid_json: bool,
147147
proc_macro: bool,
148148
links: Option<String>,
149+
rust_version: Option<String>,
150+
cargo_features: Vec<String>,
149151
}
150152

151153
#[derive(Clone)]
@@ -247,6 +249,8 @@ impl Package {
247249
invalid_json: false,
248250
proc_macro: false,
249251
links: None,
252+
rust_version: None,
253+
cargo_features: Vec::new(),
250254
}
251255
}
252256

@@ -363,6 +367,12 @@ impl Package {
363367
self
364368
}
365369

370+
/// Specify a minimal Rust version.
371+
pub fn rust_version(&mut self, rust_version: &str) -> &mut Package {
372+
self.rust_version = Some(rust_version.into());
373+
self
374+
}
375+
366376
/// Causes the JSON line emitted in the index to be invalid, presumably
367377
/// causing Cargo to skip over this version.
368378
pub fn invalid_json(&mut self, invalid: bool) -> &mut Package {
@@ -375,6 +385,11 @@ impl Package {
375385
self
376386
}
377387

388+
pub fn cargo_feature(&mut self, feature: &str) -> &mut Package {
389+
self.cargo_features.push(feature.to_owned());
390+
self
391+
}
392+
378393
/// Creates the package and place it in the registry.
379394
///
380395
/// This does not actually use Cargo's publishing system, but instead
@@ -502,15 +517,29 @@ impl Package {
502517
}
503518

504519
fn append_manifest<W: Write>(&self, ar: &mut Builder<W>) {
505-
let mut manifest = format!(
520+
let mut manifest = String::new();
521+
522+
if !self.cargo_features.is_empty() {
523+
manifest.push_str(&format!(
524+
"cargo-features = {}\n\n",
525+
toml::to_string(&self.cargo_features).unwrap()
526+
));
527+
}
528+
529+
manifest.push_str(&format!(
506530
r#"
507531
[package]
508532
name = "{}"
509533
version = "{}"
510534
authors = []
511535
"#,
512536
self.name, self.vers
513-
);
537+
));
538+
539+
if let Some(version) = &self.rust_version {
540+
manifest.push_str(&format!("rust-version = \"{}\"", version));
541+
}
542+
514543
for dep in self.deps.iter() {
515544
let target = match dep.target {
516545
None => String::new(),

crates/crates-io/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "crates-io"
3-
version = "0.31.1"
3+
version = "0.33.0"
44
edition = "2018"
55
authors = ["Alex Crichton <[email protected]>"]
66
license = "MIT OR Apache-2.0"

0 commit comments

Comments
 (0)