Skip to content

Commit f16291d

Browse files
committed
Fill ops::registry::transmit with the right value
1 parent 8495548 commit f16291d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/cargo/core/dependency.rs

+6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ impl Dependency {
151151
&self.source_id == id.get_source_id()))
152152
}
153153

154+
/// If none, this dependencies must be built for all platforms.
155+
/// If some, it must only be built for the specified platform.
156+
pub fn get_only_for_platform(&self) -> Option<&str> {
157+
self.only_for_platform.as_ref().map(|s| s.as_slice())
158+
}
159+
154160
/// Returns true if the dependency should be built for this platform.
155161
pub fn is_active_for_platform(&self, platform: &str) -> bool {
156162
match self.only_for_platform {

src/cargo/ops/registry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn transmit(pkg: &Package, tarball: &Path, registry: &mut Registry)
7272
name: dep.get_name().to_string(),
7373
features: dep.get_features().to_vec(),
7474
version_req: dep.get_version_req().to_string(),
75-
target: None, // FIXME: fill this out
75+
target: dep.get_only_for_platform().map(|s| s.to_string()),
7676
}
7777
}).collect::<Vec<NewCrateDependency>>();
7878
let manifest = pkg.get_manifest();

0 commit comments

Comments
 (0)