from conans import ConanFile
from conans.client.build.autotools_environment import AutoToolsBuildEnvironment
class Pkg(ConanFile):
name = 'conan_bug_pkg'
version='1.0'
exports_sources = ['*']
def build(self):
AutoToolsBuildEnvironment(self)
def package(self):
pass
native (with stock compiler and arch) and cross (e.g. cross-toolchain and target arch arm). See attached profiles for examples.create . @ --profile:build native --profile:host crossERROR: conan_bug_pkg/1.0: Error in build() method, line 11
AutoToolsBuildEnvironment(self)
AttributeError: 'NoneType' object has no attribute 'get_safe'
Note: this does not happen in 1.24.1.
I've backtraced this error to this line, where current_node.conanfile.settings_target is equal to None, which leads to this code failing.
Example profiles:
native.txt
arm.txt
Related feature: https://github.com/conan-io/conan/pull/6769
Hi @TheQwertiest
Thanks very much for reporting this. Indeed a bug. Not strictly a regression, this feature is still experimental, but I have submitted a https://github.com/conan-io/conan/pull/7032 pull request, and targeted for a potential 1.25.2.
This will be released in 1.25.2.
Thanks!