Skip to content

Conversation

@Leonidas-from-XIV
Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV commented Nov 4, 2025

This follows the discussion from the 29th of October where we decided that the dev-tools can (for now) live in a directory that is unlikely to be committed to git.

closes #12097

@Alizter
Copy link
Collaborator

Alizter commented Nov 4, 2025

You can interpret the statement "move dev-tool lock dirs into hidden folder" in two different ways. Either that the dev-tool.lock folder becomes hidden or the folder actually gets moved to a hidden location.

When we discussed this I initially meant the latter case. Doing something like slotting it in _build/ seems sensible.

All the issues we have with people complaining about the folder currently will not go away when we make the directory hidden IMO.

@shonfeder
Copy link
Member

slotting it in _build/ seems sensible

This makes sens to me too!

@davesnx
Copy link
Contributor

davesnx commented Nov 5, 2025

I'm out of the conversation, but I wonder if dev-tools folder could be inside dune.lock folder?

@Alizter
Copy link
Collaborator

Alizter commented Nov 5, 2025

The issue we have here is that we don't want people committing their developer tool lock files but we don't mind people committing the build locks. If we merge them, then we cause problems for both parties.

@davesnx
Copy link
Contributor

davesnx commented Nov 5, 2025

Right, I figure it out but maybe up to them? If it's the only issue, can place a .gitignore inside dune-lock?

Place it under _build means that any rm -rf would cause issues

@Leonidas-from-XIV
Copy link
Collaborator Author

Place it under _build means that any rm -rf would cause issues.

It would not, as then Dune will recreate the build plan for dev-tools if it does not exist. This is what it is doing at the moment already if you delete your dev-tools.locks/<lock-dir>.

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the dev-tool-dotfiles branch 4 times, most recently from 7a2d49f to 4c44f66 Compare November 7, 2025 14:09
@Leonidas-from-XIV Leonidas-from-XIV marked this pull request as ready for review November 7, 2025 14:09
@shonfeder
Copy link
Member

I believe this is read for another round of reviews :)

Fs_memo.dir_exists (In_source_dir path))
lazy
(let path = Lock_dir.dev_tool_untracked_lock_dir Utop in
Path.Untracked.exists path)
Copy link
Member

Choose a reason for hiding this comment

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

How would this work in watch mode without Fs_memo?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It won't, but that wasn't the goal here. Fs_memo requires Path.Outside_build_dir which is going to have to be expanded if we are to account for _build/something-that's-not-a-context.

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the dev-tool-dotfiles branch 2 times, most recently from 7a26281 to 9e80516 Compare November 12, 2025 16:33
@Alizter Alizter requested review from Alizter and rgrinberg and removed request for ElectreAAS November 21, 2025 10:41
Source_tree.find_dir path >>| Option.is_some
Lock_dir.dev_tool_external_lock_dir Ocamlformat
|> Path.external_
|> Path.Untracked.exists
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why we're still breaking watch mode here? It's not really required to keep it working, but don't see why it's needed to intentionally break it here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The issue here is that when I change this to use Fs_memo.dir_exists (Path.Outside_build_dir.External (Lock_dir.dev_tool_external_lock_dir Ocamlformat)) I get a cached value of false, whereas Path.Untracked.exists returns true.

I've changed this to use the DUNE_CONFIG__LOCK_DEV_TOOL flag as signal for whether the lock dir was created instead of querying the file system (/cache). Given that this functionality is only enabled when the flag is set it seems to work and pass all the tests.

@Alizter
Copy link
Collaborator

Alizter commented Nov 24, 2025

I am still reviewing so I will reach a conclusion tomorrow.

@shonfeder shonfeder removed this from the [pkg]: Minimal Stable Product milestone Nov 25, 2025
Leonidas-from-XIV and others added 15 commits November 25, 2025 12:00
Signed-off-by: Marek Kubica <[email protected]>
Signed-off-by: Marek Kubica <[email protected]>
Signed-off-by: Marek Kubica <[email protected]>
Signed-off-by: Marek Kubica <[email protected]>
Signed-off-by: Marek Kubica <[email protected]>
@Leonidas-from-XIV Leonidas-from-XIV merged commit 1a5eaa9 into ocaml:main Nov 25, 2025
27 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the dev-tool-dotfiles branch November 25, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dune-pkg: do not write lock directories into the worktree by default

5 participants