summaryrefslogtreecommitdiff
path: root/user/spack/40841.patch
blob: fb63b32e9aa6b374c1510b0d9f9885837fe25f15 (plain) (blame)
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
From fcf9e19a418b9db1fa517b98d087a5e387d1af8f Mon Sep 17 00:00:00 2001
From: Harmen Stoppels <me@harmenstoppels.nl>
Date: Thu, 2 Nov 2023 13:17:14 +0100
Subject: [PATCH] go/rust bootstrap: no versions if unsupported arch

The lookup in a dictionary causes KeyError on package load for
unsupported architectures such as i386 and ppc big endian.
---
 var/spack/repos/builtin/packages/go-bootstrap/package.py   | 2 +-
 var/spack/repos/builtin/packages/rust-bootstrap/package.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/var/spack/repos/builtin/packages/go-bootstrap/package.py b/var/spack/repos/builtin/packages/go-bootstrap/package.py
index 047f9f3353b93..4f5c8f0073243 100644
--- a/var/spack/repos/builtin/packages/go-bootstrap/package.py
+++ b/var/spack/repos/builtin/packages/go-bootstrap/package.py
@@ -59,7 +59,7 @@ class GoBootstrap(Package):
 
     # determine system os and architecture/target
     os = platform.system().lower()
-    target = go_targets[platform.machine().lower()]
+    target = go_targets.get(platform.machine().lower(), platform.machine().lower())
 
     # construct releases for current system configuration
     for release in go_releases:
diff --git a/var/spack/repos/builtin/packages/rust-bootstrap/package.py b/var/spack/repos/builtin/packages/rust-bootstrap/package.py
index 84100bf2424a1..337618e20e38f 100644
--- a/var/spack/repos/builtin/packages/rust-bootstrap/package.py
+++ b/var/spack/repos/builtin/packages/rust-bootstrap/package.py
@@ -73,7 +73,7 @@ class RustBootstrap(Package):
 
     # Determine system os and architecture/target.
     os = platform.system().lower()
-    target = rust_targets[platform.machine().lower()]
+    target = rust_targets.get(platform.machine().lower(), platform.machine().lower())
 
     # Pre-release versions of the bootstrap compiler.
     # Note: These versions are unchecksumed since they will change