conan icon indicating copy to clipboard operation
conan copied to clipboard

[question] is editable mode used for source codes debug?

Open initlifeinc opened this issue 3 years ago • 3 comments

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.

  1. is layout only used in editmode?
  2. layout template is a different or simple way to describe a layout of a library? which aone conan is suggest?
  3. 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?

initlifeinc avatar Aug 01 '22 07:08 initlifeinc

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.

lasote avatar Aug 01 '22 07:08 lasote

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.

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?

initlifeinc avatar Aug 02 '22 02:08 initlifeinc

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.

lasote avatar Aug 02 '22 05:08 lasote

@initlifeinc is the question resolved? Can we close it? Thanks

memsharded avatar Aug 15 '22 21:08 memsharded