Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
cpython/Lib/_aix_support.py at 3.9 · python/cpython · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.4k
Star
77.2k
Code
Issues
5k+
Pull requests
2.6k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
3.9
Breadcrumbs
cpython
/
Lib
/
_aix_support.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
91 lines (76 loc) · 3.31 KB
3.9
Breadcrumbs
cpython
/
Lib
/
_aix_support.py
Copy path
Top
File metadata and controls
Code
Blame
91 lines (76 loc) · 3.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"""Shared AIX support functions."""
import
sys
import
sysconfig
try
:
import
subprocess
except
ImportError
:
# pragma: no cover
# _aix_support is used in distutils by setup.py to build C extensions,
# before subprocess dependencies like _posixsubprocess are available.
import
_bootsubprocess
as
subprocess
def
_aix_tag
(
vrtl
,
bd
):
# type: (List[int], int) -> str
# Infer the ABI bitwidth from maxsize (assuming 64 bit as the default)
_sz
=
32
if
sys
.
maxsize
==
(
2
**
31
-
1
)
else
64
_bd
=
bd
if
bd
!=
0
else
9988
# vrtl[version, release, technology_level]
return
"aix-{:1x}{:1d}{:02d}-{:04d}-{}"
.
format
(
vrtl
[
0
],
vrtl
[
1
],
vrtl
[
2
],
_bd
,
_sz
)
# extract version, release and technology level from a VRMF string
def
_aix_vrtl
(
vrmf
):
# type: (str) -> List[int]
v
,
r
,
tl
=
vrmf
.
split
(
"."
)[:
3
]
return
[
int
(
v
[
-
1
]),
int
(
r
),
int
(
tl
)]
def
_aix_bos_rte
():
# type: () -> Tuple[str, int]
"""
Return a Tuple[str, int] e.g., ['7.1.4.34', 1806]
The fileset bos.rte represents the current AIX run-time level. It's VRMF and
builddate reflect the current ABI levels of the runtime environment.
If no builddate is found give a value that will satisfy pep425 related queries
"""
# All AIX systems to have lslpp installed in this location
out
=
subprocess
.
check_output
([
"/usr/bin/lslpp"
,
"-Lqc"
,
"bos.rte"
])
out
=
out
.
decode
(
"utf-8"
)
out
=
out
.
strip
().
split
(
":"
)
# type: ignore
_bd
=
int
(
out
[
-
1
])
if
out
[
-
1
]
!=
''
else
9988
return
(
str
(
out
[
2
]),
_bd
)
def
aix_platform
():
# type: () -> str
"""
AIX filesets are identified by four decimal values: V.R.M.F.
V (version) and R (release) can be retreived using ``uname``
Since 2007, starting with AIX 5.3 TL7, the M value has been
included with the fileset bos.rte and represents the Technology
Level (TL) of AIX. The F (Fix) value also increases, but is not
relevant for comparing releases and binary compatibility.
For binary compatibility the so-called builddate is needed.
Again, the builddate of an AIX release is associated with bos.rte.
AIX ABI compatibility is described as guaranteed at: https://www.ibm.com/
\
support/knowledgecenter/en/ssw_aix_72/install/binary_compatability.html
For pep425 purposes the AIX platform tag becomes:
"aix-{:1x}{:1d}{:02d}-{:04d}-{}".format(v, r, tl, builddate, bitsize)
e.g., "aix-6107-1415-32" for AIX 6.1 TL7 bd 1415, 32-bit
and, "aix-6107-1415-64" for AIX 6.1 TL7 bd 1415, 64-bit
"""
vrmf
,
bd
=
_aix_bos_rte
()
return
_aix_tag
(
_aix_vrtl
(
vrmf
),
bd
)
# extract vrtl from the BUILD_GNU_TYPE as an int
def
_aix_bgt
():
# type: () -> List[int]
gnu_type
=
sysconfig
.
get_config_var
(
"BUILD_GNU_TYPE"
)
if
not
gnu_type
:
raise
ValueError
(
"BUILD_GNU_TYPE is not defined"
)
return
_aix_vrtl
(
vrmf
=
gnu_type
)
def
aix_buildtag
():
# type: () -> str
"""
Return the platform_tag of the system Python was built on.
"""
# AIX_BUILDDATE is defined by configure with:
# lslpp -Lcq bos.rte | awk -F: '{ print $NF }'
build_date
=
sysconfig
.
get_config_var
(
"AIX_BUILDDATE"
)
try
:
build_date
=
int
(
build_date
)
except
(
ValueError
,
TypeError
):
raise
ValueError
(
f"AIX_BUILDDATE is not defined or invalid: "
f"
{
build_date
!r
}
"
)
return
_aix_tag
(
_aix_bgt
(),
build_date
)
You can’t perform that action at this time.