Repository: conan-io/conan

Issue:
1.3 regression: AutoToolsBuildEnvironment now aborts on self-defined architectures
With 1.3 our AutoTools packages started to fail on architectures that we define ourselves in settings.yml, these includes: `aarch64`, `armv7hf-sysv` etc. The error message we get is:

`conans.errors.ConanException: Unknown 'armv7hf-sysv' machine. Conan doesn't know how to translate it to the GNU triplet, please report at https://github.com/conan-io/conan/issues`

This is a breaking change and while the warning is probably good it breaks our current packages without changes to conan. Ideally this warning should be not an error but a warning to not break current packages and maybe make it configurable in the future.


Discussion:
Understood, you are right. Tomorrow we will release 1.3.1. 

Resolving patch:
diff --git a/conans/client/build/autotools_environment.py b/conans/client/build/autotools_environment.py
--- a/conans/client/build/autotools_environment.py
+++ b/conans/client/build/autotools_environment.py
@@ -13,6 +13,7 @@
 from conans.client.tools.win import unix_path
 from conans.tools import (environment_append, args_to_string, cpu_count, cross_building,
                           detected_architecture, get_gnu_triplet)
+from conans.errors import ConanException
 
 
 class AutoToolsBuildEnvironment(object):
@@ -76,9 +77,14 @@ def _get_host_build_target_flags(self):
         if not cross_building(self._conanfile.settings, os_detected, arch_detected):
             return False, False, False
 
-        build = get_gnu_triplet(os_detected, arch_detected, compiler)
-        host = get_gnu_triplet(os_settings, arch_settings, compiler)
-
+        try:
+            build = get_gnu_triplet(os_detected, arch_detected, compiler)
+        except ConanException:
+            build = None
+        try:
+            host = get_gnu_triplet(os_settings, arch_settings, compiler)
+        except ConanException:
+            host = None
         return build, host, None
 
     def configure(self, configure_dir=None, args=None, build=None, host=None, target=None,
@@ -190,7 +196,7 @@ def _configure_flags(self):
         if arch_flag:
             ret.append(arch_flag)
         btfs = build_type_flags(compiler=self._compiler, build_type=self._build_type,
-                               vs_toolset=self._conanfile.settings.get_safe("compiler.toolset"))
+                                vs_toolset=self._conanfile.settings.get_safe("compiler.toolset"))
         if btfs:
             ret.extend(btfs)
         srf = sysroot_flag(self._deps_cpp_info.sysroot, win_bash=self._win_bash,
diff --git a/conans/client/tools/oss.py b/conans/client/tools/oss.py
--- a/conans/client/tools/oss.py
+++ b/conans/client/tools/oss.py
@@ -322,17 +322,17 @@ def get_gnu_triplet(os, arch, compiler=None):
 
     # Calculate the arch
     machine = {"x86": "i686" if os != "Linux" else "x86",
-                "x86_64": "x86_64",
-                "armv6": "arm",
-                "armv7": "arm",
-                "armv7s": "arm",
-                "armv7k": "arm",
-                "armv7hf": "arm",
-                "armv8": "aarch64"}.get(arch, None)
+               "x86_64": "x86_64",
+               "armv6": "arm",
+               "armv7": "arm",
+               "armv7s": "arm",
+               "armv7k": "arm",
+               "armv7hf": "arm",
+               "armv8": "aarch64"}.get(arch, None)
     if machine is None:
-        raise ConanException("Unknown '%s' machine. Conan doesn't know how to "
-                                "translate it to the GNU triplet, please report at "
-                                "https://github.com/conan-io/conan/issues" % arch)
+        raise ConanException("Unknown '%s' machine, Conan doesn't know how to "
+                             "translate it to the GNU triplet, please report at "
+                             " https://github.com/conan-io/conan/issues" % arch)
 
     # Calculate the OS
     if compiler == "gcc":


Test patch: