Skip to content

Commit d410d4a

Browse files
committed
Auto merge of #16412 - lnicola:sync-from-rust, r=lnicola
internal: Sync from downstream
2 parents 47b0f46 + 5607714 commit d410d4a

File tree

1 file changed

+16
-2
lines changed
  • crates/proc-macro-srv/proc-macro-test

1 file changed

+16
-2
lines changed

crates/proc-macro-srv/proc-macro-test/build.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,26 @@ fn main() {
9292
panic!("proc-macro-test-impl failed to build");
9393
}
9494

95+
// Old Package ID Spec
96+
let repr = format!("{name} {version}");
97+
// New Package Id Spec since rust-lang/cargo#13311
98+
let pkgid = String::from_utf8(
99+
Command::new(toolchain::cargo())
100+
.current_dir(&staging_dir)
101+
.args(["pkgid", name])
102+
.output()
103+
.unwrap()
104+
.stdout,
105+
)
106+
.unwrap();
107+
let pkgid = pkgid.trim();
108+
95109
let mut artifact_path = None;
96110
for message in Message::parse_stream(output.stdout.as_slice()) {
97111
if let Message::CompilerArtifact(artifact) = message.unwrap() {
98112
if artifact.target.kind.contains(&"proc-macro".to_string()) {
99-
let repr = format!("{name} {version}");
100-
if artifact.package_id.repr.starts_with(&repr) {
113+
if artifact.package_id.repr.starts_with(&repr) || artifact.package_id.repr == pkgid
114+
{
101115
artifact_path = Some(PathBuf::from(&artifact.filenames[0]));
102116
}
103117
}

0 commit comments

Comments
 (0)