conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.26k stars 981 forks source link

[workspaces] Build all projects using one command #3034

Closed uilianries closed 1 year ago

uilianries commented 6 years ago

To help us debug your issue please explain:

Hi!

First of all, I would like to congratulate all team. It's amazing to see Conan project feature starting to getting life.

I'm curious if workspace will be supported by create command. My idea is create multiple packages using workspace. The current example uses install to generate the cmake files, followed by cmake command. Would be nice to have conan create to execute all steps with no cmake lines.

Also, I didn't find support to test_package. Will it be supported?

Conan version: 1.4.4

memsharded commented 6 years ago

Hi!

But do you mean a conan create to create packages in the local cache, as always? Yes, this is likely to be a future extension, shouldn't be very difficult to implement, just that at the beginning we are focusing on the local development which is the most challenging part. If that is OK, then, we envision commands like conan worskpace create, conan workspace open MyPkg, etc, that could further improve the usage.

uilianries commented 6 years ago

Great!

Another suggestion, I have helped @taocpp to include Conan support on their projects. @d-frey asked to use a sub directory to hide test_package and build.py. The request makes sense to me, but would be really great if Conan workspace supports custom test_folder (path) for the project.

For now we just use conan create . -tf <path> but with workspace we could run conan workspace create and test_package path will be in conanws.yaml

And finally, I'm curious why did you use the file name conanws.yml instead of conan.yml? Is there some idea to use the name conan.yml for another propose in the future?

Regards

memsharded commented 6 years ago

And finally, I'm curious why did you use the file name conanws.yml instead of conan.yml? Is there some idea to use the name conan.yml for another propose in the future?

It is likely that other files will be used, for example "lock" files, or maybe something related to CI. Naming it with "ws" made sense to make sure the name identifies the purpose.

I'll take it into account, for the test_package build folder, when the conan workspace create is considered, thanks!

uilianries commented 6 years ago

Thank you!

I'm going to close this issue for now. For any new question I'll re-open it.

Regards!

memsharded commented 6 years ago

No, I think it is better to keep it open, to gather feedback of other users. It is something that is likely to be developed, so no need to close at the moment. Thanks

GarrickLin commented 5 years ago

Any progress on conan workspace yet ?

mbodmer commented 5 years ago

I think to let conan generate a CMake superbuild is a good idea to create workspaces. However the way the CMake superbuild is currently implemented is not so great yet.

Current problems using add_subproject are:

IMO it would be a better fit to implement workspaces using ExternalProject_Add and create a "standard" CMake superbuild. Instead of add_subdirectory, something along the lines of :

  ExternalProject_Add(${PKG_NAME}
    CMAKE_ARGS <<pass along args from superbuild CMakeLists>>
    CMAKE_CACHE_ARGS <<args from conan receipe>>
    DEPENDS <<dependency information from conan receipe>>
    SOURCE_DIR <<local package source dir from conan receipe or layout>>
    BINARY_DIR <<binary dir from layout or same as superbuild (as default)>>
    DOWNLOAD_DIR <<set to same as source dir so no download is needed>>
    INSTALL_DIR <<define in layout>>
    BUILD_ALWAYS 1
    USES_TERMINAL_DOWNLOAD 1
    USES_TERMINAL_UPDATE 1
    USES_TERMINAL_CONFIGURE 1
    USES_TERMINAL_BUILD 1
    USES_TERMINAL_TEST 1
    USES_TERMINAL_INSTALL 1
  )

That way a user-supplied top-level CMakeLists.txt is maybe not nessesary anymore as it's not needed to tweak by the user. It should be possible to take all the information from the conan receipes and mybe the layout file.

references:

memsharded commented 1 year ago

Conan editable mode already support --build=editable in 2.0, closing this as solved.

Workspaces were removed in 2.0, but the plan is to resume work on them in the 2.X roadmap. Please track progress in https://github.com/conan-io/conan/issues/12466, closing this