File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
crates/proc-macro-srv/proc-macro-test Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments