-
Notifications
You must be signed in to change notification settings - Fork 994
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
Design Recommendation for Workspaces and Editable #4142
Comments
Hi! The main point here is that several packages in editable mode would like to share the same layout information, but it is not possible as we need to identify which sections affects to which reference. Having a profile-like approach would require to specify which packages should be affected by which declarations. So the file will be more like:
and Conan will take into account only the projects that are currently in the editable mode. profile-like approach:
file next to conanfile.py:
I cannot see any real advantage for the profile-like approach. If you are already in a company I think it is easier to add the required file to the package itself, get that file versioned and it will be up to date all the time: the developer can install the references he wants in editable mode and it will work without needing to modify any profile file. A different question is, does it makes sense to be able to override this information using a profile-like or through the command line? I'm not sure, I think we need more feedback about it. Maybe I'm not understanding your use case, or I haven't suffered it and I cannot realize how important it is... I will think about it, and share it with the team. Thanks! |
Sorry, I should have covered this case. For the per-project definitions, we should be able to do just like options:
Yes, it's not your fault. I think this is the issue, and it shows how design-by-github-issue is ineffective. It's fine for reporting bugs and suggesting small changes, but it's painful, frustrating, and ineffective to try to discuss a new feature this way. It requires a huge body of text to provide all the context necessary to explain a situation. Yet, nobody wants to read huge body of texts in Github issues, and it's frowned upon. In this case, I am the person who suggested/requested the editable feature to solve a real and present group of problems which I work with every-day, and which I have discussed and thought about with others who have the same or related needs for several months. Based on all this perspective and a lot of thought, I did my best to describe and negotiate a generalized feature which covers the known use-cases, and a wide range of related cases. Somehow, despite this earnest attempt at communication on both sides, I feel like there is a major disconnect, and based on the way it's being planned right now, it does not look like something I would want to use for any of the cases it was originally suggested for. |
Hi again, We've changed a little bit the implementation of the editable package from an install perspective (#4152) to a link one (#4181), and we've been starting to use it internally to test the concept. I think that there are some changes that we need to introduce to make it more usable. Now we are just linking a reference in the cache to a local workspace (an existing directory), nevertheless there are still some prerrequisites: the local workspace must contain a The objective of the I'm not sure about the name or where to locate a profile-like file, but editable packages need more flexibility, let's think about this fallback sequence:
I'm going to implement this in a branch to test it, only one more consideration: first matching alternative for each package will be taken for all its directories, there won't be any composition/addition from all the possible sources. Happy Christmas! 🎄 |
After sharing this with the team, we are moving towards changing the priority (from higher priority to lower):
This is more aligned with my first comment, although I may have some drawbacks:
I'm going to change the PR #4181 to address these last comments, but I think it is worth to read all this thread again (ping @conan-io/barbarians) before accepting the final draft. Thanks for the feedback. |
Given the evolution of the editable feature and the decision finally adopted, I think that this issue can be closed until we get actual feedback from users regarding this feature. I'm sure there will be some things to evolve and to improve. |
Feedback on this feature should consider already merged work in #4287 and documented in conan-io/docs#1009. It will be released as experimental in v1.12 during this week. Thanks, and, as always, we will be pleased to hear your valuable feedback. |
you guys are really awesome |
In order to support user-defined workspace layouts, the
conan install
command should simply take more parameters when called with--editable
mode, similar to--install-folder
. An example would be:And then, support them in profiles:
The above profile example is one that would probably live in the user's
.conan/profiles
directory because it specifies the users "personalized" layout which they are likely to use on most of their projects. Compared to the current suggestions around requiring a new file in each repository, this features much less redundant copy and pasting for the common case.However, sometimes they may need to deviate for one project or another, in which case they would want to put the definitions in a file inside the repository directory. This is already well supported by Conan.
Profiles are an already well-defined specification, which elegantly support user customizations, as well as project customizations that can live in the project directories. This use of profiles for passing user-defined paths even seems to align with the nature of profiles well from a philosophical perspective. It doesn't feel like a misuse of the feature intended for something else, it feels right to me.
Of note, this approach would benefit significantly by the implementation of the following feature request, which makes profiles more composable.
#4141
Most importantly, I feel strongly that editable and workspaces do not need a separate file specification with complicated logic to define their personal or organizational conventions for local directory layouts. Use cases for editable generally fall into two categories:
The approach of requiring a new file in each repository has issues for both cases. This approach does not suffer from those issues, and is dramatically easier to implement.
For the record, my team is in the second group, and everything we do is based on profiles because it's the only way to manage consistency across the organization's users and CI. For the case of
editable
feature, we need a way to define the default layouts across all of our projects, but don't want to have to copy some template file to each repository. Also, for the exceptional projects, we need the ability to override the layout that does live with in the repository. Finally, we need a way to bypass both and define the values at the CLI. Profiles give us all of these things.My first choice was to define these paths in a new function of
conanfile
calledpackage_info_user()
, and share that viapython_requires
. However, that has been rejected twice now and I can see it's not up for discussion. So, I feel thisprofiles
based approach is equally elegant, perhaps moreso. It handles both the "independent" and "shared" use cases very well, and is extremely powerful. When compared to the idea of defining a new yaml file specifications, and a "new language" for defining conditional logic in directories, I think this approach should be vastly more desirable for both Conan team, and customers.Feedback welcome!
The text was updated successfully, but these errors were encountered: