diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21ed3f5..43d20af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: uses: actions/download-artifact@v7 with: name: package - - name: Build pexrc binary for all targets. + - name: Build pexrc binary. run: | chmod +x target/release/package export CARGO="$(command -v cargo)" diff --git a/CHANGES.md b/CHANGES.md index 00c552f..3c3de0e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Release Notes +## 0.15.0-unreleased + +This release adds defaults for Linux and Windows for the `platform_release` environment marker when +generating platform details via `pexrc platform python `. Now the only `` marker +when using a spec is the `platform_version` which is actively antagonistic to any likely real-world +use. + ## 0.14.0 This release adds `pexrc platform {info,python}` for displaying both local and foreign platform diff --git a/Cargo.lock b/Cargo.lock index e6a7368..6acef6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2096,7 +2096,7 @@ dependencies = [ [[package]] name = "pexrc" -version = "0.14.0" +version = "0.15.0-unreleased" dependencies = [ "anstream", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 0b5856b..6aa75e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ cargo-features = ["profile-rustflags"] [package] name = "pexrc" -version = "0.14.0" +version = "0.15.0-unreleased" edition = { workspace = true } publish = false diff --git a/crates/python-platform/src/markers.rs b/crates/python-platform/src/markers.rs index c36a8d2..63a3bf8 100644 --- a/crates/python-platform/src/markers.rs +++ b/crates/python-platform/src/markers.rs @@ -88,7 +88,12 @@ pub(crate) fn calculate( Cow::Owned(release.to_string()) } else { match platform { - Platform::Linux(_) => Cow::Borrowed(""), + Platform::Linux(_) => { + // At the time of writing this is the oldest Linux LTS kernel and a Civil + // Infrastructure Platform release; so seemingly a good backwards compatibility + // target. + Cow::Borrowed("4.4.302-cip103") + } Platform::Mac(Mac { release, .. }) => Cow::Owned(format!( "{major}.{minor}.{patch}", major = release.major, diff --git a/crates/python-platform/src/os.rs b/crates/python-platform/src/os.rs index 1a05e3e..fdfad56 100644 --- a/crates/python-platform/src/os.rs +++ b/crates/python-platform/src/os.rs @@ -10,7 +10,7 @@ use logging_timer::time; use crate::linux::LibcVersion; use crate::mac::Release as MacRelease; -use crate::windows::Release as WindowsRelease; +use crate::windows::{Release as WindowsRelease, Release}; #[derive(Copy, Clone)] pub enum Libc { @@ -98,7 +98,12 @@ impl FromStr for Os { // This is macOS Big Sur from April 2021. Ok(Self::Mac(MacRelease::new(11, 3))) } - "windows" => Ok(Self::Windows(None)), + "windows" => { + // We default to 10 ~arbitrarily. This does correspond to ~2014 (2015) though, like + // our Linux glibc default. Reasonably old backward compatiility for Windows, which, + // like Linux, is pretty great about not breaking backwards compatibility. + Ok(Self::Windows(Some(Release::Windows10))) + } value if let Some(version) = value.strip_prefix("macos_") => { Ok(Self::Mac(MacRelease::parse(version, '_')?)) } diff --git a/src/commands/platform/python.rs b/src/commands/platform/python.rs index 9d75b89..d39a62a 100644 --- a/src/commands/platform/python.rs +++ b/src/commands/platform/python.rs @@ -72,9 +72,9 @@ pub struct Python { /// + 3.14.5-windows /// /// When using these, defaults for each operating system are chosen: - /// + linux: glibc 2.17 & x86_64 + /// + linux: 4.4.302-cip103 (January 2016) & glibc 2.17 (December 2012) & x86_64 /// + macos: 11.3 (Big Sur April 2021) & aarch64 - /// + windows: x86_64 + /// + windows: 10 (first released July 2015) & x86_64 /// /// Linux can be further refined by using the manylinux and musllinux standards; for example: /// + 3.14.5-manylinux1 @@ -90,7 +90,7 @@ pub struct Python { /// Windows can be further refined by specifying the release as well: /// + 3.14.5-windows_11 /// - /// Finally, when specifying an operating system, an explicit chip architecture suffixe can be + /// Finally, when specifying an operating system, an explicit chip architecture suffix can be /// selected from among the following: /// + aarch64 (or arm64) /// + armv7 [^1] @@ -105,11 +105,9 @@ pub struct Python { /// + cpython-3.14.5-windows_11-amd64 /// /// [^1]: These chip architectures are only supported for Linux. - /// [^2]: The derived Python platform specification is complete save for two environment markers - /// that appear to be unused in the wild: - /// + platform_release: "" unless macos_ or windows_ was - /// specified - /// + platform_version: "" + /// [^2]: The derived Python platform specification is complete save for the platform_release + /// environment marker that appears to be unused in the wild. Its value is defaulted to + /// "". #[arg(value_parser = PythonPlatform::parse, verbatim_doc_comment)] python_platform: PythonPlatform, }