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

Is workspace feature supported in Conan 2.0? #12466

Closed
mkjkec2005 opened this issue Nov 5, 2022 · 8 comments
Closed

Is workspace feature supported in Conan 2.0? #12466

mkjkec2005 opened this issue Nov 5, 2022 · 8 comments

Comments

@mkjkec2005
Copy link

Hi,

Is workspace feature supported in Conan 2.0? Kindly clarify.
As per the stack overflow, The workspace feature is deprecated, the recommended approach is to use editables directly.
It is also mentioed that workspace is not a good option.

https://stackoverflow.com/questions/73607834/conan-add-local-project-as-dependency

@memsharded memsharded self-assigned this Nov 5, 2022
@memsharded
Copy link
Member

memsharded commented Nov 5, 2022

Hi @mkjkec2005

The workspace command and feature has been removed in 2.0.
It will be eventually resumed in 2.X, but it was removed because it was half-baked and problematic, but not because we think it is not a relevant feature. We will work on it to propose hopefully a better feature when possible after 2.0 is stabilized.

In the meantime, the recommended approach is to use a local script that uses editable feature to setup the project and keep tuned to provide feedback when we resume work on it, so the new feature is also built taking into account different users use cases.

@mkjkec2005
Copy link
Author

Thank you so much for the clarification.

@memsharded
Copy link
Member

Labeling it as feature and look-into, to the 2.X milestone, so this info is explicit also for other users.

This was referenced Mar 20, 2023
@13steinj
Copy link

13steinj commented Jun 1, 2023

Hey @memsharded, sorry for the ping, but could I get a status update on this issue? I'm especially confused, since 2.0 documentation of editables makes a reference to workspaces.

@memsharded
Copy link
Member

Hi @13steinj

This ticket is assigned to 2.X roadmap, the current status is the following:

  • The workspace command has been removed in 2.0. It was practically abandoned in 1.X, with too many issues and too little usage
  • The improvements over editables in 1.X and 2.0, are a big step forward. The default conan new cmake_lib templates are editable out of the box
  • With the new editables it is possible to manually create a project containing multiple editables with a few clicks. There is a demo in https://www.youtube.com/live/VzUJQw89U7o?feature=share&t=2437, doing it in just 1-2 minutes.
  • For creating your own "workspace" projects, Conan 2.0 implements Conan custom commands. Defining your own rules and workspace content, and automating the generation of potential super-projects should be relatively straightforward there, and will allow a much better flexibility and control.

I'm especially confused, since 2.0 documentation of editables makes a reference to workspaces.

If that happens, that is an error in the docs. The only occurence I find in there is the Path to the package folder in the user workspace in the conan editable -h command line help. In this case, it doesn't refer to the workspace feature, but to the user folders. We can improve that line. Do you see references to the workspace anywhere else? Do you have some links?

@13steinj
Copy link

13steinj commented Jun 2, 2023

Yeah, that was the line that I was referring to (though, that's also in the online html doc). Apologies, the other day was long and full of headaches; but it might be good to clarify what that means especially when people have used the 1.X feature.

For creating your own "workspace" projects, Conan 2.0 implements Conan custom commands. Defining your own rules and workspace content, and automating the generation of potential super-projects should be relatively straightforward there, and will allow a much better flexibility and control.

10000% agree and I love that approach; was just wondering if the workflow was the same / going to be the same since I'm in the process of speccing out a transition to conan (and choosing 1.60 vs 2, and if 1.60; what the transition plan would look like). Is it expected that I can name the command "workspace [...]" to have similarity with the 1.X command or should I name it something else just in case 2.X gets it by-default again?

Thank you for the update and the continued great work on the conan project.

@memsharded
Copy link
Member

Is it expected that I can name the command "workspace [...]" to have similarity with the 1.X command or should I name it something else just in case 2.X gets it by-default again?

The recommendation is to put the command in your own layer, so it doesn't collide with a potential future one
You can call your own commands like conan mylayer:mycommand (like conan mkjkec:workspace myarg), and you can define several layers for different projects, or just use one layer for your company name. But in any case, the recommendation would be to use your layer/namespace. It is likely that 2.0 will want to use the workspace command again.

Thank you for the update and the continued great work on the conan project.

Thanks for your kind words!

@memsharded
Copy link
Member

Hi all,

Workspaces are been introduced back in Conan 2.10: https://docs.conan.io/2/incubating.html

I am closing this ticket as responded, but please create new tickets for any further question or issue. Thanks very much for the feedback!

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

3 participants