Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue 529 #535

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/lock_file/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,16 @@ fn project_platforms(platform: Platform, system_requirements: &SystemRequirement
_ => unreachable!("not windows"),
}
} else if platform.is_linux() {
let max_glibc_version = match &system_requirements.libc {
Some(LibCSystemRequirement::GlibC(v)) => v.clone(),
Some(LibCSystemRequirement::OtherFamily(_)) => return Vec::new(),
let max_glibc_version = match system_requirements
.libc
.as_ref()
.map(LibCSystemRequirement::family_and_version)
{
Some((family, version)) if family.eq_ignore_ascii_case("glibc") => version.clone(),
Some(_) => {
// Another libc family is being target.
return Vec::new();
}
None => default_glibc_version(),
};
linux_platform_tags(platform, &max_glibc_version)
Expand Down
12 changes: 12 additions & 0 deletions src/project/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,18 @@ pub enum LibCSystemRequirement {
OtherFamily(LibCFamilyAndVersion),
}

impl LibCSystemRequirement {
/// Returns the family and version of this libc requirement.
pub fn family_and_version(&self) -> (&str, &Version) {
match self {
LibCSystemRequirement::GlibC(version) => ("glibc", version),
LibCSystemRequirement::OtherFamily(LibCFamilyAndVersion { family, version: v }) => {
(family.as_deref().unwrap_or("glibc"), v)
}
}
}
}

#[serde_as]
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
Expand Down