Conan: [bug][1.25.0 regression] 'NoneType' object has no attribute 'get_safe'

Created on 15 May 2020  路  3Comments  路  Source: conan-io/conan

Environment Details (include every applicable attribute)

  • Operating System+version: Ubuntu
  • Compiler+version: gcc 5.4.0 (stock/Linaro)
  • Conan version: 1.25.1
  • Python version: 3.8.2

Steps to reproduce (Include if Applicable)

  • Create a following recipe:
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
  • Create two profiles 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 cross

Logs (Executed commands with output) (Include/Attach if Applicable)

ERROR: 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

review bug

All 3 comments

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!

Was this page helpful?
0 / 5 - 0 ratings