Repository: conan-io/conan-center-index

Issue:
[automake] <automake>/<1.16.3>: automake build fails when Conan V2 mode is enabled

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **automake/1.16.3**
  * Operating System+version: **Linux OpenSuse 15.2** (should not matter)
  * Compiler+version: **GCC 7** (should not matter)
  * Conan version: **conan 1.32.0**
  * Python version: **Python 3.6.12**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
compiler.cppstd=17
[options]
[build_requires]
*: ninja/1.10.0, cmake/3.18.4
[env]
```


### Steps to reproduce (Include if Applicable)
Clone conan-center-index repository
```cd conan-center-index```
```export CONAN_V2_MODE=On```
```conan create recipes/automake/all automake/1.16.3@```

Package creation will fail with ```ConanV2Exception: Conan v2 incompatible: compiler setting should be defined.```

### Cause
The automake conanfile.py only has 'os' in its settings:
```settings = "os"```

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
wdobbe@linux-wdobbe:~/opensource/github_wd/conan-center-index> conan create recipes/automake/all automake/1.16.3@
Exporting package recipe
automake/1.16.3 exports: File 'conandata.yml' found. Exporting it...
automake/1.16.3 exports: Copied 1 '.yml' file: conandata.yml
automake/1.16.3 exports_sources: Copied 12 '.patch' files
automake/1.16.3: The stored package has not changed
automake/1.16.3: Using the exported files summary hash as the recipe revision: 9768487476f1c09c59021309cfb078c6 
automake/1.16.3: Exported revision: 9768487476f1c09c59021309cfb078c6
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=7
os=Linux
os_build=Linux
[options]
[build_requires]
*: ninja/1.10.0, cmake/3.18.4
[env]

automake/1.16.3: Forced build from source
automake/1.16.3 (test package): Installing package
Requirements
    autoconf/2.69 from local cache - Cache
    automake/1.16.3 from 'dynniq-conan-center' - Cache
    m4/1.4.18 from 'dynniq-conan-center' - Cache
Packages
    autoconf/2.69:8fa3d700af27560884f479508a9c204bb6135552 - Cache
    automake/1.16.3:f741a5c5b2473b6365a9e702e7905126be57c988 - Build
    m4/1.4.18:9a4ba0e0391732f282bd88d2caa50a912f4925bb - Cache
Build requirements
    cmake/3.18.4 from 'dynniq-conan-center' - Cache
    ninja/1.10.0 from local cache - Cache
    openssl/1.1.1h from 'dynniq-conan-center' - Cache
Build requirements packages
    cmake/3.18.4:3dad94b7ea3ab4ebad24642efca3c02531421b8d - Cache
    ninja/1.10.0:4db1be536558d833e52e862fd84d64d75c2b3656 - Cache
    openssl/1.1.1h:d50a0d523d98c15bb147b18fa7d203887c38be8b - Cache

Installing (downloading, building) binaries...
m4/1.4.18: Already installed!
m4/1.4.18: Appending PATH environment variable: /home/wdobbe/.conan/data/m4/1.4.18/_/_/package/9a4ba0e0391732f282bd88d2caa50a912f4925bb/bin
m4/1.4.18: Setting M4 environment variable: /home/wdobbe/.conan/data/m4/1.4.18/_/_/package/9a4ba0e0391732f282bd88d2caa50a912f4925bb/bin/m4
ninja/1.10.0: Already installed!
openssl/1.1.1h: Already installed!
autoconf/2.69: Already installed!
autoconf/2.69: Appending PATH env var with : /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin
autoconf/2.69: Setting AC_MACRODIR to /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin/share/autoconf
autoconf/2.69: Setting AUTOCONF to /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin/autoconf
autoconf/2.69: Setting AUTORECONF to /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin/autoreconf
autoconf/2.69: Setting AUTOHEADER to /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin/autoheader
autoconf/2.69: Setting AUTOM4TE to /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin/autom4te
autoconf/2.69: Setting AUTOM4TE_PERLLIBDIR to /home/wdobbe/.conan/data/autoconf/2.69/_/_/package/8fa3d700af27560884f479508a9c204bb6135552/bin/share/autoconf
cmake/3.18.4: Already installed!
cmake/3.18.4: Appending PATH environment variable: /home/wdobbe/.conan/data/cmake/3.18.4/_/_/package/3dad94b7ea3ab4ebad24642efca3c02531421b8d/bin
cmake/3.18.4: Appending PATH environment variable: /home/wdobbe/.conan/data/cmake/3.18.4/_/_/package/3dad94b7ea3ab4ebad24642efca3c02531421b8d/bin
automake/1.16.3: Applying build-requirement: ninja/1.10.0
automake/1.16.3: Applying build-requirement: cmake/3.18.4
automake/1.16.3: Applying build-requirement: openssl/1.1.1h
automake/1.16.3: WARN: Build folder is dirty, removing it: /home/wdobbe/.conan/data/automake/1.16.3/_/_/build/f741a5c5b2473b6365a9e702e7905126be57c988
automake/1.16.3: Copying sources to build folder
automake/1.16.3: Building your package in /home/wdobbe/.conan/data/automake/1.16.3/_/_/build/f741a5c5b2473b6365a9e702e7905126be57c988
automake/1.16.3: Generator txt created conanbuildinfo.txt
automake/1.16.3: Calling build()
automake/1.16.3: 
automake/1.16.3: ERROR: Package 'f741a5c5b2473b6365a9e702e7905126be57c988' build failed
automake/1.16.3: WARN: Build folder /home/wdobbe/.conan/data/automake/1.16.3/_/_/build/f741a5c5b2473b6365a9e702e7905126be57c988
ERROR: automake/1.16.3: Error in build() method, line 71
        autotools = self._configure_autotools()
while calling '_configure_autotools', line 50
        self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
        ConanV2Exception: Conan v2 incompatible: compiler setting should be defined.
```

</details>



Discussion:
I guess its dependency autoconf also fails with the same error?

Resolving patch:
diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py
--- a/recipes/automake/all/conanfile.py
+++ b/recipes/automake/all/conanfile.py
@@ -11,7 +11,7 @@ class AutomakeConan(ConanFile):
     exports_sources = ["patches/**"]
     license = ("GPL-2.0-or-later", "GPL-3.0-or-later")
 
-    settings = "os"
+    settings = "os", "arch", "compiler"
     _autotools = None
 
     @property
@@ -23,18 +23,25 @@ def _version_major_minor(self):
         [major, minor, _] = self.version.split(".", 2)
         return '{}.{}'.format(major, minor)
 
-    def source(self):
-        tools.get(**self.conan_data["sources"][self.version])
-        os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)
+    def configure(self):
+        del self.settings.compiler.cppstd
+        del self.settings.compiler.libcxx
 
     def requirements(self):
         self.requires("autoconf/2.69")
         # automake requires perl-Thread-Queue package
 
+    def package_id(self):
+        del self.info.settings.arch
+        del self.info.settings.compiler
+
     def build_requirements(self):
-        if tools.os_info.is_windows and "CONAN_BASH_PATH" not in os.environ \
-                and tools.os_info.detect_windows_subsystem() != "msys2":
-            self.build_requires("msys2/20190524")
+        if tools.os_info.is_windows and not tools.get_env("CONAN_BASH_PATH"):
+            self.build_requires("msys2/20200517")
+
+    def source(self):
+        tools.get(**self.conan_data["sources"][self.version])
+        os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)
 
     @property
     def _datarootdir(self):


Test patch: