Skip to content

Commit e5a27db

Browse files
committed
Remove libiconv workaround for Apple platforms on Rust 1.66+
1 parent 9bbbfa2 commit e5a27db

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/zig.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,12 @@ impl Zig {
747747
) -> Result<()> {
748748
for target in &cargo.target {
749749
if target.contains("apple") {
750+
let rustc_ver = rustc_version::version()?;
751+
if (rustc_ver.major, rustc_ver.minor) >= (1, 66) {
752+
// Rust 1.66.0+ doesn't pull in libiconv on Apple platforms by default
753+
// See https://github.com/rust-lang/rust/pull/103277/
754+
return Ok(());
755+
}
750756
let target_dir = if let Some(target_dir) = cargo.target_dir.clone() {
751757
target_dir.join(target)
752758
} else {
@@ -755,9 +761,10 @@ impl Zig {
755761
// cargo install doesn't pass a manifest path so `Cargo.toml` in cwd may not exist
756762
continue;
757763
}
758-
let mut metadata_cmd = cargo_metadata::MetadataCommand::new();
759-
metadata_cmd.manifest_path(manifest_path);
760-
let metadata = metadata_cmd.exec()?;
764+
let metadata = cargo_metadata::MetadataCommand::new()
765+
.manifest_path(manifest_path)
766+
.no_deps()
767+
.exec()?;
761768
metadata.target_directory.into_std_path_buf().join(target)
762769
};
763770
let profile = match cargo.profile.as_deref() {

0 commit comments

Comments
 (0)