Skip to content

Commit 766c3bb

Browse files
committed
Merge branch 'master' of github.com:rust-lang/cargo into unknown-feature-resolver-1
2 parents 2762dcd + 6ca6dd0 commit 766c3bb

Some content is hidden

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

58 files changed

+877
-271
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
other: i686-pc-windows-gnu
5555
steps:
5656
- uses: actions/checkout@v2
57+
- name: Update Rustup (temporary workaround)
58+
run: rustup self update
59+
shell: bash
60+
if: startsWith(matrix.os, 'windows')
5761
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
5862
- run: rustup target add ${{ matrix.other }}
5963
- run: rustup component add rustc-dev llvm-tools-preview rust-docs

CHANGELOG.md

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,47 @@
11
# Changelog
22

3-
## Cargo 1.53 (2021-06-17)
4-
[90691f2b...HEAD](https://github.com/rust-lang/cargo/compare/90691f2b...HEAD)
3+
## Cargo 1.54 (2021-07-29)
4+
[4369396c...HEAD](https://github.com/rust-lang/cargo/compare/4369396c...HEAD)
55

66
### Added
77

8+
- Fetching from a git repository (such as the crates.io index) now displays
9+
the network transfer rate.
10+
[#9395](https://github.com/rust-lang/cargo/pull/9395)
11+
812
### Changed
913

14+
### Fixed
15+
16+
- Fixed `package.exclude` in `Cargo.toml` using inverted exclusions
17+
(`!somefile`) when not in a git repository or when vendoring a dependency.
18+
[#9186](https://github.com/rust-lang/cargo/pull/9186)
19+
- Dep-info files now adjust build script `rerun-if-changed` paths to be
20+
absolute paths.
21+
[#9421](https://github.com/rust-lang/cargo/pull/9421)
22+
23+
### Nightly only
24+
25+
- Added `report` subcommand, and changed `cargo
26+
describe-future-incompatibilitie` to `cargo report
27+
future-incompatibilities`.
28+
[#9438](https://github.com/rust-lang/cargo/pull/9438)
29+
30+
31+
## Cargo 1.53 (2021-06-17)
32+
[90691f2b...rust-1.53.0](https://github.com/rust-lang/cargo/compare/90691f2b...rust-1.53.0)
33+
34+
### Added
35+
36+
### Changed
1037
- 🔥 Cargo now supports git repositories where the default `HEAD` branch is not
1138
"master". This also includes a switch to the version 3 `Cargo.lock` format
1239
which can handle default branches correctly.
1340
[#9133](https://github.com/rust-lang/cargo/pull/9133)
14-
- 🔥 macOS targets now default to `unpacked` debuginfo.
41+
[#9397](https://github.com/rust-lang/cargo/pull/9397)
42+
[#9384](https://github.com/rust-lang/cargo/pull/9384)
43+
[#9392](https://github.com/rust-lang/cargo/pull/9392)
44+
- 🔥 macOS targets now default to `unpacked` split-debuginfo.
1545
[#9298](https://github.com/rust-lang/cargo/pull/9298)
1646
- ❗ The `authors` field is no longer included in `Cargo.toml` for new
1747
projects.
@@ -22,17 +52,49 @@
2252
different toolchain versions. There are shared, unversioned files (such as
2353
the search index) that can become broken when using different versions.
2454
[#8640](https://github.com/rust-lang/cargo/pull/8640)
55+
[#9404](https://github.com/rust-lang/cargo/pull/9404)
56+
- Improved error messages when path dependency/workspace member is missing.
57+
[#9368](https://github.com/rust-lang/cargo/pull/9368)
2558

2659
### Fixed
60+
- Fixed `cargo doc` detecting if the documentation needs to be rebuilt when
61+
changing some settings such as features.
62+
[#9419](https://github.com/rust-lang/cargo/pull/9419)
63+
- `cargo doc` now deletes the output directory for the package before running
64+
rustdoc to clear out any stale files.
65+
[#9419](https://github.com/rust-lang/cargo/pull/9419)
66+
- Fixed the `-C metadata` value to always include all information for all
67+
builds. Previously, in some situations, the hash only included the package
68+
name and version. This fixes some issues, such as incremental builds with
69+
split-debuginfo on macOS corrupting the incremental cache in some cases.
70+
[#9418](https://github.com/rust-lang/cargo/pull/9418)
71+
- Fixed man pages not working on Windows if `man` is in `PATH`.
72+
[#9378](https://github.com/rust-lang/cargo/pull/9378)
73+
- The `rustc` cache is now aware of `RUSTC_WRAPPER` and `RUSTC_WORKSPACE_WRAPPER`.
74+
[#9348](https://github.com/rust-lang/cargo/pull/9348)
75+
- Track the `CARGO` environment variable in the rebuild fingerprint if the
76+
code uses `env!("CARGO")`.
77+
[#9363](https://github.com/rust-lang/cargo/pull/9363)
2778

2879
### Nightly only
2980
- Fixed config includes not working.
3081
[#9299](https://github.com/rust-lang/cargo/pull/9299)
3182
- Emit note when `--future-incompat-report` had nothing to report.
3283
[#9263](https://github.com/rust-lang/cargo/pull/9263)
3384
- Error messages for nightly features flags (like `-Z` and `cargo-features`)
34-
should now provide more information.
85+
now provides more information.
3586
[#9290](https://github.com/rust-lang/cargo/pull/9290)
87+
- Added the ability to set the target for an individual package in `Cargo.toml`.
88+
[docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#per-package-target)
89+
[#9030](https://github.com/rust-lang/cargo/pull/9030)
90+
- Fixed build-std updating the index on every build.
91+
[#9393](https://github.com/rust-lang/cargo/pull/9393)
92+
- `-Z help` now displays all the `-Z` options.
93+
[#9369](https://github.com/rust-lang/cargo/pull/9369)
94+
- Added `-Zallow-features` to specify which nightly features are allowed to be used.
95+
[#9283](https://github.com/rust-lang/cargo/pull/9283)
96+
- Added `cargo config` subcommand.
97+
[#9302](https://github.com/rust-lang/cargo/pull/9302)
3698

3799
## Cargo 1.52 (2021-05-06)
38100
[34170fcd...rust-1.52.0](https://github.com/rust-lang/cargo/compare/34170fcd...rust-1.52.0)

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo"
3-
version = "0.54.0"
3+
version = "0.55.0"
44
edition = "2018"
55
authors = ["Yehuda Katz <wycats@gmail.com>",
66
"Carl Lerche <me@carllerche.com>",
@@ -61,7 +61,7 @@ tempfile = "3.0"
6161
termcolor = "1.1"
6262
toml = "0.5.7"
6363
unicode-xid = "0.2.0"
64-
url = "2.0"
64+
url = "2.2.2"
6565
walkdir = "2.2"
6666
clap = "2.31.2"
6767
unicode-width = "0.1.5"

crates/cargo-test-macro/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ pub fn cargo_test(attr: TokenStream, item: TokenStream) -> TokenStream {
3131
}
3232
};
3333

34-
let mut new_body =
35-
to_token_stream("let _test_guard = cargo_test_support::paths::init_root();");
34+
let mut new_body = to_token_stream(
35+
r#"let _test_guard = {
36+
let tmp_dir = option_env!("CARGO_TARGET_TMPDIR");
37+
cargo_test_support::paths::init_root(tmp_dir)
38+
};"#,
39+
);
3640

3741
// If this is a `build_std` test (aka `tests/build-std/*.rs`) then they
3842
// only run on nightly and they only run when specifically instructed to

crates/cargo-test-support/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ remove_dir_all = "0.5"
2121
serde_json = "1.0"
2222
tar = { version = "0.4.18", default-features = false }
2323
toml = "0.5.7"
24-
url = "2.0"
24+
url = "2.2.2"

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,12 @@ pub fn init(path: &Path) -> git2::Repository {
132132
}
133133

134134
fn default_search_path() {
135-
use crate::paths::GLOBAL_ROOT;
135+
use crate::paths::global_root;
136136
use git2::{opts::set_search_path, ConfigLevel};
137+
137138
static INIT: Once = Once::new();
138139
INIT.call_once(|| unsafe {
139-
let path = GLOBAL_ROOT.join("blank_git_search_path");
140+
let path = global_root().join("blank_git_search_path");
140141
t!(set_search_path(ConfigLevel::System, &path));
141142
t!(set_search_path(ConfigLevel::Global, &path));
142143
t!(set_search_path(ConfigLevel::XDG, &path));

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

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

1616
lazy_static! {
17-
pub static ref GLOBAL_ROOT: PathBuf = {
18-
let mut path = t!(env::current_exe());
19-
path.pop(); // chop off exe name
20-
path.pop(); // chop off 'debug'
21-
22-
// If `cargo test` is run manually then our path looks like
23-
// `target/debug/foo`, in which case our `path` is already pointing at
24-
// `target`. If, however, `cargo test --target $target` is used then the
25-
// output is `target/$target/debug/foo`, so our path is pointing at
26-
// `target/$target`. Here we conditionally pop the `$target` name.
27-
if path.file_name().and_then(|s| s.to_str()) != Some("target") {
28-
path.pop();
29-
}
30-
31-
path.push(CARGO_INTEGRATION_TEST_DIR);
32-
path.mkdir_p();
33-
path
34-
};
17+
// TODO: Use `SyncOnceCell` when stable
18+
static ref GLOBAL_ROOT: Mutex<Option<PathBuf>> = Mutex::new(None);
3519

3620
static ref TEST_ROOTS: Mutex<HashMap<String, PathBuf>> = Default::default();
3721
}
3822

23+
/// This is used when running cargo is pre-CARGO_TARGET_TMPDIR
24+
/// TODO: Remove when CARGO_TARGET_TMPDIR grows old enough.
25+
fn global_root_legacy() -> PathBuf {
26+
let mut path = t!(env::current_exe());
27+
path.pop(); // chop off exe name
28+
path.pop(); // chop off "deps"
29+
path.push("tmp");
30+
path.mkdir_p();
31+
path
32+
}
33+
34+
fn set_global_root(tmp_dir: Option<&'static str>) {
35+
let mut lock = GLOBAL_ROOT.lock().unwrap();
36+
if lock.is_none() {
37+
let mut root = match tmp_dir {
38+
Some(tmp_dir) => PathBuf::from(tmp_dir),
39+
None => global_root_legacy(),
40+
};
41+
42+
root.push(CARGO_INTEGRATION_TEST_DIR);
43+
*lock = Some(root);
44+
}
45+
}
46+
47+
pub fn global_root() -> PathBuf {
48+
let lock = GLOBAL_ROOT.lock().unwrap();
49+
match lock.as_ref() {
50+
Some(p) => p.clone(),
51+
None => unreachable!("GLOBAL_ROOT not set yet"),
52+
}
53+
}
54+
3955
// We need to give each test a unique id. The test name could serve this
4056
// purpose, but the `test` crate doesn't have a way to obtain the current test
4157
// name.[*] Instead, we used the `cargo-test-macro` crate to automatically
@@ -52,14 +68,15 @@ pub struct TestIdGuard {
5268
_private: (),
5369
}
5470

55-
pub fn init_root() -> TestIdGuard {
71+
pub fn init_root(tmp_dir: Option<&'static str>) -> TestIdGuard {
5672
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
5773

58-
let id = NEXT_ID.fetch_add(1, Ordering::Relaxed);
74+
let id = NEXT_ID.fetch_add(1, Ordering::SeqCst);
5975
TEST_ID.with(|n| *n.borrow_mut() = Some(id));
6076

6177
let guard = TestIdGuard { _private: () };
6278

79+
set_global_root(tmp_dir);
6380
let r = root();
6481
r.rm_rf();
6582
r.mkdir_p();
@@ -80,7 +97,10 @@ pub fn root() -> PathBuf {
8097
order to be able to use the crate root.",
8198
)
8299
});
83-
GLOBAL_ROOT.join(&format!("t{}", id))
100+
101+
let mut root = global_root();
102+
root.push(&format!("t{}", id));
103+
root
84104
}
85105

86106
pub fn home() -> PathBuf {

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,7 @@ impl RegistryBuilder {
178178
}
179179

180180
if self.replace_crates_io {
181-
init_registry(
182-
registry_path(),
183-
dl_url().into_string(),
184-
api_url(),
185-
api_path(),
186-
);
181+
init_registry(registry_path(), dl_url().into(), api_url(), api_path());
187182
}
188183

189184
if self.alternative {

crates/cargo-util/src/paths.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
161161
.with_context(|| format!("failed to write `{}`", path.display()))
162162
}
163163

164-
/// Equivalent to [`write`], but does not write anything if the file contents
164+
/// Equivalent to [`write()`], but does not write anything if the file contents
165165
/// are identical to the given contents.
166166
pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()> {
167167
(|| -> Result<()> {
@@ -184,7 +184,7 @@ pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) ->
184184
Ok(())
185185
}
186186

187-
/// Equivalent to [`write`], but appends to the end instead of replacing the
187+
/// Equivalent to [`write()`], but appends to the end instead of replacing the
188188
/// contents.
189189
pub fn append(path: &Path, contents: &[u8]) -> Result<()> {
190190
(|| -> Result<()> {

crates/mdman/Cargo.lock

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)