conan icon indicating copy to clipboard operation
conan copied to clipboard

[bug] self.export_sources_folder is empty in local build

Open magist3r opened this issue 3 years ago • 4 comments
trafficstars

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.

magist3r avatar Aug 04 '22 15:08 magist3r

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.

czoido avatar Aug 05 '22 08:08 czoido

Hi @magist3r,

Could you try defining the layout() feature? Did it work for you?

Thanks!

czoido avatar Aug 22 '22 09:08 czoido

Hi @czoido,

I tried it on 1.51.0, it caused some issues with CMakeDeps generator. I'll try on the latest version.

magist3r avatar Sep 16 '22 12:09 magist3r

Hi @magist3r,

Do you still have the issue? Could you give layout() a try?

czoido avatar Sep 22 '22 10:09 czoido

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 like conan source -sf=xxx have been declared legacy (and removed in 2.0)
  • The alternative is to define a layout(), together with the --output-folder if necessary (most of the times probably it is not recommended), and conan source . without arguments

So this would be expected behavior, I think we can close it, please try that and let us know. Thanks!

memsharded avatar Sep 23 '22 12:09 memsharded