question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] Ninja/1.11.0; does not work with Conan 2.0 due to use of self.env_info

See original GitHub issue

Description

Attempting to build Ninja using the updated 2.0 compatible recipe results in the following error:

ERROR: ninja/1.11.0: Error in package_info() method, line 50 self.env_info.PATH.append(os.path.join(self.package_folder, “bin”)) AttributeError: ‘NinjaConan’ object has no attribute ‘env_info’

Package and Environment Details

  • Package Name/Version: ninja/1.11.0
  • Operating System+version: Debian 10.3
  • Compiler+version: GCC 8
  • Conan version: conan 2.0.0beta4
  • Python version: Python 3.7.3

Conan profile

-------- Input profiles -------- Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=8 os=Linux

Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=8 os=Linux

Steps to reproduce

conan-2.0 create . --version 1.11.0

Logs

Click to expand log
Exporting the recipe
ninja/1.11.0: Exporting package recipe
ninja/1.11.0 exports: File 'conandata.yml' found. Exporting it...
ninja/1.11.0: Copied 1 '.yml' file: conandata.yml
ninja/1.11.0 exports: Copied 1 '.yml' file: conandata.yml
ninja/1.11.0: Using the exported files summary hash as the recipe revision: 56040fc40f098c10d50971e6e090c634
ninja/1.11.0: A new conanfile.py version was exported
ninja/1.11.0: Folder: /home/marc/.conan2/p/2a66362d34041272/e
ninja/1.11.0: Exported revision: 56040fc40f098c10d50971e6e090c634

-------- Input profiles --------
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux


-------- Computing dependency graph --------
Graph root
    virtual
Requirements
    ninja/1.11.0#56040fc40f098c10d50971e6e090c634 - Cache

-------- Computing necessary packages --------
ninja/1.11.0: Forced build from source
Requirements
    ninja/1.11.0#56040fc40f098c10d50971e6e090c634:3593751651824fb813502c69c971267624ced41a - Build

-------- Installing packages --------

-------- Installing (downloading, building) binaries... --------
ninja/1.11.0: Calling source() in /home/marc/.conan2/p/2a66362d34041272/s/src
Downloading v1.11.0.tar.gz

ninja/1.11.0: Copying sources to build folder
ninja/1.11.0: Building your package in /home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b
ninja/1.11.0: Calling generate()
ninja/1.11.0: Preset 'release' added to CMakePresets.json. Invoke it manually using 'cmake --preset release'
ninja/1.11.0: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake <path> -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release'
ninja/1.11.0: Aggregating env generators
ninja/1.11.0: Calling build()
ninja/1.11.0: CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/src"
ninja/1.11.0: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/src"
-- Using Conan toolchain: /home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/generators/conan_toolchain.cmake
-- Conan toolchain: C++ Standard 14 with extensions ON
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IPO / LTO enabled
-- Performing Test flag_no_deprecated
-- Performing Test flag_no_deprecated - Success
-- Performing Test flag_color_diag
-- Performing Test flag_color_diag - Success
CMake Warning at CMakeLists.txt:49 (message):
  re2c was not found; changes to src/*.in.cc will not affect your build.


-- Looking for fork
-- Looking for fork - found
-- Looking for pipe
-- Looking for pipe - found
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_POLICY_DEFAULT_CMP0091


-- Build files have been written to: /home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/Release
ninja/1.11.0: CMake command: cmake --build "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/Release" -- -j8
ninja/1.11.0: RUN: cmake --build "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/Release" -- -j8
Scanning dependencies of target libninja
Scanning dependencies of target libninja-re2c
[  6%] Building CXX object CMakeFiles/libninja-re2c.dir/src/lexer.cc.o
[  6%] Building CXX object CMakeFiles/libninja-re2c.dir/src/depfile_parser.cc.o
[ 19%] Building CXX object CMakeFiles/libninja.dir/src/build_log.cc.o
[ 19%] Building CXX object CMakeFiles/libninja.dir/src/clean.cc.o
[ 19%] Building CXX object CMakeFiles/libninja.dir/src/clparser.cc.o
[ 22%] Building CXX object CMakeFiles/libninja.dir/src/build.cc.o
[ 22%] Building CXX object CMakeFiles/libninja.dir/src/dyndep.cc.o
[ 25%] Building CXX object CMakeFiles/libninja.dir/src/dyndep_parser.cc.o
[ 29%] Building CXX object CMakeFiles/libninja.dir/src/debug_flags.cc.o
[ 32%] Building CXX object CMakeFiles/libninja.dir/src/deps_log.cc.o
[ 32%] Built target libninja-re2c
[ 35%] Building CXX object CMakeFiles/libninja.dir/src/disk_interface.cc.o
[ 38%] Building CXX object CMakeFiles/libninja.dir/src/edit_distance.cc.o
[ 45%] Building CXX object CMakeFiles/libninja.dir/src/graph.cc.o
[ 45%] Building CXX object CMakeFiles/libninja.dir/src/eval_env.cc.o
[ 48%] Building CXX object CMakeFiles/libninja.dir/src/graphviz.cc.o
[ 51%] Building CXX object CMakeFiles/libninja.dir/src/json.cc.o
[ 54%] Building CXX object CMakeFiles/libninja.dir/src/line_printer.cc.o
[ 58%] Building CXX object CMakeFiles/libninja.dir/src/manifest_parser.cc.o
[ 61%] Building CXX object CMakeFiles/libninja.dir/src/metrics.cc.o
[ 64%] Building CXX object CMakeFiles/libninja.dir/src/missing_deps.cc.o
[ 67%] Building CXX object CMakeFiles/libninja.dir/src/parser.cc.o
[ 70%] Building CXX object CMakeFiles/libninja.dir/src/state.cc.o
[ 74%] Building CXX object CMakeFiles/libninja.dir/src/status.cc.o
[ 77%] Building CXX object CMakeFiles/libninja.dir/src/string_piece_util.cc.o
[ 80%] Building CXX object CMakeFiles/libninja.dir/src/util.cc.o
[ 83%] Building CXX object CMakeFiles/libninja.dir/src/version.cc.o
[ 87%] Building CXX object CMakeFiles/libninja.dir/src/subprocess-posix.cc.o
[ 87%] Built target libninja
[ 90%] Generating build/browse_py.h
Scanning dependencies of target ninja
[ 96%] Building CXX object CMakeFiles/ninja.dir/src/ninja.cc.o
[ 96%] Building CXX object CMakeFiles/ninja.dir/src/browse.cc.o
[100%] Linking CXX executable ninja
[100%] Built target ninja
ninja/1.11.0: Package '3593751651824fb813502c69c971267624ced41a' built
ninja/1.11.0: Build folder /home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/Release
ninja/1.11.0: Generated conaninfo.txt
ninja/1.11.0: Generating the package
ninja/1.11.0: Temporary package folder /home/marc/.conan2/p/tmp/4dda2b7efb683f8b/p
ninja/1.11.0: Calling package()
ninja/1.11.0: Copied 1 file: COPYING
ninja/1.11.0: CMake command: cmake --install "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/Release" --prefix "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/p"
ninja/1.11.0: RUN: cmake --install "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/b/build/Release" --prefix "/home/marc/.conan2/p/tmp/4dda2b7efb683f8b/p"
-- Install configuration: "Release"
-- Installing: /home/marc/.conan2/p/tmp/4dda2b7efb683f8b/p/bin/ninja
ninja/1.11.0 package(): Packaged 2 files: ninja, COPYING
ninja/1.11.0: Package '3593751651824fb813502c69c971267624ced41a' created
ninja/1.11.0: Created package revision 0dc74834457ae37183757460a6996342
ninja/1.11.0: Full package reference: ninja/1.11.0#56040fc40f098c10d50971e6e090c634:3593751651824fb813502c69c971267624ced41a#0dc74834457ae37183757460a6996342
ninja/1.11.0: Package folder /home/marc/.conan2/p/80cb94ded933808a/p
ERROR: ninja/1.11.0: Error in package_info() method, line 50
        self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
        AttributeError: 'NinjaConan' object has no attribute 'env_info'```


</details>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
prince-chrismccommented, Oct 18, 2022

Opened an issue again the main repo for discussion. If anything is added to 2.0, it will just be ignored like the component names - this was the first reaction in offline discussion form the team.

Eventually downstream recipes will be updated and this can be removed, this is just the awkward transition with doing it in CCI with one recipe at a time.

1reaction
SpaceImcommented, Oct 15, 2022

Should be reported to conan client. CCI recipes can’t drop self.env_info, they must still support conan v1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Header-only packages — conan 2.0.0-beta documentation
A header-only library is composed only of header files. That means a consumer doesn't link with any library but includes headers, so we...
Read more >
Advanced Dependencies Model in Conan 2.0 C, C++ ... - JFrog
Advanced Dependencies Model in Conan 2.0 An introduction to Conan and focus on the latest features you can use today to overcome.
Read more >
Problems to generate executable with ninja. using packages ...
You are missing some information: The ${CONAN_LIBS} variable that you see in the CMakeLists.txt gets its value from the dependencies ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found