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
feature(pkg): lock file configuration in workspace #7835
feature(pkg): lock file configuration in workspace #7835
Conversation
type t = Common.t | ||
type t = | ||
{ base : Common.t | ||
; lock : Path.Source.t option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be simpler to drop the option
and default this field to Dune_pkg.Lock_dir.path
during parsing if no value is specified in the workspace? Is it ever desirable for dune to distinguish between the case where lock
is omitted and the case where it's explicitly set to the default path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ever desirable for dune to distinguish between the case where lock is omitted and the case where it's explicitly set to the default path?
There's a couple of situations where the difference is useful:
- A lock file that hasn't been explicitly specified and is absent is not an error. While a lock file that has been explicitly specified and is absent is an error.
- When the types reflect exactly what the user has written, you can use them for serialization.
The 2nd point is a bit more general, so I tend to writing things in this style. However, 1. is the important one here.
Thinking about how this interacts with lockdir generation. Since lockdirs are associated with contexts, would it make sense to have |
I'm thinking that our current scheme works alright. There's no special location to use for a lockdir for a particular context. They all read from the default location unless explicitly specified. |
Signed-off-by: Rudi Grinberg <me@rgrinberg.com> <!-- ps-id: 4098e148-2708-484c-a5a2-7b5c3f3e1994 -->
2244e79
to
94af974
Compare
Just clarifying that our current scheme is to let the user pass a lockdir path to I think we do need to change |
This behavior sounds like it's trying to guess the user's intent a little too much. I'm not opposed though. I don't yet have any concrete use cases for multi context/multi lockdir builds in mind.
Not all commands are like that. For example, |
Fair enough. Happy to leave it as is for now and refine the UX when we have a clearer idea of how this will be used in practice. |
Okay so let's add |
Signed-off-by: Rudi Grinberg me@rgrinberg.com