Skip to content

Conversation

@Leonidas-from-XIV
Copy link
Collaborator

Updates to the tutorial to use autolocking (plus explain how to manually lock).

Closes #12796

@Leonidas-from-XIV
Copy link
Collaborator Author

Unfortunately I had to remove a lot of output where the solution was displayed, because with autolocking the solution is not displayed anymore. I've opened #12865 to discuss how to improve the user experience in that case, giving a users a way to figure out which packages + versions were selected by the solver.

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the update-pkg-mgmt-tutorial-autolock branch from c435b75 to eb5bcf5 Compare December 5, 2025 10:18
@Leonidas-from-XIV Leonidas-from-XIV marked this pull request as ready for review December 5, 2025 10:18
Comment on lines 5 to 6
packages are published in the opam-repository occasionally, Dune might pick
different solutions over time.
Copy link
Member

Choose a reason for hiding this comment

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

I think this isn't a very robust account of the dynamics at play. Whether or not new packages are published, different builds can end up with different dependencies based on a number of factors: the system run on, the which repos are pinned, whether or not the user has had connectivity, whether packages are marked unavailable, etc. I think it's better to just describe the core need that motivates locking. And you do that in the next paragraph. So maybe this sentence can be removed?

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the update-pkg-mgmt-tutorial-autolock branch 2 times, most recently from aad05d3 to 15a0e31 Compare December 8, 2025 15:29
@Leonidas-from-XIV Leonidas-from-XIV changed the title Update documentation to use autolocking Update tutorial to use autolocking Dec 8, 2025
Copy link
Collaborator

@Sudha247 Sudha247 left a comment

Choose a reason for hiding this comment

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

Good to have this updated!

Some remarks below. I also found mentions of dune pkg lock in howto/use-opam-alongside-dune-package-management.rst and howto/homebrew-package.rst which we might want to check.

@shonfeder
Copy link
Member

Is this ready for another review? Or is it still being worked on?

@Leonidas-from-XIV
Copy link
Collaborator Author

Yes, I welcome some reviews so maybe we can get it merged in time for 3.21.

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the update-pkg-mgmt-tutorial-autolock branch from 598ff93 to eebe860 Compare December 10, 2025 14:02
longer than usual, as the dependencies need to be built first. Subsequent
builds where all dependencies have been built before will be just as fast as
before.
Since this is the first time we have run the build system after enabling package
Copy link
Collaborator

@Sudha247 Sudha247 Dec 10, 2025

Choose a reason for hiding this comment

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

It seems this is getting folded in the collapsible dune-workspace. I'm not sure that is intended?

Copy link
Collaborator

@Sudha247 Sudha247 left a comment

Choose a reason for hiding this comment

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

I've gone through the tutorial once to validate we get the expected results, and we do. I think this is good to go.

Copy link
Member

@shonfeder shonfeder left a comment

Choose a reason for hiding this comment

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

I have a few more suggestions, but they don't need to blocking.


which will download and install the new dependencies and build our project as
before.
This will recongnize that the project depends on new packages. Thus it will
Copy link
Member

Choose a reason for hiding this comment

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

What does 'this' refer to 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.

Good question. I've clarified it and rewrote some paragraphs that also started with "This" to be more precise and hopefully less repetitive.

Comment on lines 12 to 13
(lock_dir
(repositories overlay1 upstream1))
Copy link
Member

Choose a reason for hiding this comment

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

Ugh, that is awkward :( seems to be leaking implementation details, but that can be addressed in some followup.

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the update-pkg-mgmt-tutorial-autolock branch from d939e9d to 5925442 Compare December 11, 2025 09:41
@Leonidas-from-XIV Leonidas-from-XIV force-pushed the update-pkg-mgmt-tutorial-autolock branch from 5925442 to ff00b58 Compare December 11, 2025 09:43
@Leonidas-from-XIV Leonidas-from-XIV merged commit 9be6bbe into ocaml:main Dec 11, 2025
19 of 20 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the update-pkg-mgmt-tutorial-autolock branch December 11, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation improvements package management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update documentation for autolocking

3 participants