summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-25 22:18:38 +0200
committerGitHub <noreply@github.com>2022-08-25 22:18:38 +0200
commit6d196c1ce34340874c413e166e14933729346302 (patch)
tree3fbdb3ced8c934e6c98c227b94f5f4f51f3a6785 /modules/mono
parent060d0ce88204f9180beb3764048975e9dcf5c496 (diff)
parent09af583e105a82918b72d20602ea7dd060c8e950 (diff)
Merge pull request #64898 from neikeq/dotnet-fix-find-arch
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/build_scripts/mono_configure.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py
index 8141bc2422..3277f9beeb 100644
--- a/modules/mono/build_scripts/mono_configure.py
+++ b/modules/mono/build_scripts/mono_configure.py
@@ -287,6 +287,10 @@ def find_dotnet_executable(arch):
os.path.join(dir, "arm32"),
] # search subfolders for cross compiling
+ # `dotnet --info` may not specify architecture. In such cases,
+ # we fallback to the first one we find without architecture.
+ sdk_path_unknown_arch = ""
+
for dir in search_dirs:
path = os.path.join(dir, "dotnet")
@@ -298,10 +302,14 @@ def find_dotnet_executable(arch):
sdk_arch = find_dotnet_arch(path_with_ext)
if sdk_arch == arch or arch == "":
return path_with_ext
+ elif sdk_arch == "":
+ sdk_path_unknown_arch = path_with_ext
else:
if os.path.isfile(path) and os.access(path, os.X_OK):
sdk_arch = find_dotnet_arch(path)
if sdk_arch == arch or arch == "":
return path
+ elif sdk_arch == "":
+ sdk_path_unknown_arch = path
- return ""
+ return sdk_path_unknown_arch