Tool stanza - #16411
Tool stanza#16411Sudha247 wants to merge 8 commits into
Conversation
47bdc13 to
29b439f
Compare
|
A couple of updates:
|
This is a basic implementation of a tool stanza, as discussed in ocaml#16185. The thing to figure out before this is ready for review is how to include the binary names, and how to handle binary name collisions. I ended up not adding it to tool itslef, in order to continue using `Package_dependency` functions directly, but this isn't final. Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Also include a share field to list out the packages to be shared with the lock dir of context. Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
To make reading easier. Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
The stanza has been marked unreleased as we expect it to change during the development process. As @shonfeder suggested, the lock_dir and inherit fields are made siblings to avoid confusion. Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
29b439f to
1c66fe2
Compare
Alizter
left a comment
There was a problem hiding this comment.
I'm not particularly fond of adding a bunch of dead-code, especially since the difficult job of implementing the rules hasn't been carried out yet.
It's difficult to make any comment on the contents of the stanza because we don't know what will be easy or difficult to implement yet without attempting it.
If you wish to work on this implementation, a better course of action would be to have a separate branch where you can review / add / etc. chunks of work. I think it's fine for that to live in this repo rather than on somebodies fork.
As it stands this PR adds a bunch of configuration for something that doesn't exist, so I don't think anybody can suggest anything substantive at this point.
The reason I am against adding dead-code is that dune has some history of speculative additions that never get finished. It only makes sense to speculatively merge parts as part of a larger already reviewed branch in that case. Otherwise, this work will be abandoned and we will have a strangely empty, documented and changeloged non-feature.
|
Thanks @Alizter! I agree that this is adding configuration for features that don't exist yet. But the idea is for the features to be built on top of this. In this regard, I find it useful to gather feedback early.
True that the work is in its early stages, but I did get some useful feedback from @shonfeder, which has already been incorporated. I'm not a fan of developing in a silo and dropping a 100-commit PR for folks to review. I think that would make both parts (reviewing and steering) difficult. I agree that implementing the rules will require substantive work, but I also see this as an interesting UX problem regarding how config is exposed to users.
That's a fair concern, and I'm fine with keeping it out of the documentation and changelogs. The intention behind opening a PR now is to review small chunks and iterate on them. We will have some dead code for a while, but I don't see it as a big risk, as it doesn't affect users, probably costs a few more ms of tests, and can be removed at any point. I am continuing to work on top of this, e.g. https://github.com/Sudha247/dune/tree/tool-stanza-lock. If the consensus is we don't merge now, I will push my branches here. Whether the branch lives on my fork or in this repo doesn't change much in practice; either way, the work needs to be reviewed, but if that's the convention you want to be followed, I'm okay going with it. |
Description
There has been discussion around this at #16185. For anyone curious about the context, I'd recommend reading the issue.
This patch contains a proposal for introducing a tool stanza (rather
tool_groupstanza), for dune tools. The idea is to have persistent configuration for tooling we use. It only contains the code for the stanza itself. I wanted to potentially get opinions on this before going further with locking, building, etc.Following @Alizter's insightful comment at #16185 (comment), I rethought the tool stanza a bit, and introduced a inherit + shared_packages field. The idea is that packages mentioned in
shared_packageswould be copied directly enabling sharing with built packages and reducing build time. Due to the reasons Ali mentioned in his comment, this quirk is currently needed. My hope is that we can somehow provide a better abstraction on top of this, in the future.We debated a bit on whether we should inherit from lock_dir or from a context. Here are the reasons I think it makes sense to inherit from a context:
dune build --context newis something users are familiar with. This is a direct extension of the concept, of whether you want a tool to work in and inherit from a particular context.All that said, there are some open questions:
:with-testare accepted by default. Do we need to reject those?Related Issue and Motivation
Fixes #16185
Checklist