summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2019-12-23 15:17:07 +0000
committerChandan Singh <chandan@chandansingh.net>2019-12-23 15:17:07 +0000
commit9126e7f59953eba5ba46e7fcdc84ba125130fb98 (patch)
treeb624823db8b232ed6ec9b6bc2dd7d74f4f3a5928
parent0bc77c681cf7fe72499d57e082ea162d85b3edc2 (diff)
parentc28e83df2fcb52b73a6188653459e149336a1fee (diff)
downloadbuildstream-9126e7f59953eba5ba46e7fcdc84ba125130fb98.tar.gz
Merge branch 'chandan/ibm-7-platform' into 'master'
_platform/platform.py: Add alias for IBM AIX 7 powerpc See merge request BuildStream/buildstream!1779
-rw-r--r--src/buildstream/_platform/platform.py14
-rw-r--r--tests/format/optionos.py4
2 files changed, 13 insertions, 5 deletions
diff --git a/src/buildstream/_platform/platform.py b/src/buildstream/_platform/platform.py
index c6bce41e7..b58ae3e3d 100644
--- a/src/buildstream/_platform/platform.py
+++ b/src/buildstream/_platform/platform.py
@@ -155,6 +155,7 @@ class Platform:
"i686": "x86-32",
"power-isa-be": "power-isa-be",
"power-isa-le": "power-isa-le",
+ "powerpc": "power-isa-be",
"powerpc64": "power-isa-be", # Used in GCC/LLVM
"powerpc64le": "power-isa-le", # Used in GCC/LLVM
"ppc64": "power-isa-be",
@@ -181,9 +182,16 @@ class Platform:
# (string): String representing the architecture
@staticmethod
def get_host_arch():
- # get the hardware identifier from uname
- uname_machine = platform.uname().machine
- return Platform.canonicalize_arch(uname_machine)
+ uname = platform.uname()
+
+ if uname.system.lower() == "aix":
+ # IBM AIX systems reports their serial number as the machine
+ # hardware identifier. So, we need to look at the reported processor
+ # in this case.
+ return Platform.canonicalize_arch(uname.processor)
+ else:
+ # Otherwise, use the hardware identifier from uname
+ return Platform.canonicalize_arch(uname.machine)
# does_multiprocessing_start_require_pickling():
#
diff --git a/tests/format/optionos.py b/tests/format/optionos.py
index 92486104e..16177c4fb 100644
--- a/tests/format/optionos.py
+++ b/tests/format/optionos.py
@@ -26,7 +26,7 @@ DATA_DIR = os.path.dirname(os.path.realpath(__file__))
("Darwin", None, "Darwiny"),
# Test that explicitly provided arches dont error out
# when the `uname` reported arch is not supported
- ("AIX", "Linux", "Linuxy"),
+ ("ULTRIX", "Linux", "Linuxy"),
("HaikuOS", "SunOS", "SunOSy"),
],
)
@@ -49,7 +49,7 @@ def test_conditionals(cli, datafiles, system, value, expected):
@pytest.mark.datafiles(DATA_DIR)
def test_unsupported_arch(cli, datafiles):
- with override_platform_uname(system="AIX"):
+ with override_platform_uname(system="ULTRIX"):
project = os.path.join(datafiles.dirname, datafiles.basename, "option-os")
result = cli.run(
project=project, silent=True, args=["show", "--deps", "none", "--format", "%{vars}", "element.bst"]