Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] conan install command not retrieving sources with -c tools.build:download_source=True #13951

Closed
meghfossa opened this issue May 23, 2023 · 2 comments · Fixed by #13953
Closed
Assignees
Milestone

Comments

@meghfossa
Copy link

meghfossa commented May 23, 2023

Environment details

  • Conan version: 2.0.5
  • Python version: 3.11.1
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.cppstd=gnu14
compiler.libcxx=libc++
compiler.version=13
os=Macos

Steps to reproduce

  1. Create conanfile.py
from conan import ConanFile

class CompressorRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeToolchain", "CMakeDeps"
    default_options = {"zlib/*:shared": False}

    def requirements(self):
        self.requires("zlib/1.2.13", run=True)
        self.requires("openssl/3.1.0")

    def build_requirements(self):
        self.tool_requires("cmake/3.22.6")
  1. Execute: conan install . -c tools.build:download_source=True -f json | jq | grep -C 4 "source_folder" (expectation - we should see source_folder, result: we do not see src folder)
  2. Execute: conan graph info . -c tools.build:download_source=True -f json | jq | grep -C 4 "source_folder" (expectation - we should see source_folder, result: we do see src folder)

Logs

~/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py (main*) » conan install . -c tools.build:download_source=True -f json | jq | grep -C 4 "source_folder" 

======== Input profiles ========
Profile host:
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.cppstd=gnu14
compiler.libcxx=libc++
compiler.version=13
os=Macos
[conf]
tools.build:download_source=True

Profile build:
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.cppstd=gnu14
compiler.libcxx=libc++
compiler.version=13
os=Macos

======== Computing dependency graph ========
Graph root
    conanfile.py: /Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py/conanfile.py
Requirements
    openssl/3.1.0#25925a18588e030e406a15da96c4d32b - Cache
    zlib/1.2.13#e377bee636333ae348d51ca90874e353 - Cache
Build requirements
    cmake/3.22.6#32cced101c6df0fab43e8d00bd2483eb - Cache

======== Computing necessary packages ========
Requirements
    openssl/3.1.0#25925a18588e030e406a15da96c4d32b:c6f0d27a6f6fc6a1f1861a5b4bf6b5001d4a6565#bbe6b6b188beca577ddcaf671b566575 - Cache
    zlib/1.2.13#e377bee636333ae348d51ca90874e353:6ee94108e5a809f66e5396a0549a9ff4ed7621e8#6be00a60a4210183f4db9a3be9cbc428 - Cache
Build requirements
    cmake/3.22.6#32cced101c6df0fab43e8d00bd2483eb:9e5323c65b94ae38c3c733fe12637776db0119a5#7b5af65c2e837696ee8227674734cedf - Cache

======== Installing packages ========
cmake/3.22.6: Already installed! (1 of 3)
cmake/3.22.6: Appending PATH environment variable: /Users/dev/.conan2/p/cmakedf2c94b672dad/p/CMake.app/Contents/bin
zlib/1.2.13: Already installed! (2 of 3)
openssl/3.1.0: Already installed! (3 of 3)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'env_info' used in: openssl/3.1.0, cmake/3.22.6
WARN: deprecated:     'cpp_info.names' used in: openssl/3.1.0, zlib/1.2.13
WARN: deprecated:     'cpp_info.build_modules' used in: openssl/3.1.0

======== Finalizing install (deploy, generators) ========
conanfile.py: Writing generators to /Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py
conanfile.py: Generator 'CMakeDeps' calling 'generate()'
conanfile.py: Generator 'CMakeToolchain' calling 'generate()'
conanfile.py: CMakeToolchain generated: conan_toolchain.cmake
conanfile.py: Preset 'conan-release' added to CMakePresets.json. Invoke it manually using 'cmake --preset conan-release' if using CMake>=3.23
conanfile.py: If your CMake version is not compatible with CMakePresets (<3.23) call cmake like: 'cmake <path> -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release'
conanfile.py: CMakeToolchain generated: CMakePresets.json
conanfile.py: Generating aggregated env files
conanfile.py: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
Install finished successfully
          "3": "cmake/3.22.6#32cced101c6df0fab43e8d00bd2483eb"
        },
        "system_requires": {},
        "recipe_folder": "/Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py",
        "source_folder": "/Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py",
        "build_folder": "/Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py",
        "generators_folder": "/Users/dev/code/conanexample/examples2/tutorial/consuming_packages/conanfile_py",
        "package_folder": null,
        "cpp_info": {
--
        "generators": [],
        "requires": {},
        "system_requires": {},
        "recipe_folder": "/Users/dev/.conan2/p/zlib15353192ba4c5/e",
        "source_folder": null, # expected this to be not null
        "build_folder": null,
        "generators_folder": null,
        "package_folder": "/Users/dev/.conan2/p/b/zlibe0418099c7ee9/p",
        "cpp_info": {
--
          "1": "zlib/1.2.13#e377bee636333ae348d51ca90874e353"
        },
        "system_requires": {},
        "recipe_folder": "/Users/dev/.conan2/p/opens4d8b8eb2b5350/e",
        "source_folder": null, # expected this to be not null
        "build_folder": null,
        "generators_folder": null,
        "package_folder": "/Users/dev/.conan2/p/b/opens4a59ce9633bc7/p",
        "cpp_info": {
--
        "generators": [],
        "requires": {},
        "system_requires": {},
        "recipe_folder": "/Users/dev/.conan2/p/cmake0fba9ec230149/e",
        "source_folder": null, # expected this to be not null
        "build_folder": null,
        "generators_folder": null,
        "package_folder": "/Users/dev/.conan2/p/cmakedf2c94b672dad/p",
        "cpp_info": {

related: #13939

@memsharded
Copy link
Member

Hi @meghfossa

Thanks for the report.

Apparently it seems that the feature is working and it is retrieving the sources. What is missing is the source_folder information in the serialized output. I am trying to fix it in this PR: #13953

@memsharded memsharded self-assigned this May 23, 2023
@memsharded memsharded added this to the 2.0.6 milestone May 23, 2023
@memsharded
Copy link
Member

#13953 merged, for next 2.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants