conan
conan copied to clipboard
[question] is editable mode used for source codes debug?
i dig the document, and try to understand, it is seems that user could use editable mode to debug or develop a package from source code, am i right?
but i still have some questions.
- is layout only used in editmode?
- layout template is a different or simple way to describe a layout of a library? which aone conan is suggest?
- if want to debug with source code. after change the code, which command should be used to recompile the library to perform code rebuild and reinstall? by myself manual or by some commands?
it is seems that user could use editable mode to debug or develop a package from source code, am i right?
Right
is layout only used in editmode?
It depends, in you mean the folders declared in the layout() method, this is also the structure in the Conan cache.
layout template is a different or simple way to describe a layout of a library? which aone conan is suggest?
Conan is not suggesting an universal layout, but, for example for CMake we have the helper cmake_layout() that can be used as a "base" for almost any CMake project. Of course, that function can be called and later adjust some value.
if want to debug with source code. after change the code, which command should be used to recompile the library to perform code rebuild and reinstall? by myself manual or by some commands?
You should build it manually, but in Conan 2.X, if you have a transitive dependency in editable mode, an intermediate dependency (project -> A (editable) -> B), and you run, for example conan create . --build A in the project folder, Conan will build the A package locally too.
You should build it manually, but in Conan 2.X, if you have a transitive dependency in editable mode, an intermediate dependency (project -> A (editable) -> B), and you run, for example
conan create . --build Ain the project folder, Conan will build theApackage locally too.
I’m now using Conan 1.x, in this version, i should rebuild manually. is that means for an dependency(Project -> A -> B(editable) -> C, when i change some codes in B, if i want to Project to link with newest B, i should rebuild B, and then rebuild A, than rerun project? Some times we may declare A as a dynamic library, and use conan "imports" in conanfile.txt to copy files to project link directory, in this situation, how to easy trigger all to rebuild and final copy libraries to project?
Is Conan recommend to upgrade to 2.x from 1.4x version or not now?
when i change some codes in B, if i want to Project to link with newest B, i should rebuild B, and then rebuild A, than rerun project?
Yes.
Some times we may declare A as a dynamic library, and use conan "imports" in conanfile.txt to copy files to project link directory, in this situation, how to easy trigger all to rebuild and final copy libraries to project?
Working with several deps in editable mode and manage the changes for all of them is what we call the "workspaces" feature, but it is not working good and even at the moment has not been ported to Conan 2.0 so I wouldn't recommend it.
Is Conan recommend to upgrade to 2.x from 1.4x version or not now?
Is still a Beta but we recommend upgrading the recipes to be compatible with 2.0, you can check the migration guide here.
@initlifeinc is the question resolved? Can we close it? Thanks