Skip to content
Closed
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ indoc = "2.0.3"
insta = "1.34.0"
pretty_assertions = "1.3.0"
rstest = "0.22.0"
rustversion = "1.0.9"
time = { version = "0.3.34", features = ["macros"] }
trycmd = "0.15.0"
which = "7.0.0"
Expand Down
2 changes: 1 addition & 1 deletion guide/src/sphinx.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ build:
os: "ubuntu-20.04"
tools:
python: "3.9"
rust: "1.55"
rust: "1.86"

python:
install:
Expand Down
14 changes: 5 additions & 9 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1358,29 +1358,25 @@ mod tests {

#[test]
fn test_macosx_deployment_target() {
let rustc_ver = rustc_version::version().unwrap();
let rustc_ver = (rustc_ver.major, rustc_ver.minor);
let x86_64_minor = if rustc_ver >= (1, 74) { 12 } else { 7 };
let universal2_minor = if rustc_ver >= (1, 74) { 12 } else { 9 };
assert_eq!(
macosx_deployment_target(None, false).unwrap(),
((10, x86_64_minor), (11, 0))
((10, 12), (11, 0))
);
assert_eq!(
macosx_deployment_target(None, true).unwrap(),
((10, universal2_minor), (11, 0))
((10, 12), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("10.6"), false).unwrap(),
((10, x86_64_minor), (11, 0))
((10, 12), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("10.6"), true).unwrap(),
((10, universal2_minor), (11, 0))
((10, 12), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("10.9"), false).unwrap(),
((10, universal2_minor), (11, 0))
((10, 12), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("11.0.0"), false).unwrap(),
Expand Down
9 changes: 2 additions & 7 deletions src/compile.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::target::RUST_1_64_0;
#[cfg(feature = "zig")]
use crate::PlatformTag;
use crate::{BridgeModel, BuildContext, PythonInterpreter, Target};
Expand Down Expand Up @@ -177,12 +176,8 @@ fn cargo_build_command(
.iter()
.any(|crate_type| LIB_CRATE_TYPES.contains(crate_type))
{
// `--crate-type` is stable since Rust 1.64.0
// See https://github.com/rust-lang/cargo/pull/10838
if target.rustc_version.semver >= RUST_1_64_0 {
debug!("Setting crate_type to cdylib for Rust >= 1.64.0");
cargo_rustc.crate_type = vec!["cdylib".to_string()];
}
debug!("Setting crate_type to cdylib");
cargo_rustc.crate_type = vec!["cdylib".to_string()];
}

let target_triple = target.target_triple();
Expand Down
21 changes: 7 additions & 14 deletions src/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ mod pypi_tags;

pub use pypi_tags::{is_arch_supported_by_pypi, validate_wheel_filename_for_pypi};

pub(crate) const RUST_1_64_0: semver::Version = semver::Version::new(1, 64, 0);

/// All supported operating system
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Deserialize)]
#[serde(rename_all = "lowercase")]
Expand Down Expand Up @@ -469,18 +467,13 @@ impl Target {
/// Returns the oldest possible Manylinux tag for this architecture
pub fn get_minimum_manylinux_tag(&self) -> PlatformTag {
match self.arch {
Arch::Aarch64 | Arch::Armv7L | Arch::Powerpc64 | Arch::Powerpc64Le | Arch::S390X => {
PlatformTag::manylinux2014()
}
Arch::X86 | Arch::X86_64 => {
// rustc 1.64.0 bumps glibc requirement to 2.17
// see https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html
if self.rustc_version.semver >= RUST_1_64_0 {
PlatformTag::manylinux2014()
} else {
PlatformTag::manylinux2010()
}
}
Arch::Aarch64
| Arch::Armv7L
| Arch::Powerpc64
| Arch::Powerpc64Le
| Arch::S390X
| Arch::X86
| Arch::X86_64 => PlatformTag::manylinux2014(),
Arch::Riscv64 => PlatformTag::Manylinux {
major: 2,
minor: 31,
Expand Down
8 changes: 2 additions & 6 deletions tests/common/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,9 @@ pub fn test_integration(
&& !build_context.target.is_musl_libc()
&& build_context.target.get_minimum_manylinux_tag() != PlatformTag::Linux
{
let rustc_ver = rustc_version::version()?;
let python_arch = build_context.target.get_python_arch();
let file_suffix = if rustc_ver >= semver::Version::new(1, 64, 0) {
format!("manylinux_2_17_{python_arch}.manylinux2014_{python_arch}.whl")
} else {
format!("manylinux_2_12_{python_arch}.manylinux2010_{python_arch}.whl")
};
let file_suffix =
format!("manylinux_2_17_{python_arch}.manylinux2014_{python_arch}.whl");
assert!(filename.to_string_lossy().ends_with(&file_suffix))
}
let mut venv_name = if supported_version == "py3" {
Expand Down
1 change: 0 additions & 1 deletion tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,6 @@ fn workspace_with_path_dep_git_sdist_generator() {
))
}

#[rustversion::since(1.64)]
#[test]
fn workspace_inheritance_sdist() {
handle_result(other::test_source_distribution(
Expand Down
Loading