Skip to content

Commit cda5f82

Browse files
committed
add preloading for workspace packages in resolve_with_previous so manifests aren't parsed twice
1 parent 17f8088 commit cda5f82

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

src/cargo/ops/resolve.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ pub fn resolve_with_previous<'cfg>(
408408
registry.lock_patches();
409409
}
410410

411+
// Some packages are already loaded when setting up a workspace. This
412+
// makes it so anything that was already loaded will not be loaded again.
413+
// Without this there were cases where members would be parsed multiple times
414+
ws.preload(registry);
415+
416+
// In case any members were not already loaded or the Workspace is_ephemeral.
411417
for member in ws.members() {
412418
registry.add_sources(Some(member.package_id().source_id()))?;
413419
}

tests/testsuite/features.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,36 +2001,6 @@ For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues
20012001
[WARNING] invalid character `Ⓒ` in feature `ⒶⒷⒸ` in package foo v0.1.0 ([ROOT]/foo), characters must be Unicode XID characters, `+`, or `.` (numbers, `+`, `-`, `_`, `.`, or most letters)
20022002
This was previously accepted but is being phased out; it will become a hard error in a future release.
20032003
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2004-
[WARNING] invalid character `+` in feature `+foo` in package foo v0.1.0 ([ROOT]/foo), the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)
2005-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2006-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2007-
[WARNING] invalid character `-` in feature `-foo` in package foo v0.1.0 ([ROOT]/foo), the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)
2008-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2009-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2010-
[WARNING] invalid character `.` in feature `.foo` in package foo v0.1.0 ([ROOT]/foo), the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)
2011-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2012-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2013-
[WARNING] invalid character `?` in feature `?foo` in package foo v0.1.0 ([ROOT]/foo), the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)
2014-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2015-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2016-
[WARNING] invalid character `¼` in feature `a¼` in package foo v0.1.0 ([ROOT]/foo), characters must be Unicode XID characters, `+`, or `.` (numbers, `+`, `-`, `_`, `.`, or most letters)
2017-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2018-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2019-
[WARNING] invalid character `:` in feature `foo:bar` in package foo v0.1.0 ([ROOT]/foo), characters must be Unicode XID characters, `+`, or `.` (numbers, `+`, `-`, `_`, `.`, or most letters)
2020-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2021-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2022-
[WARNING] invalid character `?` in feature `foo?` in package foo v0.1.0 ([ROOT]/foo), characters must be Unicode XID characters, `+`, or `.` (numbers, `+`, `-`, `_`, `.`, or most letters)
2023-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2024-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2025-
[WARNING] invalid character `Ⓐ` in feature `ⒶⒷⒸ` in package foo v0.1.0 ([ROOT]/foo), the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)
2026-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2027-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2028-
[WARNING] invalid character `Ⓑ` in feature `ⒶⒷⒸ` in package foo v0.1.0 ([ROOT]/foo), characters must be Unicode XID characters, `+`, or `.` (numbers, `+`, `-`, `_`, `.`, or most letters)
2029-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2030-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
2031-
[WARNING] invalid character `Ⓒ` in feature `ⒶⒷⒸ` in package foo v0.1.0 ([ROOT]/foo), characters must be Unicode XID characters, `+`, or `.` (numbers, `+`, `-`, `_`, `.`, or most letters)
2032-
This was previously accepted but is being phased out; it will become a hard error in a future release.
2033-
For more information, see issue #8813 <https://github.com/rust-lang/cargo/issues/8813>, and please leave a comment if this will be a problem for your project.
20342004
[CHECKING] foo v0.1.0 [..]
20352005
[FINISHED] [..]
20362006
")

0 commit comments

Comments
 (0)