Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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 <spec>`. Now the only `<unknown>` 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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion crates/python-platform/src/markers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ pub(crate) fn calculate(
Cow::Owned(release.to_string())
} else {
match platform {
Platform::Linux(_) => Cow::Borrowed("<unknown>"),
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,
Expand Down
9 changes: 7 additions & 2 deletions crates/python-platform/src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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, '_')?))
}
Expand Down
14 changes: 6 additions & 8 deletions src/commands/platform/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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: "<unknown>" unless macos_<release> or windows_<release> was
/// specified
/// + platform_version: "<unknown>"
/// [^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
/// "<unknown>".
#[arg(value_parser = PythonPlatform::parse, verbatim_doc_comment)]
python_platform: PythonPlatform,
}
Expand Down