conan
conan copied to clipboard
[bug] self.export_sources_folder is empty in local build
Environment Details
- Operating System+version: Linux Mint 20.3
- Compiler+version: gcc 9
- Conan version: 1.51
- Python version: 3.8.10
Steps to reproduce
conan install . -pr:h host -if build
conan source . -sf build
conan build . -bf build -sf build
In both source() and build() methods self.export_sources_folder is empty. If I use conan create, it's the same as self.source_folder.
This breaks the patch tool which uses export_sources_folder internally.
Hi @magist3r,
Yes, probably the folder in the patch() tool should be defaulted to the self.source_folder/base_folder in case self.export_sources_folder is None, which happens if you are not using the layout() feature.
I think this is something that should be fixed, but please note that if you use the layout() method it will work and it will be simpler to run the local methods. There are some builtin layouts in Conan, like for example the cmake_layout. It may be worth to check it out.
Thanks a lot for reporting.
Hi @czoido,
I tried it on 1.51.0, it caused some issues with CMakeDeps generator. I'll try on the latest version.
Hi @magist3r
I have closed https://github.com/conan-io/conan/pull/12174, because the idea is:
- New tools like the modern
patch(conanfile, ...)tools assume that the local flow arguments likeconan source -sf=xxxhave been declared legacy (and removed in 2.0) - The alternative is to define a
layout(), together with the--output-folderif necessary (most of the times probably it is not recommended), andconan source .without arguments
So this would be expected behavior, I think we can close it, please try that and let us know. Thanks!