[bug] Conan 1.X: prefer build_requires from direct/indirect dependencies over build_requires from profiles
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: Ubuntu 20.04
- Compiler+version: clang-13
- Conan version: 1.44.1
- Python version: 3.8.10
Steps to reproduce (Include if Applicable)
==> mybin.py <==
import os
from conans import ConanFile
class ConanRecipe(ConanFile):
name = "mybin"
version = "1.0.0"
def build(self):
pass
def package(self):
os.makedirs(os.path.join(self.package_folder, "bin"), exist_ok=True)
self.run("cd %s/bin && echo 'echo mybin' > mybin; chmod +x mybin" % self.package_folder)
==> myproject.py <==
import os
from conans import ConanFile
class ConanRecipe(ConanFile):
name = "myproject"
version = "1.0.0"
def build_requirements(self):
self.build_requires("mybin/1.0.0")
def build(self):
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
self.run("mybin")
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
self.run("which -a mybin")
==> sysroot.py <==
import os
from conans import ConanFile
class ConanRecipe(ConanFile):
name = "sysroot"
version = "1.0.0"
def build(self):
pass
def package(self):
os.makedirs(os.path.join(self.package_folder, "bin"), exist_ok=True)
self.run("cd %s/bin && echo 'echo sysroot' > mybin; chmod +x mybin" % self.package_folder)
==> sysroot.profile <==
[build_requires]
sysroot/1.0.0
==> run.sh <==
#!/bin/bash
set -ex
conan export sysroot.py
conan export mybin.py
conan export myproject.py test/test
rm -rf build && mkdir build
cd build
conan install myproject/1.0.0@test/test -pr:h=../sysroot.profile -pr:b=../sysroot.profile --build=missing --build=myproject
Logs (Executed commands with output) (Include/Attach if Applicable)
myproject/1.0.0@test/test: Calling build()
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sysroot
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/home/EU.BSHG.COM/kleint/.docker-build-scripts/conan_cache/.conan/data/sysroot/1.0.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/mybin
/home/EU.BSHG.COM/kleint/.docker-build-scripts/conan_cache/.conan/data/mybin/1.0.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/mybin
As you can see the mybin
executable from sysroot/1.0.0
(profile) is first in PATH
although a package containing mybin
was specified as a build_requirement
in the conanfile.py.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
[bug] Recipe self.dependencies does not contain any elements
I am trying to externalise build requirements through profiles, ... from conans import ConanFile class DependenciesCheck(ConanFile): def ...
Read more >RPM Packaging Guide
The rpm package manager uses this metadata to determine dependencies, where to install files, and other information. There are two types of RPM...
Read more >Packaging guidelines - Mageia wiki
Every package in Mageia needs a maintainer (AKA owner, bug owner). ... The automatic dependency on libfubar.so.1 is insufficient, # as we strictly...
Read more >Howto modify/affect/adapt conan dependencies - Stack Overflow
The obvious recommendation: Update Conan to the latest version (1.35.1). pip install -U conan. Packages in Conan Center Index (all official) ...
Read more >qt/qtwebengine.git - Qt WebEngine
50, # When constructor initializers do not fit on one line, put them each on a ... 511, MESSAGE "Build requires Khronos development...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
@thorsten-klein you could use:
generators = "VirtualBuildEnv"
in myprojecttools.env.virtualenv:auto_use=True
in the global.confYou can read more about that in the Conan v2 migration guide