Skip to content

[draft] Tool management requirements#13457

Draft
shonfeder wants to merge 68 commits into
mainfrom
tools-design
Draft

[draft] Tool management requirements#13457
shonfeder wants to merge 68 commits into
mainfrom
tools-design

Conversation

@shonfeder

@shonfeder shonfeder commented Jan 26, 2026

Copy link
Copy Markdown
Member

This proposes a set of high level, functional requirements for our tooling management functionality.

Fixes #15545

The requirements proposed here are informed by our experience with the current prototype, our use of other successful tools addressing this problem space, and by recent design discussions.

  • This should be informed by (and make reference to) existing successful package management tools (uv, cargo, etc.)
  • This should be informed by (and make reference to) what we have learned from the shortcoming of the current implementation

@Alizter

Alizter commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

@shonfeder I've gone through my own design notes and prototype to update this document. As it stands it is still a WIP however there is much more material that can be fleshed out and discussed. I've split the requirements into functional requirements and a technical specification, although it isn't perfect. I included my own research on similar features from other package managers, but this could be expanded further. Hopefully this closes the gap between what we dissected and what I had in the prototype.

The CRs should answer most questions you have reading the docs, but further changes and additions/deletions are welcome.

The end-goal will be to address all the CRs so they are not a permanent feature.

@Sudha247 Sudha247 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this down, this is very useful. I read through parts of the document and some comments below. Will do another pass later.

Comment thread doc/dev/tools.md Outdated

CR-soon Alizter: Edge cases to specify:

- Tool not locked: error with suggestion to run `dune tools add`?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any downsides to automatically locking and installing when the tool is not found?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that in that case the command that would launch the dev tool locks up for an extended time period with no good way to communicate to the caller that it's locking, downloading and building the dev tool.

It might still be worthwhile but its good to have this issue in mind when designing.

Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools-design/implementation.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools-design/implementation.md Outdated

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this along. It's one of the most important things in package management (arguably even the most) and I appreciate that this is starting to move along.

Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated

- **Generality**: Any opam package providing executables can be a tool
- **Orthogonality**: Tools are solved independently from project dependencies
- **Clean source tree**: All tool artifacts live in `_build/`, not your repo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"work tree" is probably the better wording here.

Comment thread doc/dev/tools.md Outdated

CR-soon Alizter: Edge cases to specify:

- Tool not locked: error with suggestion to run `dune tools add`?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that in that case the command that would launch the dev tool locks up for an extended time period with no good way to communicate to the caller that it's locking, downloading and building the dev tool.

It might still be worthwhile but its good to have this issue in mind when designing.

Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Sudha247 added a commit to Sudha247/dune that referenced this pull request Apr 16, 2026
Adds reference docs for `dune tools` as stated in ocaml#14184. The implementation of
dev tools is subject to change, as being discussed in ocaml#13457. But parts of the
user facing commands might stay and we might want to update the docs as the
implementation is being fleshed out.

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Sudha247 added a commit to Sudha247/dune that referenced this pull request Apr 16, 2026
Adds reference docs for `dune tools` as stated in ocaml#14184. The implementation of
dev tools is subject to change, as being discussed in ocaml#13457. But parts of the
user facing commands might stay and we might want to update the docs as the
implementation is being fleshed out.

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Sudha247 added a commit to Sudha247/dune that referenced this pull request Apr 20, 2026
Adds reference docs for `dune tools` as stated in ocaml#14184. The implementation of
dev tools is subject to change, as being discussed in ocaml#13457. But parts of the
user facing commands might stay and we might want to update the docs as the
implementation is being fleshed out.

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Sudha247 added a commit to Sudha247/dune that referenced this pull request Apr 21, 2026
Adds reference docs for `dune tools` as stated in ocaml#14184. The implementation of
dev tools is subject to change, as being discussed in ocaml#13457. But parts of the
user facing commands might stay and we might want to update the docs as the
implementation is being fleshed out.

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Alizter added a commit that referenced this pull request Apr 21, 2026
Adds reference docs for `dune tools` as stated in #14184. The
implementation of dev tools is subject to change, as discussed in
#13457. But parts of the user-facing commands might stay, and if we
decide to merge this, we might want to update the docs as the
implementation is being fleshed out.
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated

CR-soon Alizter: `dune tools path` behavior is underspecified:

- Should `path` trigger download and build if not yet built? Or only return path

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option could be to provide a warning that the tools are not built while returning the path. However, I'd imagine consumers of this could be other platform tools. In that case wouldn't having a hard error break their workflows?

@Sudha247 Sudha247 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to see this moving along! I'm of the belief that this is one of the most important, if not the most important, features for Dune package management. Thanks for pushing this along @Alizter and @shonfeder.

I'm generally happy with the direction this is moving along. However, I think we still have some open questions to address before we can merge this.

Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools-design/implementation.md Outdated
Comment thread doc/dev/tools.md Outdated

#### 6.2. Automatic updates

Tools do not auto-update; explicit user action is required.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to make a note here that this differs from the auto-locking model we have been discussing in #13011. It could be the case that the two of them have different needs and hence different models. However, it's worth documenting why that is. Both of them share several similar concerns:

  • It was stated in the quoted issue that users find it tedious to maintain lockfiles. Even though there is no explicit lock file visible to the user, that concern still applies here.
  • Why is the model for deps to update by default when we run dune build, and not the case for tools?
  • This model also makes offline mode a possibility, which is still an open problem for dependencies.

Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools.md Outdated
Comment thread doc/dev/tools-design/implementation.md Outdated
;; Using a binary package repository
(tool
(package ocaml-lsp-server)
(repositories binary-packages))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is perhaps not in line with 6.5, which states that tools are always built from source.

Comment thread doc/dev/tools-design/implementation.md Outdated

## Learnings from the Prototype

CR-soon Alizter: This entire section may be considered garbage. Extract

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a pass before merging.

shonfeder and others added 9 commits May 29, 2026 23:06
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Let's add this back when the document takes shape to clarify confusion.
At the moment it is not adding anything and is potentially confusing.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
- It shouldn't mention implementation details (switch etc.)
- It is too constrained (excluding tools defined in a project build)
- Given unnecessary context (mentioning current design)
- Does not include wide enough examples of tools (only mentions tools we
  widely used and already supported with bespoke mechanisms)

Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
This is essential for clear communication, otherwise key terms get used
inconsistently or understood ambiguously.

As a result of recovering terminology we also detect an error in the
"generality" principle: packages themselves are not tools, but they
provide tools so "any opam package ... can be a tool" is a category
mistake.

Signed-off-by: Shon Feder <shon.feder@gmail.com>
This is not a useful section: things that aren't required just don't
need to be listed as requirements.

The canonical way of differentiating necessary from merely recommended
requirements is MUST vs. SHOULD (or RECOMMENDED):
https://www.ietf.org/rfc/rfc2119.txt

Signed-off-by: Shon Feder <shon.feder@gmail.com>
shonfeder and others added 22 commits July 18, 2026 23:52
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Relevant parts extracted from issues on the issue tracker tagged 'dev-tools'

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Links aren't rendered in summary tags, and we will have additional
details we want to add probably, so let's make the collapsed section
more general.

Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
It didn't make sense in the req it was under, and indeed we didn't have
a req for it.

Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Signed-off-by: Shon Feder <shon.feder@gmail.com>
To be added back in a new branch, and staged as its own PR.

Signed-off-by: Shon Feder <shon.feder@gmail.com>
@shonfeder shonfeder changed the title [draft] Tool management design [draft] Tool management requirements Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify tool management requirements

5 participants