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

[question] conan create command: install folder #17626

Open
1 task
highvoltagecontrol opened this issue Jan 24, 2025 · 3 comments
Open
1 task

[question] conan create command: install folder #17626

highvoltagecontrol opened this issue Jan 24, 2025 · 3 comments
Assignees

Comments

@highvoltagecontrol
Copy link

What is your question?

Hi! I am running subfolders example and making conan install hello && conan create hello. As a result i am getting build folder with sh and generator folders and subfolders. Installation folder is something like .conan2/p/b/xxx. Is there any way to direct this cache created binaries back to the local folder i.e. to build one created by conan install hello cmd?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Jan 24, 2025
@memsharded
Copy link
Member

Sorry, it is not very clear what you mean @highvoltagecontrol, or what problem you are trying to solve.

There are deployers: https://docs.conan.io/2/reference/extensions/deployers.html, but they are not intended for regular dependency consumption. The recommendation is to use the dependencies from the Conan cache, and the deployers should only be used for "last mile deployment", that is, to get them out of Conan, because they need to be distributed by other means to production, like a Debian package or a Windows installer.

Also note that conan install and conan create are pretty orthogonal and independent commands. So don't need the first to run the second.

@highvoltagecontrol
Copy link
Author

Ok I have found solution to this issue. Looks like package method is operating in package_folder which is sth like .conan2/p/b/xxxx. One have to be carefull using self.source_folder for copy package_folder to local project folder since package self is operating on .conan2/p/b/xxxx folders. My solution is than to change first python path to local project folder and than trigger copy method calls:
copy(self, "", self.package_folder, os.path.join("build/install_sbe"))
copy(self, "
", self.build_folder, os.path.join("build/build_sbe"))
to get to local build process and install process of cmake and ninja triggered by conan2. I think it can be closed if You do not have more comments on this

@memsharded
Copy link
Member

My solution is than to change first python path to local project folder

I am afraid that I don't understand that part either. The self.package_folder or self.build_folders shouldn't be changed.
Also, the build() and package() method must be self contained in the cache, it is not allowed not expected that these methods put any file outside of the Conan cache when a conan create executing, that would be considered undefined behavior and could break.

A conan create doesn't have a local build process. It copies the conanfile.py and some files to the Conan cache, then absolutely everything happens and must happen inside of the Conan cache.

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

No branches or pull requests

2 participants